parent
bef91af72b
commit
0b2cba2c29
@ -0,0 +1,160 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.bweb.config.SysConst; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hai.common.QRCodeGenerator; |
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.common.security.AESEncodeUtil; |
||||
import com.hai.common.security.SessionObject; |
||||
import com.hai.common.security.UserCenter; |
||||
import com.hai.common.utils.DateUtil; |
||||
import com.hai.common.utils.IDGenerator; |
||||
import com.hai.common.utils.ResponseMsgUtil; |
||||
import com.hai.entity.HighAgent; |
||||
import com.hai.entity.HighDiscount; |
||||
import com.hai.entity.HighDiscountAgentRel; |
||||
import com.hai.enum_type.QrCodeType; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.model.UserInfoModel; |
||||
import com.hai.service.HighAgentService; |
||||
import com.hai.service.HighDiscountAgentRelService; |
||||
import com.hai.service.HighDiscountService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.Date; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/4 00:19 |
||||
*/ |
||||
@Controller |
||||
@RequestMapping(value = "/discountAgentRel") |
||||
@Api(value = "优惠券和代理商接口") |
||||
public class HighDiscountAgentRelController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(HighDiscountAgentRelController.class); |
||||
|
||||
@Autowired |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private HighAgentService highAgentService; |
||||
|
||||
@Resource |
||||
private HighDiscountService highDiscountService; |
||||
|
||||
@Resource |
||||
private HighDiscountAgentRelService highDiscountAgentRelService; |
||||
|
||||
@RequestMapping(value="/insertDiscountAgent",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "分配优惠券给代理商") |
||||
public ResponseData insertDiscountAgent(@RequestBody HighDiscountAgentRel highDiscountAgentRel, HttpServletRequest request) { |
||||
try { |
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
||||
if (userInfoModel.getBsCompany() == null) { |
||||
log.error("HighDiscountAgentRelController -> insertDiscount() error!","该主角色没有权限"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); |
||||
} |
||||
if (highDiscountAgentRel.getDiscountId() == null |
||||
|| highDiscountAgentRel.getAgentId() == null |
||||
|| highDiscountAgentRel.getStockCount() == null) { |
||||
log.error("HighDiscountAgentRelController -> insertDiscountAgent() error!","参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
// 查询优惠券
|
||||
HighDiscount discount = highDiscountService.getDiscountById(highDiscountAgentRel.getDiscountId()); |
||||
if(discount == null) { |
||||
log.error("HighDiscountAgentRelController -> insertDiscountAgent() error!","未找到优惠券信息"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_DISCOUNT, ""); |
||||
} |
||||
|
||||
// 查询代理商
|
||||
HighAgent agent = highAgentService.findByAgentMsgId(highDiscountAgentRel.getAgentId()); |
||||
if(agent == null) { |
||||
log.error("HighDiscountAgentRelController -> insertDiscountAgent() error!","未找到代理商信息"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_AGENT, ""); |
||||
} |
||||
|
||||
// 是否已分配
|
||||
if (highDiscountAgentRelService.getRelByDiscountAgent(highDiscountAgentRel.getDiscountId(), highDiscountAgentRel.getAgentId()) != null) { |
||||
log.error("HighDiscountAgentRelController -> insertDiscountAgent() error!", discount.getDiscountName() + "重复分配给" + agent.getAgentName()); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, discount.getDiscountName() + "重复分配给" + agent.getAgentName()); |
||||
} |
||||
highDiscountAgentRel.setCreateTime(new Date()); |
||||
highDiscountAgentRel.setStatus(1); |
||||
highDiscountAgentRelService.insertDiscountAgentRel(highDiscountAgentRel); |
||||
|
||||
// 生成二维码
|
||||
String qrCodeImg = DateUtil.date2String(new Date(),agent.getId() + discount.getId() + "yyyyMMddHHmmss") + IDGenerator.nextId(10) +".png"; |
||||
String qrCodeUrl = SysConst.getSysConfig().getAgentQrCode() + "/ " + qrCodeImg; |
||||
|
||||
//参数
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("type", QrCodeType.AGENT_QR_CODE); |
||||
map.put("code", AESEncodeUtil.aesEncrypt(highDiscountAgentRel.getId().toString())); |
||||
QRCodeGenerator.generateQRCodeImage(JSON.toJSONString(map), 350, 350, qrCodeUrl); |
||||
highDiscountAgentRel.setQrCode(qrCodeImg); |
||||
highDiscountAgentRelService.updateDiscountAgentRel(highDiscountAgentRel); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
} catch (Exception e) { |
||||
log.error("HighDiscountController -> insertDiscountAgent() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value="/getDiscountAgentById",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "根据id查询") |
||||
public ResponseData getDiscountAgentById(@RequestParam(name = "id", required = true) Long id) { |
||||
try { |
||||
|
||||
return ResponseMsgUtil.success(highDiscountAgentRelService.getRelById(id)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighDiscountController -> getDiscountAgentById() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getDiscountAgentList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询列表") |
||||
public ResponseData getDiscountAgentList(@RequestParam(name = "discountId", required = false) Long discountId, |
||||
@RequestParam(name = "agentId", required = false) Long agentId, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
||||
try { |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("discountId", discountId); |
||||
map.put("agentId", agentId); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(highDiscountAgentRelService.getRelList(map))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighDiscountController -> getDiscountAgentList() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,172 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.common.security.SessionObject; |
||||
import com.hai.common.security.UserCenter; |
||||
import com.hai.common.utils.ResponseMsgUtil; |
||||
import com.hai.entity.HighDiscount; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.model.UserInfoModel; |
||||
import com.hai.service.HighDiscountService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/3 22:26 |
||||
*/ |
||||
@Controller |
||||
@RequestMapping(value = "/discount") |
||||
@Api(value = "优惠券接口") |
||||
public class HighDiscountController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(HighDiscountController.class); |
||||
|
||||
@Autowired |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private HighDiscountService highDiscountService; |
||||
|
||||
|
||||
@RequestMapping(value="/insertDiscount",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "增加优惠券") |
||||
public ResponseData insertDiscount(@RequestBody HighDiscount highDiscount, HttpServletRequest request) { |
||||
try { |
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
||||
if (userInfoModel.getBsCompany() == null) { |
||||
log.error("HighDiscountController -> insertDiscount() error!","该主角色没有权限"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); |
||||
} |
||||
if (StringUtils.isBlank(highDiscount.getDiscountName()) |
||||
|| StringUtils.isBlank(highDiscount.getDiscountImg()) |
||||
|| StringUtils.isBlank(highDiscount.getDiscountCarouselImg()) |
||||
|| highDiscount.getDiscountType() == null |
||||
|| highDiscount.getDiscountPrice() == null |
||||
|| highDiscount.getEffectiveDay() == null |
||||
|| highDiscount.getSalesEndTime() == null) { |
||||
log.error("HighDiscountController -> insertDiscount() error!","参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
// 卡卷类型 1:满减 2:抵扣 3:折扣
|
||||
if(highDiscount.getDiscountType() == 1 && highDiscount.getDiscountCondition() == null) { |
||||
log.error("HighDiscountController -> insertDiscount() error!","参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
highDiscount.setCompanyId(userInfoModel.getBsCompany().getId()); |
||||
highDiscount.setOperatorId(userInfoModel.getSecUser().getId()); |
||||
highDiscount.setOperatorName(userInfoModel.getSecUser().getUserName()); |
||||
highDiscount.setStatus(1); |
||||
|
||||
highDiscountService.insertDiscount(highDiscount); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
} catch (Exception e) { |
||||
log.error("HighDiscountController -> insertDiscount() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/updateDiscount",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "修改优惠券") |
||||
public ResponseData updateDiscount(@RequestBody HighDiscount highDiscount, HttpServletRequest request) { |
||||
try { |
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
||||
if (userInfoModel.getBsCompany() == null) { |
||||
log.error("HighDiscountController -> updateDiscount() error!","该主角色没有权限"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); |
||||
} |
||||
if (highDiscount.getId() == null |
||||
|| StringUtils.isBlank(highDiscount.getDiscountName()) |
||||
|| StringUtils.isBlank(highDiscount.getDiscountImg()) |
||||
|| StringUtils.isBlank(highDiscount.getDiscountCarouselImg()) |
||||
|| highDiscount.getEffectiveDay() == null |
||||
|| highDiscount.getSalesEndTime() == null) { |
||||
log.error("HighDiscountController -> updateDiscount() error!","参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
// 查询优惠券
|
||||
HighDiscount discount = highDiscountService.getDiscountById(highDiscount.getId()); |
||||
if (discount == null) { |
||||
log.error("HighDiscountController -> updateDiscount() error!","未找到优惠券信息"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_DISCOUNT, ""); |
||||
} |
||||
discount.setDiscountName(highDiscount.getDiscountName()); |
||||
discount.setDiscountImg(highDiscount.getDiscountImg()); |
||||
discount.setDiscountCarouselImg(highDiscount.getDiscountCarouselImg()); |
||||
discount.setEffectiveDay(highDiscount.getEffectiveDay()); |
||||
discount.setSalesEndTime(highDiscount.getSalesEndTime()); |
||||
|
||||
highDiscountService.updateDiscount(highDiscount); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
} catch (Exception e) { |
||||
log.error("HighDiscountController -> updateDiscount() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value="/getDiscountById",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "根据id查询") |
||||
public ResponseData getDiscountById(@RequestParam(name = "id", required = true) Long id) { |
||||
try { |
||||
|
||||
return ResponseMsgUtil.success(highDiscountService.getDiscountById(id)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighDiscountController -> getDiscountById() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getDiscountList",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询优惠券列表") |
||||
public ResponseData getDiscountList(@RequestParam(name = "discountKey", required = false) String discountKey, |
||||
@RequestParam(name = "discountName", required = false) String discountName, |
||||
@RequestParam(name = "discountType", required = false) Integer discountType, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
||||
try { |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("discountKey", discountKey); |
||||
map.put("discountName", discountName); |
||||
map.put("discountType", discountType); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(highDiscountService.getDiscount(map))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighDiscountController -> getDiscountList() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,109 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.common.utils.ResponseMsgUtil; |
||||
import com.hai.entity.HighDiscountCouponRel; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.service.HighAgentService; |
||||
import com.hai.service.HighDiscountCouponRelService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/3 23:25 |
||||
*/ |
||||
@Controller |
||||
@RequestMapping(value = "/discountCoupon") |
||||
@Api(value = "优惠券和卡卷的关系接口") |
||||
public class HighDiscountCouponRelController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(HighDiscountCouponRelController.class); |
||||
|
||||
@Resource |
||||
private HighDiscountCouponRelService highDiscountCouponRelService; |
||||
|
||||
@RequestMapping(value="/insertDiscountCoupon",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "增加优惠券和卡券关系") |
||||
public ResponseData insertDiscountCoupon(@RequestBody String reqBody) { |
||||
try { |
||||
JSONObject jsonObject = JSONObject.parseObject(reqBody); |
||||
Long discountId = jsonObject.getLong("discountId"); |
||||
Long couponId = jsonObject.getLong("couponId"); |
||||
|
||||
if (discountId == null || couponId == null) { |
||||
log.error("HighDiscountCouponRelController -> insertDiscountCoupon() error!","参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
// 是否存在
|
||||
if (highDiscountCouponRelService.getRelByDiscountCoupon(discountId,couponId) != null) { |
||||
log.error("HighDiscountCouponRelController -> insertDiscountCoupon() error!","重复增加"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "重复增加"); |
||||
} |
||||
|
||||
|
||||
HighDiscountCouponRel rel = new HighDiscountCouponRel(); |
||||
rel.setDiscountId(discountId); |
||||
rel.setCouponId(couponId); |
||||
rel.setStatus(1); |
||||
rel.setCreateTime(new Date()); |
||||
highDiscountCouponRelService.insertDiscountCoupon(rel); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighDiscountCouponRelController -> insertDiscountCoupon() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/delete",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "删除") |
||||
public ResponseData delete(@RequestParam(name = "id", required = false) Long id){ |
||||
try { |
||||
|
||||
HighDiscountCouponRel rel = highDiscountCouponRelService.getRelById(id); |
||||
if (rel == null) { |
||||
log.error("HighDiscountCouponRelController -> delete() error!","参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
rel.setStatus(0); |
||||
highDiscountCouponRelService.updateDiscountCoupon(rel); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighDiscountCouponRelController -> delete() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/insertDiscount",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "根据卡卷 查询关联卡券") |
||||
public ResponseData getRelByDiscount(@RequestParam(name = "discountId", required = true) Long discountId) { |
||||
try { |
||||
|
||||
return ResponseMsgUtil.success(highDiscountCouponRelService.getRelByDiscount(discountId)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighDiscountController -> getRelByDiscount() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,2 +1,3 @@ |
||||
fileUrl=/home/project/hsg/filesystem |
||||
cmsPath=/home/project/hsg/filesystem/cmsPath |
||||
agentQrCode=/home/project/hsg/filesystem/agentQrCode |
||||
|
@ -1,2 +1,3 @@ |
||||
fileUrl=/home/project/hsg/filesystem |
||||
cmsPath=/home/project/hsg/filesystem/cmsPath |
||||
agentQrCode=/home/project/hsg/filesystem/agentQrCode |
||||
|
@ -0,0 +1,117 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighDiscountAgentRel; |
||||
import com.hai.entity.HighDiscountAgentRelExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface HighDiscountAgentRelMapper extends HighDiscountAgentRelMapperExt { |
||||
@SelectProvider(type=HighDiscountAgentRelSqlProvider.class, method="countByExample") |
||||
long countByExample(HighDiscountAgentRelExample example); |
||||
|
||||
@DeleteProvider(type=HighDiscountAgentRelSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighDiscountAgentRelExample example); |
||||
|
||||
@Delete({ |
||||
"delete from high_discount_agent_rel", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into high_discount_agent_rel (discount_id, agent_id, ", |
||||
"stock_count, create_time, ", |
||||
"`status`, qr_code, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{discountId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ", |
||||
"#{stockCount,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{status,jdbcType=INTEGER}, #{qrCode,jdbcType=VARCHAR}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(HighDiscountAgentRel record); |
||||
|
||||
@InsertProvider(type=HighDiscountAgentRelSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighDiscountAgentRel record); |
||||
|
||||
@SelectProvider(type=HighDiscountAgentRelSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="stock_count", property="stockCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<HighDiscountAgentRel> selectByExample(HighDiscountAgentRelExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, discount_id, agent_id, stock_count, create_time, `status`, qr_code, ext_1, ", |
||||
"ext_2, ext_3", |
||||
"from high_discount_agent_rel", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="stock_count", property="stockCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
HighDiscountAgentRel selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=HighDiscountAgentRelSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighDiscountAgentRel record, @Param("example") HighDiscountAgentRelExample example); |
||||
|
||||
@UpdateProvider(type=HighDiscountAgentRelSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighDiscountAgentRel record, @Param("example") HighDiscountAgentRelExample example); |
||||
|
||||
@UpdateProvider(type=HighDiscountAgentRelSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(HighDiscountAgentRel record); |
||||
|
||||
@Update({ |
||||
"update high_discount_agent_rel", |
||||
"set discount_id = #{discountId,jdbcType=BIGINT},", |
||||
"agent_id = #{agentId,jdbcType=BIGINT},", |
||||
"stock_count = #{stockCount,jdbcType=INTEGER},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"qr_code = #{qrCode,jdbcType=VARCHAR},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(HighDiscountAgentRel record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighDiscountAgentRelMapperExt { |
||||
} |
@ -0,0 +1,304 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighDiscountAgentRel; |
||||
import com.hai.entity.HighDiscountAgentRelExample.Criteria; |
||||
import com.hai.entity.HighDiscountAgentRelExample.Criterion; |
||||
import com.hai.entity.HighDiscountAgentRelExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighDiscountAgentRelSqlProvider { |
||||
|
||||
public String countByExample(HighDiscountAgentRelExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_discount_agent_rel"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighDiscountAgentRelExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_discount_agent_rel"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighDiscountAgentRel record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_discount_agent_rel"); |
||||
|
||||
if (record.getDiscountId() != null) { |
||||
sql.VALUES("discount_id", "#{discountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getAgentId() != null) { |
||||
sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStockCount() != null) { |
||||
sql.VALUES("stock_count", "#{stockCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getQrCode() != null) { |
||||
sql.VALUES("qr_code", "#{qrCode,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(HighDiscountAgentRelExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("discount_id"); |
||||
sql.SELECT("agent_id"); |
||||
sql.SELECT("stock_count"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("qr_code"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("high_discount_agent_rel"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
HighDiscountAgentRel record = (HighDiscountAgentRel) parameter.get("record"); |
||||
HighDiscountAgentRelExample example = (HighDiscountAgentRelExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount_agent_rel"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountId() != null) { |
||||
sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getAgentId() != null) { |
||||
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStockCount() != null) { |
||||
sql.SET("stock_count = #{record.stockCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getQrCode() != null) { |
||||
sql.SET("qr_code = #{record.qrCode,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount_agent_rel"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); |
||||
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); |
||||
sql.SET("stock_count = #{record.stockCount,jdbcType=INTEGER}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("qr_code = #{record.qrCode,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
HighDiscountAgentRelExample example = (HighDiscountAgentRelExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(HighDiscountAgentRel record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount_agent_rel"); |
||||
|
||||
if (record.getDiscountId() != null) { |
||||
sql.SET("discount_id = #{discountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getAgentId() != null) { |
||||
sql.SET("agent_id = #{agentId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStockCount() != null) { |
||||
sql.SET("stock_count = #{stockCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getQrCode() != null) { |
||||
sql.SET("qr_code = #{qrCode,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, HighDiscountAgentRelExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,108 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighDiscountCouponRel; |
||||
import com.hai.entity.HighDiscountCouponRelExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface HighDiscountCouponRelMapper extends HighDiscountCouponRelMapperExt { |
||||
@SelectProvider(type=HighDiscountCouponRelSqlProvider.class, method="countByExample") |
||||
long countByExample(HighDiscountCouponRelExample example); |
||||
|
||||
@DeleteProvider(type=HighDiscountCouponRelSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighDiscountCouponRelExample example); |
||||
|
||||
@Delete({ |
||||
"delete from high_discount_coupon_rel", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into high_discount_coupon_rel (discount_id, create_time, ", |
||||
"coupon_id, `status`, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{discountId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{couponId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(HighDiscountCouponRel record); |
||||
|
||||
@InsertProvider(type=HighDiscountCouponRelSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighDiscountCouponRel record); |
||||
|
||||
@SelectProvider(type=HighDiscountCouponRelSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<HighDiscountCouponRel> selectByExample(HighDiscountCouponRelExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, discount_id, create_time, coupon_id, `status`, ext_1, ext_2, ext_3", |
||||
"from high_discount_coupon_rel", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
HighDiscountCouponRel selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=HighDiscountCouponRelSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighDiscountCouponRel record, @Param("example") HighDiscountCouponRelExample example); |
||||
|
||||
@UpdateProvider(type=HighDiscountCouponRelSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighDiscountCouponRel record, @Param("example") HighDiscountCouponRelExample example); |
||||
|
||||
@UpdateProvider(type=HighDiscountCouponRelSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(HighDiscountCouponRel record); |
||||
|
||||
@Update({ |
||||
"update high_discount_coupon_rel", |
||||
"set discount_id = #{discountId,jdbcType=BIGINT},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"coupon_id = #{couponId,jdbcType=BIGINT},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(HighDiscountCouponRel record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighDiscountCouponRelMapperExt { |
||||
} |
@ -0,0 +1,276 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighDiscountCouponRel; |
||||
import com.hai.entity.HighDiscountCouponRelExample.Criteria; |
||||
import com.hai.entity.HighDiscountCouponRelExample.Criterion; |
||||
import com.hai.entity.HighDiscountCouponRelExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighDiscountCouponRelSqlProvider { |
||||
|
||||
public String countByExample(HighDiscountCouponRelExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_discount_coupon_rel"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighDiscountCouponRelExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_discount_coupon_rel"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighDiscountCouponRel record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_discount_coupon_rel"); |
||||
|
||||
if (record.getDiscountId() != null) { |
||||
sql.VALUES("discount_id", "#{discountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCouponId() != null) { |
||||
sql.VALUES("coupon_id", "#{couponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(HighDiscountCouponRelExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("discount_id"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("coupon_id"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("high_discount_coupon_rel"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
HighDiscountCouponRel record = (HighDiscountCouponRel) parameter.get("record"); |
||||
HighDiscountCouponRelExample example = (HighDiscountCouponRelExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount_coupon_rel"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountId() != null) { |
||||
sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCouponId() != null) { |
||||
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount_coupon_rel"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
HighDiscountCouponRelExample example = (HighDiscountCouponRelExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(HighDiscountCouponRel record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount_coupon_rel"); |
||||
|
||||
if (record.getDiscountId() != null) { |
||||
sql.SET("discount_id = #{discountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCouponId() != null) { |
||||
sql.SET("coupon_id = #{couponId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, HighDiscountCouponRelExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,156 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighDiscount; |
||||
import com.hai.entity.HighDiscountExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface HighDiscountMapper extends HighDiscountMapperExt { |
||||
@SelectProvider(type=HighDiscountSqlProvider.class, method="countByExample") |
||||
long countByExample(HighDiscountExample example); |
||||
|
||||
@DeleteProvider(type=HighDiscountSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighDiscountExample example); |
||||
|
||||
@Delete({ |
||||
"delete from high_discount", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into high_discount (company_id, discount_key, ", |
||||
"discount_name, discount_img, ", |
||||
"discount_carousel_img, discount_type, ", |
||||
"discount_condition, discount_price, ", |
||||
"effective_day, sales_end_time, ", |
||||
"create_time, update_time, ", |
||||
"operator_id, operator_name, ", |
||||
"`status`, ext_1, ext_2, ", |
||||
"ext_3)", |
||||
"values (#{companyId,jdbcType=BIGINT}, #{discountKey,jdbcType=VARCHAR}, ", |
||||
"#{discountName,jdbcType=VARCHAR}, #{discountImg,jdbcType=VARCHAR}, ", |
||||
"#{discountCarouselImg,jdbcType=VARCHAR}, #{discountType,jdbcType=INTEGER}, ", |
||||
"#{discountCondition,jdbcType=DECIMAL}, #{discountPrice,jdbcType=DECIMAL}, ", |
||||
"#{effectiveDay,jdbcType=INTEGER}, #{salesEndTime,jdbcType=TIMESTAMP}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", |
||||
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", |
||||
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", |
||||
"#{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(HighDiscount record); |
||||
|
||||
@InsertProvider(type=HighDiscountSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighDiscount record); |
||||
|
||||
@SelectProvider(type=HighDiscountSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="discount_key", property="discountKey", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_img", property="discountImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_carousel_img", property="discountCarouselImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="effective_day", property="effectiveDay", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<HighDiscount> selectByExample(HighDiscountExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, company_id, discount_key, discount_name, discount_img, discount_carousel_img, ", |
||||
"discount_type, discount_condition, discount_price, effective_day, sales_end_time, ", |
||||
"create_time, update_time, operator_id, operator_name, `status`, ext_1, ext_2, ", |
||||
"ext_3", |
||||
"from high_discount", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="discount_key", property="discountKey", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_img", property="discountImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_carousel_img", property="discountCarouselImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="effective_day", property="effectiveDay", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
HighDiscount selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=HighDiscountSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighDiscount record, @Param("example") HighDiscountExample example); |
||||
|
||||
@UpdateProvider(type=HighDiscountSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighDiscount record, @Param("example") HighDiscountExample example); |
||||
|
||||
@UpdateProvider(type=HighDiscountSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(HighDiscount record); |
||||
|
||||
@Update({ |
||||
"update high_discount", |
||||
"set company_id = #{companyId,jdbcType=BIGINT},", |
||||
"discount_key = #{discountKey,jdbcType=VARCHAR},", |
||||
"discount_name = #{discountName,jdbcType=VARCHAR},", |
||||
"discount_img = #{discountImg,jdbcType=VARCHAR},", |
||||
"discount_carousel_img = #{discountCarouselImg,jdbcType=VARCHAR},", |
||||
"discount_type = #{discountType,jdbcType=INTEGER},", |
||||
"discount_condition = #{discountCondition,jdbcType=DECIMAL},", |
||||
"discount_price = #{discountPrice,jdbcType=DECIMAL},", |
||||
"effective_day = #{effectiveDay,jdbcType=INTEGER},", |
||||
"sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"operator_id = #{operatorId,jdbcType=BIGINT},", |
||||
"operator_name = #{operatorName,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(HighDiscount record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighDiscountMapperExt { |
||||
} |
@ -0,0 +1,430 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighDiscount; |
||||
import com.hai.entity.HighDiscountExample.Criteria; |
||||
import com.hai.entity.HighDiscountExample.Criterion; |
||||
import com.hai.entity.HighDiscountExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighDiscountSqlProvider { |
||||
|
||||
public String countByExample(HighDiscountExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_discount"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighDiscountExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_discount"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighDiscount record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_discount"); |
||||
|
||||
if (record.getCompanyId() != null) { |
||||
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountKey() != null) { |
||||
sql.VALUES("discount_key", "#{discountKey,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountName() != null) { |
||||
sql.VALUES("discount_name", "#{discountName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountImg() != null) { |
||||
sql.VALUES("discount_img", "#{discountImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountCarouselImg() != null) { |
||||
sql.VALUES("discount_carousel_img", "#{discountCarouselImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountType() != null) { |
||||
sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getDiscountCondition() != null) { |
||||
sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDiscountPrice() != null) { |
||||
sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getEffectiveDay() != null) { |
||||
sql.VALUES("effective_day", "#{effectiveDay,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSalesEndTime() != null) { |
||||
sql.VALUES("sales_end_time", "#{salesEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.VALUES("operator_id", "#{operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.VALUES("operator_name", "#{operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(HighDiscountExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("company_id"); |
||||
sql.SELECT("discount_key"); |
||||
sql.SELECT("discount_name"); |
||||
sql.SELECT("discount_img"); |
||||
sql.SELECT("discount_carousel_img"); |
||||
sql.SELECT("discount_type"); |
||||
sql.SELECT("discount_condition"); |
||||
sql.SELECT("discount_price"); |
||||
sql.SELECT("effective_day"); |
||||
sql.SELECT("sales_end_time"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("operator_id"); |
||||
sql.SELECT("operator_name"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("high_discount"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
HighDiscount record = (HighDiscount) parameter.get("record"); |
||||
HighDiscountExample example = (HighDiscountExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCompanyId() != null) { |
||||
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountKey() != null) { |
||||
sql.SET("discount_key = #{record.discountKey,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountName() != null) { |
||||
sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountImg() != null) { |
||||
sql.SET("discount_img = #{record.discountImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountCarouselImg() != null) { |
||||
sql.SET("discount_carousel_img = #{record.discountCarouselImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountType() != null) { |
||||
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getDiscountCondition() != null) { |
||||
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDiscountPrice() != null) { |
||||
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getEffectiveDay() != null) { |
||||
sql.SET("effective_day = #{record.effectiveDay,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSalesEndTime() != null) { |
||||
sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); |
||||
sql.SET("discount_key = #{record.discountKey,jdbcType=VARCHAR}"); |
||||
sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); |
||||
sql.SET("discount_img = #{record.discountImg,jdbcType=VARCHAR}"); |
||||
sql.SET("discount_carousel_img = #{record.discountCarouselImg,jdbcType=VARCHAR}"); |
||||
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); |
||||
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); |
||||
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("effective_day = #{record.effectiveDay,jdbcType=INTEGER}"); |
||||
sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); |
||||
sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
HighDiscountExample example = (HighDiscountExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(HighDiscount record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount"); |
||||
|
||||
if (record.getCompanyId() != null) { |
||||
sql.SET("company_id = #{companyId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountKey() != null) { |
||||
sql.SET("discount_key = #{discountKey,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountName() != null) { |
||||
sql.SET("discount_name = #{discountName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountImg() != null) { |
||||
sql.SET("discount_img = #{discountImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountCarouselImg() != null) { |
||||
sql.SET("discount_carousel_img = #{discountCarouselImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getDiscountType() != null) { |
||||
sql.SET("discount_type = #{discountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getDiscountCondition() != null) { |
||||
sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDiscountPrice() != null) { |
||||
sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getEffectiveDay() != null) { |
||||
sql.SET("effective_day = #{effectiveDay,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSalesEndTime() != null) { |
||||
sql.SET("sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOperatorId() != null) { |
||||
sql.SET("operator_id = #{operatorId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOperatorName() != null) { |
||||
sql.SET("operator_name = #{operatorName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, HighDiscountExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,117 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighDiscountUserRel; |
||||
import com.hai.entity.HighDiscountUserRelExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface HighDiscountUserRelMapper extends HighDiscountUserRelMapperExt { |
||||
@SelectProvider(type=HighDiscountUserRelSqlProvider.class, method="countByExample") |
||||
long countByExample(HighDiscountUserRelExample example); |
||||
|
||||
@DeleteProvider(type=HighDiscountUserRelSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighDiscountUserRelExample example); |
||||
|
||||
@Delete({ |
||||
"delete from high_discount_user_rel", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into high_discount_user_rel (discount_id, ageent_id, ", |
||||
"user_id, `status`, create_time, ", |
||||
"use_end_time, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{discountId,jdbcType=BIGINT}, #{ageentId,jdbcType=BIGINT}, ", |
||||
"#{userId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{useEndTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(HighDiscountUserRel record); |
||||
|
||||
@InsertProvider(type=HighDiscountUserRelSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighDiscountUserRel record); |
||||
|
||||
@SelectProvider(type=HighDiscountUserRelSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="ageent_id", property="ageentId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="use_end_time", property="useEndTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<HighDiscountUserRel> selectByExample(HighDiscountUserRelExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, discount_id, ageent_id, user_id, `status`, create_time, use_end_time, ext_1, ", |
||||
"ext_2, ext_3", |
||||
"from high_discount_user_rel", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="ageent_id", property="ageentId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="use_end_time", property="useEndTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
HighDiscountUserRel selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=HighDiscountUserRelSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighDiscountUserRel record, @Param("example") HighDiscountUserRelExample example); |
||||
|
||||
@UpdateProvider(type=HighDiscountUserRelSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighDiscountUserRel record, @Param("example") HighDiscountUserRelExample example); |
||||
|
||||
@UpdateProvider(type=HighDiscountUserRelSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(HighDiscountUserRel record); |
||||
|
||||
@Update({ |
||||
"update high_discount_user_rel", |
||||
"set discount_id = #{discountId,jdbcType=BIGINT},", |
||||
"ageent_id = #{ageentId,jdbcType=BIGINT},", |
||||
"user_id = #{userId,jdbcType=BIGINT},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"use_end_time = #{useEndTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(HighDiscountUserRel record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighDiscountUserRelMapperExt { |
||||
} |
@ -0,0 +1,304 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighDiscountUserRel; |
||||
import com.hai.entity.HighDiscountUserRelExample.Criteria; |
||||
import com.hai.entity.HighDiscountUserRelExample.Criterion; |
||||
import com.hai.entity.HighDiscountUserRelExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighDiscountUserRelSqlProvider { |
||||
|
||||
public String countByExample(HighDiscountUserRelExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_discount_user_rel"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighDiscountUserRelExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_discount_user_rel"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighDiscountUserRel record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_discount_user_rel"); |
||||
|
||||
if (record.getDiscountId() != null) { |
||||
sql.VALUES("discount_id", "#{discountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getAgeentId() != null) { |
||||
sql.VALUES("ageent_id", "#{ageentId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUseEndTime() != null) { |
||||
sql.VALUES("use_end_time", "#{useEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(HighDiscountUserRelExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("discount_id"); |
||||
sql.SELECT("ageent_id"); |
||||
sql.SELECT("user_id"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("use_end_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("high_discount_user_rel"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
HighDiscountUserRel record = (HighDiscountUserRel) parameter.get("record"); |
||||
HighDiscountUserRelExample example = (HighDiscountUserRelExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount_user_rel"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getDiscountId() != null) { |
||||
sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getAgeentId() != null) { |
||||
sql.SET("ageent_id = #{record.ageentId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUseEndTime() != null) { |
||||
sql.SET("use_end_time = #{record.useEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount_user_rel"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); |
||||
sql.SET("ageent_id = #{record.ageentId,jdbcType=BIGINT}"); |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("use_end_time = #{record.useEndTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
HighDiscountUserRelExample example = (HighDiscountUserRelExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(HighDiscountUserRel record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_discount_user_rel"); |
||||
|
||||
if (record.getDiscountId() != null) { |
||||
sql.SET("discount_id = #{discountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getAgeentId() != null) { |
||||
sql.SET("ageent_id = #{ageentId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUseEndTime() != null) { |
||||
sql.SET("use_end_time = #{useEndTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, HighDiscountUserRelExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,347 @@ |
||||
package com.hai.entity; |
||||
|
||||
import com.hai.model.HighDiscountModel; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_discount |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighDiscount extends HighDiscountModel implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 单位id |
||||
*/ |
||||
private Long companyId; |
||||
|
||||
/** |
||||
* 卡券编号 |
||||
*/ |
||||
private String discountKey; |
||||
|
||||
/** |
||||
* 优惠券名称 |
||||
*/ |
||||
private String discountName; |
||||
|
||||
/** |
||||
* 优惠券图片 |
||||
*/ |
||||
private String discountImg; |
||||
|
||||
/** |
||||
* 优惠券播图 |
||||
*/ |
||||
private String discountCarouselImg; |
||||
|
||||
/** |
||||
* 卡卷类型 1:满减 2:抵扣 3:折扣 |
||||
*/ |
||||
private Integer discountType; |
||||
|
||||
/** |
||||
* 优惠券条件(满减价格) |
||||
*/ |
||||
private BigDecimal discountCondition; |
||||
|
||||
/** |
||||
* 优惠券价格 |
||||
*/ |
||||
private BigDecimal discountPrice; |
||||
|
||||
/** |
||||
* 领取有效天数 |
||||
*/ |
||||
private Integer effectiveDay; |
||||
|
||||
/** |
||||
* 使用截止日期 |
||||
*/ |
||||
private Date salesEndTime; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 操作人id |
||||
*/ |
||||
private Long operatorId; |
||||
|
||||
/** |
||||
* 操作人名称 |
||||
*/ |
||||
private String operatorName; |
||||
|
||||
/** |
||||
* 状态:0.删除 1.编辑中 2.已上架 3.已下架 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getCompanyId() { |
||||
return companyId; |
||||
} |
||||
|
||||
public void setCompanyId(Long companyId) { |
||||
this.companyId = companyId; |
||||
} |
||||
|
||||
public String getDiscountKey() { |
||||
return discountKey; |
||||
} |
||||
|
||||
public void setDiscountKey(String discountKey) { |
||||
this.discountKey = discountKey; |
||||
} |
||||
|
||||
public String getDiscountName() { |
||||
return discountName; |
||||
} |
||||
|
||||
public void setDiscountName(String discountName) { |
||||
this.discountName = discountName; |
||||
} |
||||
|
||||
public String getDiscountImg() { |
||||
return discountImg; |
||||
} |
||||
|
||||
public void setDiscountImg(String discountImg) { |
||||
this.discountImg = discountImg; |
||||
} |
||||
|
||||
public String getDiscountCarouselImg() { |
||||
return discountCarouselImg; |
||||
} |
||||
|
||||
public void setDiscountCarouselImg(String discountCarouselImg) { |
||||
this.discountCarouselImg = discountCarouselImg; |
||||
} |
||||
|
||||
public Integer getDiscountType() { |
||||
return discountType; |
||||
} |
||||
|
||||
public void setDiscountType(Integer discountType) { |
||||
this.discountType = discountType; |
||||
} |
||||
|
||||
public BigDecimal getDiscountCondition() { |
||||
return discountCondition; |
||||
} |
||||
|
||||
public void setDiscountCondition(BigDecimal discountCondition) { |
||||
this.discountCondition = discountCondition; |
||||
} |
||||
|
||||
public BigDecimal getDiscountPrice() { |
||||
return discountPrice; |
||||
} |
||||
|
||||
public void setDiscountPrice(BigDecimal discountPrice) { |
||||
this.discountPrice = discountPrice; |
||||
} |
||||
|
||||
public Integer getEffectiveDay() { |
||||
return effectiveDay; |
||||
} |
||||
|
||||
public void setEffectiveDay(Integer effectiveDay) { |
||||
this.effectiveDay = effectiveDay; |
||||
} |
||||
|
||||
public Date getSalesEndTime() { |
||||
return salesEndTime; |
||||
} |
||||
|
||||
public void setSalesEndTime(Date salesEndTime) { |
||||
this.salesEndTime = salesEndTime; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Long getOperatorId() { |
||||
return operatorId; |
||||
} |
||||
|
||||
public void setOperatorId(Long operatorId) { |
||||
this.operatorId = operatorId; |
||||
} |
||||
|
||||
public String getOperatorName() { |
||||
return operatorName; |
||||
} |
||||
|
||||
public void setOperatorName(String operatorName) { |
||||
this.operatorName = operatorName; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
HighDiscount other = (HighDiscount) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) |
||||
&& (this.getDiscountKey() == null ? other.getDiscountKey() == null : this.getDiscountKey().equals(other.getDiscountKey())) |
||||
&& (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName())) |
||||
&& (this.getDiscountImg() == null ? other.getDiscountImg() == null : this.getDiscountImg().equals(other.getDiscountImg())) |
||||
&& (this.getDiscountCarouselImg() == null ? other.getDiscountCarouselImg() == null : this.getDiscountCarouselImg().equals(other.getDiscountCarouselImg())) |
||||
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType())) |
||||
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition())) |
||||
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice())) |
||||
&& (this.getEffectiveDay() == null ? other.getEffectiveDay() == null : this.getEffectiveDay().equals(other.getEffectiveDay())) |
||||
&& (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId())) |
||||
&& (this.getOperatorName() == null ? other.getOperatorName() == null : this.getOperatorName().equals(other.getOperatorName())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); |
||||
result = prime * result + ((getDiscountKey() == null) ? 0 : getDiscountKey().hashCode()); |
||||
result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode()); |
||||
result = prime * result + ((getDiscountImg() == null) ? 0 : getDiscountImg().hashCode()); |
||||
result = prime * result + ((getDiscountCarouselImg() == null) ? 0 : getDiscountCarouselImg().hashCode()); |
||||
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode()); |
||||
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode()); |
||||
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode()); |
||||
result = prime * result + ((getEffectiveDay() == null) ? 0 : getEffectiveDay().hashCode()); |
||||
result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode()); |
||||
result = prime * result + ((getOperatorName() == null) ? 0 : getOperatorName().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", companyId=").append(companyId); |
||||
sb.append(", discountKey=").append(discountKey); |
||||
sb.append(", discountName=").append(discountName); |
||||
sb.append(", discountImg=").append(discountImg); |
||||
sb.append(", discountCarouselImg=").append(discountCarouselImg); |
||||
sb.append(", discountType=").append(discountType); |
||||
sb.append(", discountCondition=").append(discountCondition); |
||||
sb.append(", discountPrice=").append(discountPrice); |
||||
sb.append(", effectiveDay=").append(effectiveDay); |
||||
sb.append(", salesEndTime=").append(salesEndTime); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", operatorId=").append(operatorId); |
||||
sb.append(", operatorName=").append(operatorName); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,202 @@ |
||||
package com.hai.entity; |
||||
|
||||
import com.hai.model.HighDiscountAgentRelModel; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_discount_agent_rel |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighDiscountAgentRel extends HighDiscountAgentRelModel implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 单位id |
||||
*/ |
||||
private Long discountId; |
||||
|
||||
/** |
||||
* 代理商id |
||||
*/ |
||||
private Long agentId; |
||||
|
||||
/** |
||||
* 库存数量 |
||||
*/ |
||||
private Integer stockCount; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 状态 0:删除 1:正常 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 二维码 |
||||
*/ |
||||
private String qrCode; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getDiscountId() { |
||||
return discountId; |
||||
} |
||||
|
||||
public void setDiscountId(Long discountId) { |
||||
this.discountId = discountId; |
||||
} |
||||
|
||||
public Long getAgentId() { |
||||
return agentId; |
||||
} |
||||
|
||||
public void setAgentId(Long agentId) { |
||||
this.agentId = agentId; |
||||
} |
||||
|
||||
public Integer getStockCount() { |
||||
return stockCount; |
||||
} |
||||
|
||||
public void setStockCount(Integer stockCount) { |
||||
this.stockCount = stockCount; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getQrCode() { |
||||
return qrCode; |
||||
} |
||||
|
||||
public void setQrCode(String qrCode) { |
||||
this.qrCode = qrCode; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
HighDiscountAgentRel other = (HighDiscountAgentRel) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId())) |
||||
&& (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId())) |
||||
&& (this.getStockCount() == null ? other.getStockCount() == null : this.getStockCount().equals(other.getStockCount())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getQrCode() == null ? other.getQrCode() == null : this.getQrCode().equals(other.getQrCode())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode()); |
||||
result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); |
||||
result = prime * result + ((getStockCount() == null) ? 0 : getStockCount().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getQrCode() == null) ? 0 : getQrCode().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", discountId=").append(discountId); |
||||
sb.append(", agentId=").append(agentId); |
||||
sb.append(", stockCount=").append(stockCount); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", qrCode=").append(qrCode); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,863 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class HighDiscountAgentRelExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public HighDiscountAgentRelExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
public void setLimit(Integer limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public Integer getLimit() { |
||||
return limit; |
||||
} |
||||
|
||||
public void setOffset(Long offset) { |
||||
this.offset = offset; |
||||
} |
||||
|
||||
public Long getOffset() { |
||||
return offset; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andIdIsNull() { |
||||
addCriterion("id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIsNotNull() { |
||||
addCriterion("id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdEqualTo(Long value) { |
||||
addCriterion("id =", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotEqualTo(Long value) { |
||||
addCriterion("id <>", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThan(Long value) { |
||||
addCriterion("id >", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("id >=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThan(Long value) { |
||||
addCriterion("id <", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("id <=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIn(List<Long> values) { |
||||
addCriterion("id in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotIn(List<Long> values) { |
||||
addCriterion("id not in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) { |
||||
addCriterion("id between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("id not between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdIsNull() { |
||||
addCriterion("discount_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdIsNotNull() { |
||||
addCriterion("discount_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdEqualTo(Long value) { |
||||
addCriterion("discount_id =", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdNotEqualTo(Long value) { |
||||
addCriterion("discount_id <>", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdGreaterThan(Long value) { |
||||
addCriterion("discount_id >", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("discount_id >=", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdLessThan(Long value) { |
||||
addCriterion("discount_id <", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("discount_id <=", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdIn(List<Long> values) { |
||||
addCriterion("discount_id in", values, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdNotIn(List<Long> values) { |
||||
addCriterion("discount_id not in", values, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdBetween(Long value1, Long value2) { |
||||
addCriterion("discount_id between", value1, value2, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("discount_id not between", value1, value2, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdIsNull() { |
||||
addCriterion("agent_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdIsNotNull() { |
||||
addCriterion("agent_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdEqualTo(Long value) { |
||||
addCriterion("agent_id =", value, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdNotEqualTo(Long value) { |
||||
addCriterion("agent_id <>", value, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdGreaterThan(Long value) { |
||||
addCriterion("agent_id >", value, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("agent_id >=", value, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdLessThan(Long value) { |
||||
addCriterion("agent_id <", value, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("agent_id <=", value, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdIn(List<Long> values) { |
||||
addCriterion("agent_id in", values, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdNotIn(List<Long> values) { |
||||
addCriterion("agent_id not in", values, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdBetween(Long value1, Long value2) { |
||||
addCriterion("agent_id between", value1, value2, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgentIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("agent_id not between", value1, value2, "agentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountIsNull() { |
||||
addCriterion("stock_count is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountIsNotNull() { |
||||
addCriterion("stock_count is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountEqualTo(Integer value) { |
||||
addCriterion("stock_count =", value, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountNotEqualTo(Integer value) { |
||||
addCriterion("stock_count <>", value, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountGreaterThan(Integer value) { |
||||
addCriterion("stock_count >", value, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("stock_count >=", value, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountLessThan(Integer value) { |
||||
addCriterion("stock_count <", value, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountLessThanOrEqualTo(Integer value) { |
||||
addCriterion("stock_count <=", value, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountIn(List<Integer> values) { |
||||
addCriterion("stock_count in", values, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountNotIn(List<Integer> values) { |
||||
addCriterion("stock_count not in", values, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountBetween(Integer value1, Integer value2) { |
||||
addCriterion("stock_count between", value1, value2, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStockCountNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("stock_count not between", value1, value2, "stockCount"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNull() { |
||||
addCriterion("create_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNotNull() { |
||||
addCriterion("create_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) { |
||||
addCriterion("create_time =", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) { |
||||
addCriterion("create_time <>", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) { |
||||
addCriterion("create_time >", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("create_time >=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) { |
||||
addCriterion("create_time <", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("create_time <=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) { |
||||
addCriterion("create_time in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) { |
||||
addCriterion("create_time not in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("create_time between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("create_time not between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNull() { |
||||
addCriterion("`status` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNotNull() { |
||||
addCriterion("`status` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusEqualTo(Integer value) { |
||||
addCriterion("`status` =", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) { |
||||
addCriterion("`status` <>", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) { |
||||
addCriterion("`status` >", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` >=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThan(Integer value) { |
||||
addCriterion("`status` <", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` <=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIn(List<Integer> values) { |
||||
addCriterion("`status` in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) { |
||||
addCriterion("`status` not in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` not between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeIsNull() { |
||||
addCriterion("qr_code is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeIsNotNull() { |
||||
addCriterion("qr_code is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeEqualTo(String value) { |
||||
addCriterion("qr_code =", value, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeNotEqualTo(String value) { |
||||
addCriterion("qr_code <>", value, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeGreaterThan(String value) { |
||||
addCriterion("qr_code >", value, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeGreaterThanOrEqualTo(String value) { |
||||
addCriterion("qr_code >=", value, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeLessThan(String value) { |
||||
addCriterion("qr_code <", value, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeLessThanOrEqualTo(String value) { |
||||
addCriterion("qr_code <=", value, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeLike(String value) { |
||||
addCriterion("qr_code like", value, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeNotLike(String value) { |
||||
addCriterion("qr_code not like", value, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeIn(List<String> values) { |
||||
addCriterion("qr_code in", values, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeNotIn(List<String> values) { |
||||
addCriterion("qr_code not in", values, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeBetween(String value1, String value2) { |
||||
addCriterion("qr_code between", value1, value2, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andQrCodeNotBetween(String value1, String value2) { |
||||
addCriterion("qr_code not between", value1, value2, "qrCode"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNull() { |
||||
addCriterion("ext_1 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNotNull() { |
||||
addCriterion("ext_1 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1EqualTo(String value) { |
||||
addCriterion("ext_1 =", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotEqualTo(String value) { |
||||
addCriterion("ext_1 <>", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThan(String value) { |
||||
addCriterion("ext_1 >", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 >=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThan(String value) { |
||||
addCriterion("ext_1 <", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 <=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Like(String value) { |
||||
addCriterion("ext_1 like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotLike(String value) { |
||||
addCriterion("ext_1 not like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1In(List<String> values) { |
||||
addCriterion("ext_1 in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotIn(List<String> values) { |
||||
addCriterion("ext_1 not in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Between(String value1, String value2) { |
||||
addCriterion("ext_1 between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotBetween(String value1, String value2) { |
||||
addCriterion("ext_1 not between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNull() { |
||||
addCriterion("ext_2 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNotNull() { |
||||
addCriterion("ext_2 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2EqualTo(String value) { |
||||
addCriterion("ext_2 =", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotEqualTo(String value) { |
||||
addCriterion("ext_2 <>", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThan(String value) { |
||||
addCriterion("ext_2 >", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 >=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThan(String value) { |
||||
addCriterion("ext_2 <", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 <=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Like(String value) { |
||||
addCriterion("ext_2 like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotLike(String value) { |
||||
addCriterion("ext_2 not like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2In(List<String> values) { |
||||
addCriterion("ext_2 in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotIn(List<String> values) { |
||||
addCriterion("ext_2 not in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Between(String value1, String value2) { |
||||
addCriterion("ext_2 between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotBetween(String value1, String value2) { |
||||
addCriterion("ext_2 not between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNull() { |
||||
addCriterion("ext_3 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNotNull() { |
||||
addCriterion("ext_3 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3EqualTo(String value) { |
||||
addCriterion("ext_3 =", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotEqualTo(String value) { |
||||
addCriterion("ext_3 <>", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThan(String value) { |
||||
addCriterion("ext_3 >", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 >=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThan(String value) { |
||||
addCriterion("ext_3 <", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 <=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Like(String value) { |
||||
addCriterion("ext_3 like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotLike(String value) { |
||||
addCriterion("ext_3 not like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3In(List<String> values) { |
||||
addCriterion("ext_3 in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotIn(List<String> values) { |
||||
addCriterion("ext_3 not in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Between(String value1, String value2) { |
||||
addCriterion("ext_3 between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotBetween(String value1, String value2) { |
||||
addCriterion("ext_3 not between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,170 @@ |
||||
package com.hai.entity; |
||||
|
||||
import com.hai.model.HighDiscountCouponRelModel; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_discount_coupon_rel |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighDiscountCouponRel extends HighDiscountCouponRelModel implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 单位id |
||||
*/ |
||||
private Long discountId; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 卡券id |
||||
*/ |
||||
private Long couponId; |
||||
|
||||
/** |
||||
* 状态 0:删除 1:正常 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getDiscountId() { |
||||
return discountId; |
||||
} |
||||
|
||||
public void setDiscountId(Long discountId) { |
||||
this.discountId = discountId; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Long getCouponId() { |
||||
return couponId; |
||||
} |
||||
|
||||
public void setCouponId(Long couponId) { |
||||
this.couponId = couponId; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
HighDiscountCouponRel other = (HighDiscountCouponRel) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", discountId=").append(discountId); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", couponId=").append(couponId); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,733 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class HighDiscountCouponRelExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public HighDiscountCouponRelExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
public void setLimit(Integer limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public Integer getLimit() { |
||||
return limit; |
||||
} |
||||
|
||||
public void setOffset(Long offset) { |
||||
this.offset = offset; |
||||
} |
||||
|
||||
public Long getOffset() { |
||||
return offset; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andIdIsNull() { |
||||
addCriterion("id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIsNotNull() { |
||||
addCriterion("id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdEqualTo(Long value) { |
||||
addCriterion("id =", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotEqualTo(Long value) { |
||||
addCriterion("id <>", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThan(Long value) { |
||||
addCriterion("id >", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("id >=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThan(Long value) { |
||||
addCriterion("id <", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("id <=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIn(List<Long> values) { |
||||
addCriterion("id in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotIn(List<Long> values) { |
||||
addCriterion("id not in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) { |
||||
addCriterion("id between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("id not between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdIsNull() { |
||||
addCriterion("discount_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdIsNotNull() { |
||||
addCriterion("discount_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdEqualTo(Long value) { |
||||
addCriterion("discount_id =", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdNotEqualTo(Long value) { |
||||
addCriterion("discount_id <>", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdGreaterThan(Long value) { |
||||
addCriterion("discount_id >", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("discount_id >=", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdLessThan(Long value) { |
||||
addCriterion("discount_id <", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("discount_id <=", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdIn(List<Long> values) { |
||||
addCriterion("discount_id in", values, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdNotIn(List<Long> values) { |
||||
addCriterion("discount_id not in", values, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdBetween(Long value1, Long value2) { |
||||
addCriterion("discount_id between", value1, value2, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("discount_id not between", value1, value2, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNull() { |
||||
addCriterion("create_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNotNull() { |
||||
addCriterion("create_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) { |
||||
addCriterion("create_time =", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) { |
||||
addCriterion("create_time <>", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) { |
||||
addCriterion("create_time >", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("create_time >=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) { |
||||
addCriterion("create_time <", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("create_time <=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) { |
||||
addCriterion("create_time in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) { |
||||
addCriterion("create_time not in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("create_time between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("create_time not between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdIsNull() { |
||||
addCriterion("coupon_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdIsNotNull() { |
||||
addCriterion("coupon_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdEqualTo(Long value) { |
||||
addCriterion("coupon_id =", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdNotEqualTo(Long value) { |
||||
addCriterion("coupon_id <>", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdGreaterThan(Long value) { |
||||
addCriterion("coupon_id >", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("coupon_id >=", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdLessThan(Long value) { |
||||
addCriterion("coupon_id <", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("coupon_id <=", value, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdIn(List<Long> values) { |
||||
addCriterion("coupon_id in", values, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdNotIn(List<Long> values) { |
||||
addCriterion("coupon_id not in", values, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdBetween(Long value1, Long value2) { |
||||
addCriterion("coupon_id between", value1, value2, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCouponIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("coupon_id not between", value1, value2, "couponId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNull() { |
||||
addCriterion("`status` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNotNull() { |
||||
addCriterion("`status` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusEqualTo(Integer value) { |
||||
addCriterion("`status` =", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) { |
||||
addCriterion("`status` <>", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) { |
||||
addCriterion("`status` >", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` >=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThan(Integer value) { |
||||
addCriterion("`status` <", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` <=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIn(List<Integer> values) { |
||||
addCriterion("`status` in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) { |
||||
addCriterion("`status` not in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` not between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNull() { |
||||
addCriterion("ext_1 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNotNull() { |
||||
addCriterion("ext_1 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1EqualTo(String value) { |
||||
addCriterion("ext_1 =", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotEqualTo(String value) { |
||||
addCriterion("ext_1 <>", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThan(String value) { |
||||
addCriterion("ext_1 >", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 >=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThan(String value) { |
||||
addCriterion("ext_1 <", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 <=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Like(String value) { |
||||
addCriterion("ext_1 like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotLike(String value) { |
||||
addCriterion("ext_1 not like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1In(List<String> values) { |
||||
addCriterion("ext_1 in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotIn(List<String> values) { |
||||
addCriterion("ext_1 not in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Between(String value1, String value2) { |
||||
addCriterion("ext_1 between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotBetween(String value1, String value2) { |
||||
addCriterion("ext_1 not between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNull() { |
||||
addCriterion("ext_2 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNotNull() { |
||||
addCriterion("ext_2 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2EqualTo(String value) { |
||||
addCriterion("ext_2 =", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotEqualTo(String value) { |
||||
addCriterion("ext_2 <>", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThan(String value) { |
||||
addCriterion("ext_2 >", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 >=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThan(String value) { |
||||
addCriterion("ext_2 <", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 <=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Like(String value) { |
||||
addCriterion("ext_2 like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotLike(String value) { |
||||
addCriterion("ext_2 not like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2In(List<String> values) { |
||||
addCriterion("ext_2 in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotIn(List<String> values) { |
||||
addCriterion("ext_2 not in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Between(String value1, String value2) { |
||||
addCriterion("ext_2 between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotBetween(String value1, String value2) { |
||||
addCriterion("ext_2 not between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNull() { |
||||
addCriterion("ext_3 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNotNull() { |
||||
addCriterion("ext_3 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3EqualTo(String value) { |
||||
addCriterion("ext_3 =", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotEqualTo(String value) { |
||||
addCriterion("ext_3 <>", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThan(String value) { |
||||
addCriterion("ext_3 >", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 >=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThan(String value) { |
||||
addCriterion("ext_3 <", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 <=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Like(String value) { |
||||
addCriterion("ext_3 like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotLike(String value) { |
||||
addCriterion("ext_3 not like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3In(List<String> values) { |
||||
addCriterion("ext_3 in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotIn(List<String> values) { |
||||
addCriterion("ext_3 not in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Between(String value1, String value2) { |
||||
addCriterion("ext_3 between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotBetween(String value1, String value2) { |
||||
addCriterion("ext_3 not between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,200 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_discount_user_rel |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighDiscountUserRel implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 优惠券id |
||||
*/ |
||||
private Long discountId; |
||||
|
||||
/** |
||||
* 代理商id |
||||
*/ |
||||
private Long ageentId; |
||||
|
||||
/** |
||||
* 用户id |
||||
*/ |
||||
private Long userId; |
||||
|
||||
/** |
||||
* 状态 0:已过期 1:未使用 2:已使用 100:删除 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 使用截止时间 |
||||
*/ |
||||
private Date useEndTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getDiscountId() { |
||||
return discountId; |
||||
} |
||||
|
||||
public void setDiscountId(Long discountId) { |
||||
this.discountId = discountId; |
||||
} |
||||
|
||||
public Long getAgeentId() { |
||||
return ageentId; |
||||
} |
||||
|
||||
public void setAgeentId(Long ageentId) { |
||||
this.ageentId = ageentId; |
||||
} |
||||
|
||||
public Long getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(Long userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUseEndTime() { |
||||
return useEndTime; |
||||
} |
||||
|
||||
public void setUseEndTime(Date useEndTime) { |
||||
this.useEndTime = useEndTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
HighDiscountUserRel other = (HighDiscountUserRel) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId())) |
||||
&& (this.getAgeentId() == null ? other.getAgeentId() == null : this.getAgeentId().equals(other.getAgeentId())) |
||||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUseEndTime() == null ? other.getUseEndTime() == null : this.getUseEndTime().equals(other.getUseEndTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode()); |
||||
result = prime * result + ((getAgeentId() == null) ? 0 : getAgeentId().hashCode()); |
||||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUseEndTime() == null) ? 0 : getUseEndTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", discountId=").append(discountId); |
||||
sb.append(", ageentId=").append(ageentId); |
||||
sb.append(", userId=").append(userId); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", useEndTime=").append(useEndTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,853 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class HighDiscountUserRelExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public HighDiscountUserRelExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
public void setLimit(Integer limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public Integer getLimit() { |
||||
return limit; |
||||
} |
||||
|
||||
public void setOffset(Long offset) { |
||||
this.offset = offset; |
||||
} |
||||
|
||||
public Long getOffset() { |
||||
return offset; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andIdIsNull() { |
||||
addCriterion("id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIsNotNull() { |
||||
addCriterion("id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdEqualTo(Long value) { |
||||
addCriterion("id =", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotEqualTo(Long value) { |
||||
addCriterion("id <>", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThan(Long value) { |
||||
addCriterion("id >", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("id >=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThan(Long value) { |
||||
addCriterion("id <", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("id <=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIn(List<Long> values) { |
||||
addCriterion("id in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotIn(List<Long> values) { |
||||
addCriterion("id not in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) { |
||||
addCriterion("id between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("id not between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdIsNull() { |
||||
addCriterion("discount_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdIsNotNull() { |
||||
addCriterion("discount_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdEqualTo(Long value) { |
||||
addCriterion("discount_id =", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdNotEqualTo(Long value) { |
||||
addCriterion("discount_id <>", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdGreaterThan(Long value) { |
||||
addCriterion("discount_id >", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("discount_id >=", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdLessThan(Long value) { |
||||
addCriterion("discount_id <", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("discount_id <=", value, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdIn(List<Long> values) { |
||||
addCriterion("discount_id in", values, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdNotIn(List<Long> values) { |
||||
addCriterion("discount_id not in", values, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdBetween(Long value1, Long value2) { |
||||
addCriterion("discount_id between", value1, value2, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andDiscountIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("discount_id not between", value1, value2, "discountId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdIsNull() { |
||||
addCriterion("ageent_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdIsNotNull() { |
||||
addCriterion("ageent_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdEqualTo(Long value) { |
||||
addCriterion("ageent_id =", value, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdNotEqualTo(Long value) { |
||||
addCriterion("ageent_id <>", value, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdGreaterThan(Long value) { |
||||
addCriterion("ageent_id >", value, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("ageent_id >=", value, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdLessThan(Long value) { |
||||
addCriterion("ageent_id <", value, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("ageent_id <=", value, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdIn(List<Long> values) { |
||||
addCriterion("ageent_id in", values, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdNotIn(List<Long> values) { |
||||
addCriterion("ageent_id not in", values, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdBetween(Long value1, Long value2) { |
||||
addCriterion("ageent_id between", value1, value2, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andAgeentIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("ageent_id not between", value1, value2, "ageentId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdIsNull() { |
||||
addCriterion("user_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdIsNotNull() { |
||||
addCriterion("user_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdEqualTo(Long value) { |
||||
addCriterion("user_id =", value, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdNotEqualTo(Long value) { |
||||
addCriterion("user_id <>", value, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdGreaterThan(Long value) { |
||||
addCriterion("user_id >", value, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("user_id >=", value, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdLessThan(Long value) { |
||||
addCriterion("user_id <", value, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("user_id <=", value, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdIn(List<Long> values) { |
||||
addCriterion("user_id in", values, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdNotIn(List<Long> values) { |
||||
addCriterion("user_id not in", values, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdBetween(Long value1, Long value2) { |
||||
addCriterion("user_id between", value1, value2, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUserIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("user_id not between", value1, value2, "userId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNull() { |
||||
addCriterion("`status` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNotNull() { |
||||
addCriterion("`status` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusEqualTo(Integer value) { |
||||
addCriterion("`status` =", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) { |
||||
addCriterion("`status` <>", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) { |
||||
addCriterion("`status` >", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` >=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThan(Integer value) { |
||||
addCriterion("`status` <", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` <=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIn(List<Integer> values) { |
||||
addCriterion("`status` in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) { |
||||
addCriterion("`status` not in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` not between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNull() { |
||||
addCriterion("create_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNotNull() { |
||||
addCriterion("create_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) { |
||||
addCriterion("create_time =", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) { |
||||
addCriterion("create_time <>", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) { |
||||
addCriterion("create_time >", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("create_time >=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) { |
||||
addCriterion("create_time <", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("create_time <=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) { |
||||
addCriterion("create_time in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) { |
||||
addCriterion("create_time not in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("create_time between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("create_time not between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeIsNull() { |
||||
addCriterion("use_end_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeIsNotNull() { |
||||
addCriterion("use_end_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeEqualTo(Date value) { |
||||
addCriterion("use_end_time =", value, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeNotEqualTo(Date value) { |
||||
addCriterion("use_end_time <>", value, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeGreaterThan(Date value) { |
||||
addCriterion("use_end_time >", value, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("use_end_time >=", value, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeLessThan(Date value) { |
||||
addCriterion("use_end_time <", value, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("use_end_time <=", value, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeIn(List<Date> values) { |
||||
addCriterion("use_end_time in", values, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeNotIn(List<Date> values) { |
||||
addCriterion("use_end_time not in", values, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeBetween(Date value1, Date value2) { |
||||
addCriterion("use_end_time between", value1, value2, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUseEndTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("use_end_time not between", value1, value2, "useEndTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNull() { |
||||
addCriterion("ext_1 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNotNull() { |
||||
addCriterion("ext_1 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1EqualTo(String value) { |
||||
addCriterion("ext_1 =", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotEqualTo(String value) { |
||||
addCriterion("ext_1 <>", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThan(String value) { |
||||
addCriterion("ext_1 >", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 >=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThan(String value) { |
||||
addCriterion("ext_1 <", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 <=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Like(String value) { |
||||
addCriterion("ext_1 like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotLike(String value) { |
||||
addCriterion("ext_1 not like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1In(List<String> values) { |
||||
addCriterion("ext_1 in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotIn(List<String> values) { |
||||
addCriterion("ext_1 not in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Between(String value1, String value2) { |
||||
addCriterion("ext_1 between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotBetween(String value1, String value2) { |
||||
addCriterion("ext_1 not between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNull() { |
||||
addCriterion("ext_2 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNotNull() { |
||||
addCriterion("ext_2 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2EqualTo(String value) { |
||||
addCriterion("ext_2 =", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotEqualTo(String value) { |
||||
addCriterion("ext_2 <>", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThan(String value) { |
||||
addCriterion("ext_2 >", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 >=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThan(String value) { |
||||
addCriterion("ext_2 <", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 <=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Like(String value) { |
||||
addCriterion("ext_2 like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotLike(String value) { |
||||
addCriterion("ext_2 not like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2In(List<String> values) { |
||||
addCriterion("ext_2 in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotIn(List<String> values) { |
||||
addCriterion("ext_2 not in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Between(String value1, String value2) { |
||||
addCriterion("ext_2 between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotBetween(String value1, String value2) { |
||||
addCriterion("ext_2 not between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNull() { |
||||
addCriterion("ext_3 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNotNull() { |
||||
addCriterion("ext_3 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3EqualTo(String value) { |
||||
addCriterion("ext_3 =", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotEqualTo(String value) { |
||||
addCriterion("ext_3 <>", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThan(String value) { |
||||
addCriterion("ext_3 >", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 >=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThan(String value) { |
||||
addCriterion("ext_3 <", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 <=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Like(String value) { |
||||
addCriterion("ext_3 like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotLike(String value) { |
||||
addCriterion("ext_3 not like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3In(List<String> values) { |
||||
addCriterion("ext_3 in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotIn(List<String> values) { |
||||
addCriterion("ext_3 not in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Between(String value1, String value2) { |
||||
addCriterion("ext_3 between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotBetween(String value1, String value2) { |
||||
addCriterion("ext_3 not between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,36 @@ |
||||
package com.hai.enum_type; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: 二维码类型 |
||||
* @Date: 2021/4/4 11:02 |
||||
*/ |
||||
public enum QrCodeType { |
||||
AGENT_QR_CODE(1, "代理商二维码"), |
||||
; |
||||
|
||||
private Integer type; |
||||
|
||||
private String name; |
||||
|
||||
QrCodeType(Integer type,String name) { |
||||
this.type = type; |
||||
this.name = name; |
||||
} |
||||
|
||||
public Integer getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(Integer type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,34 @@ |
||||
package com.hai.model; |
||||
|
||||
import com.hai.entity.HighAgent; |
||||
import com.hai.entity.HighDiscount; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/4 11:28 |
||||
*/ |
||||
public class HighDiscountAgentRelModel { |
||||
|
||||
// 优惠券信息
|
||||
private HighDiscount highDiscount; |
||||
|
||||
// 代理商信息
|
||||
private HighAgent highAgent; |
||||
|
||||
public HighDiscount getHighDiscount() { |
||||
return highDiscount; |
||||
} |
||||
|
||||
public void setHighDiscount(HighDiscount highDiscount) { |
||||
this.highDiscount = highDiscount; |
||||
} |
||||
|
||||
public HighAgent getHighAgent() { |
||||
return highAgent; |
||||
} |
||||
|
||||
public void setHighAgent(HighAgent highAgent) { |
||||
this.highAgent = highAgent; |
||||
} |
||||
} |
@ -0,0 +1,21 @@ |
||||
package com.hai.model; |
||||
|
||||
import com.hai.entity.HighCoupon; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/3 23:22 |
||||
*/ |
||||
public class HighDiscountCouponRelModel { |
||||
|
||||
private HighCoupon highCoupon; |
||||
|
||||
public HighCoupon getHighCoupon() { |
||||
return highCoupon; |
||||
} |
||||
|
||||
public void setHighCoupon(HighCoupon highCoupon) { |
||||
this.highCoupon = highCoupon; |
||||
} |
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.hai.model; |
||||
|
||||
import com.hai.entity.HighDiscount; |
||||
import com.hai.entity.HighDiscountCouponRel; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/3 23:30 |
||||
*/ |
||||
public class HighDiscountModel { |
||||
|
||||
List<HighDiscountCouponRel> couponRelList; |
||||
|
||||
public List<HighDiscountCouponRel> getCouponRelList() { |
||||
return couponRelList; |
||||
} |
||||
|
||||
public void setCouponRelList(List<HighDiscountCouponRel> couponRelList) { |
||||
this.couponRelList = couponRelList; |
||||
} |
||||
} |
@ -0,0 +1,56 @@ |
||||
package com.hai.service; |
||||
|
||||
import com.hai.entity.HighDiscountAgentRel; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/4 00:15 |
||||
*/ |
||||
public interface HighDiscountAgentRelService { |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 增加 |
||||
* @Date 2021/4/4 0:32 |
||||
**/ |
||||
void insertDiscountAgentRel(HighDiscountAgentRel highDiscountAgentRel); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 修改 |
||||
* @Date 2021/4/4 0:32 |
||||
**/ |
||||
void updateDiscountAgentRel(HighDiscountAgentRel highDiscountAgentRel); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 删除 |
||||
* @Date 2021/4/4 0:32 |
||||
**/ |
||||
void deleteDiscountAgentRel(Long id); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 根据代理商id和卡券id查询 |
||||
* @Date 2021/4/4 0:32 |
||||
**/ |
||||
HighDiscountAgentRel getRelByDiscountAgent(Long discountId,Long agentId); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 根据id查询 |
||||
* @Date 2021/4/4 0:32 |
||||
**/ |
||||
HighDiscountAgentRel getRelById(Long id); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 查询列表 |
||||
* @Date 2021/4/4 0:32 |
||||
**/ |
||||
List<HighDiscountAgentRel> getRelList(Map<String,Object> map); |
||||
} |
@ -0,0 +1,57 @@ |
||||
package com.hai.service; |
||||
|
||||
import com.hai.entity.HighDiscount; |
||||
import com.hai.entity.HighDiscountCouponRel; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/3 22:52 |
||||
*/ |
||||
public interface HighDiscountCouponRelService { |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 增加 |
||||
* @Date 2021/4/3 23:12 |
||||
**/ |
||||
void insertDiscountCoupon(HighDiscountCouponRel highDiscountCouponRel); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 修改 |
||||
* @Date 2021/4/4 11:24 |
||||
**/ |
||||
void updateDiscountCoupon(HighDiscountCouponRel highDiscountCouponRel); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 删除 |
||||
* @Date 2021/4/4 0:05 |
||||
**/ |
||||
void deleteDiscountCoupon(Long id); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 根据id查询 |
||||
* @Date 2021/4/4 11:24 |
||||
**/ |
||||
HighDiscountCouponRel getRelById(Long id); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 根据优惠券和卡卷查询 |
||||
* @Date 2021/4/4 0:06 |
||||
**/ |
||||
HighDiscountCouponRel getRelByDiscountCoupon(Long discountId,Long couponId); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 根据优惠券查询 |
||||
* @Date 2021/4/3 23:12 |
||||
**/ |
||||
List<HighDiscountCouponRel> getRelByDiscount(Long discountId); |
||||
|
||||
} |
@ -0,0 +1,43 @@ |
||||
package com.hai.service; |
||||
|
||||
import com.hai.entity.HighDiscount; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: 优惠券 |
||||
* @Date: 2021/4/3 21:34 |
||||
*/ |
||||
public interface HighDiscountService { |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 增加 |
||||
* @Date 2021/4/3 21:34 |
||||
*/ |
||||
void insertDiscount(HighDiscount highDiscount); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 修改 |
||||
* @Date 2021/4/3 21:36 |
||||
**/ |
||||
void updateDiscount(HighDiscount highDiscount); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 根据id查询 |
||||
* @Date 2021/4/3 21:37 |
||||
**/ |
||||
HighDiscount getDiscountById(Long id); |
||||
|
||||
/** |
||||
* @Author 胡锐 |
||||
* @Description 查询优惠券列表 |
||||
* @Date 2021/4/3 21:39 |
||||
**/ |
||||
List<HighDiscount> getDiscount(Map<String,Object> map); |
||||
|
||||
} |
@ -0,0 +1,93 @@ |
||||
package com.hai.service.impl; |
||||
|
||||
import com.hai.dao.HighDiscountAgentRelMapper; |
||||
import com.hai.entity.HighAgent; |
||||
import com.hai.entity.HighDiscount; |
||||
import com.hai.entity.HighDiscountAgentRel; |
||||
import com.hai.entity.HighDiscountAgentRelExample; |
||||
import com.hai.service.HighAgentService; |
||||
import com.hai.service.HighDiscountAgentRelService; |
||||
import com.hai.service.HighDiscountService; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/4 00:15 |
||||
*/ |
||||
@Service("highDiscountAgentRelService") |
||||
public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelService { |
||||
|
||||
@Resource |
||||
private HighDiscountAgentRelMapper highDiscountAgentRelMapper; |
||||
|
||||
@Resource |
||||
private HighAgentService highAgentService; |
||||
|
||||
@Resource |
||||
private HighDiscountService highDiscountService; |
||||
|
||||
@Override |
||||
public void insertDiscountAgentRel(HighDiscountAgentRel highDiscountAgentRel) { |
||||
highDiscountAgentRelMapper.insert(highDiscountAgentRel); |
||||
} |
||||
|
||||
@Override |
||||
public void updateDiscountAgentRel(HighDiscountAgentRel highDiscountAgentRel) { |
||||
highDiscountAgentRelMapper.updateByPrimaryKey(highDiscountAgentRel); |
||||
} |
||||
|
||||
@Override |
||||
public void deleteDiscountAgentRel(Long id) { |
||||
highDiscountAgentRelMapper.deleteByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public HighDiscountAgentRel getRelByDiscountAgent(Long discountId, Long agentId) { |
||||
HighDiscountAgentRelExample example = new HighDiscountAgentRelExample(); |
||||
example.createCriteria().andDiscountIdEqualTo(discountId).andAgentIdEqualTo(agentId); |
||||
List<HighDiscountAgentRel> list = highDiscountAgentRelMapper.selectByExample(example); |
||||
if (list != null && list.size() >0) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public HighDiscountAgentRel getRelById(Long id) { |
||||
HighDiscountAgentRel rel = highDiscountAgentRelMapper.selectByPrimaryKey(id); |
||||
if (rel != null) { |
||||
rel.setHighDiscount(highDiscountService.getDiscountById(rel.getDiscountId())); |
||||
rel.setHighAgent(highAgentService.findByAgentMsgId(rel.getAgentId())); |
||||
} |
||||
return rel; |
||||
} |
||||
|
||||
@Override |
||||
public List<HighDiscountAgentRel> getRelList(Map<String, Object> map) { |
||||
HighDiscountAgentRelExample example = new HighDiscountAgentRelExample(); |
||||
HighDiscountAgentRelExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
if (MapUtils.getLong(map, "discountId") != null) { |
||||
criteria.andDiscountIdEqualTo(MapUtils.getLong(map, "discountId")); |
||||
} |
||||
|
||||
if (MapUtils.getLong(map, "agentId") != null) { |
||||
criteria.andAgentIdEqualTo(MapUtils.getLong(map, "agentId")); |
||||
} |
||||
|
||||
criteria.andStatusEqualTo(1); |
||||
example.setOrderByClause("create_time desc"); |
||||
List<HighDiscountAgentRel> list = highDiscountAgentRelMapper.selectByExample(example); |
||||
for (HighDiscountAgentRel rel : list) { |
||||
rel.setHighDiscount(highDiscountService.getDiscountById(rel.getDiscountId())); |
||||
rel.setHighAgent(highAgentService.findByAgentMsgId(rel.getAgentId())); |
||||
} |
||||
return list; |
||||
} |
||||
} |
@ -0,0 +1,79 @@ |
||||
package com.hai.service.impl; |
||||
|
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.dao.HighDiscountCouponRelMapper; |
||||
import com.hai.entity.HighCoupon; |
||||
import com.hai.entity.HighDiscount; |
||||
import com.hai.entity.HighDiscountCouponRel; |
||||
import com.hai.entity.HighDiscountCouponRelExample; |
||||
import com.hai.service.HighCouponService; |
||||
import com.hai.service.HighDiscountCouponRelService; |
||||
import com.hai.service.HighDiscountService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/3 22:52 |
||||
*/ |
||||
@Service("highDiscountCouponRelService") |
||||
public class HighDiscountCouponRelServiceImpl implements HighDiscountCouponRelService { |
||||
|
||||
@Resource |
||||
private HighDiscountCouponRelMapper highDiscountCouponRelMapper; |
||||
|
||||
@Resource |
||||
private HighCouponService highCouponService; |
||||
|
||||
@Resource |
||||
private HighDiscountService highDiscountService; |
||||
|
||||
|
||||
@Override |
||||
public void insertDiscountCoupon(HighDiscountCouponRel highDiscountCouponRel) { |
||||
highDiscountCouponRelMapper.insert(highDiscountCouponRel); |
||||
} |
||||
|
||||
@Override |
||||
public void updateDiscountCoupon(HighDiscountCouponRel highDiscountCouponRel) { |
||||
highDiscountCouponRelMapper.updateByPrimaryKey(highDiscountCouponRel); |
||||
} |
||||
|
||||
@Override |
||||
public void deleteDiscountCoupon(Long id) { |
||||
highDiscountCouponRelMapper.deleteByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public HighDiscountCouponRel getRelById(Long id) { |
||||
return highDiscountCouponRelMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public HighDiscountCouponRel getRelByDiscountCoupon(Long discountId, Long couponId) { |
||||
HighDiscountCouponRelExample example = new HighDiscountCouponRelExample(); |
||||
example.createCriteria().andDiscountIdEqualTo(discountId).andCouponIdEqualTo(couponId); |
||||
|
||||
List<HighDiscountCouponRel> list = highDiscountCouponRelMapper.selectByExample(example); |
||||
if (list != null && list.size() > 0) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public List<HighDiscountCouponRel> getRelByDiscount(Long discountId) { |
||||
HighDiscountCouponRelExample example = new HighDiscountCouponRelExample(); |
||||
example.createCriteria().andDiscountIdEqualTo(discountId); |
||||
List<HighDiscountCouponRel> list = highDiscountCouponRelMapper.selectByExample(example); |
||||
for (HighDiscountCouponRel rel : list) { |
||||
rel.setHighCoupon(highCouponService.getCouponDetail(rel.getCouponId())); |
||||
} |
||||
return list; |
||||
} |
||||
} |
@ -0,0 +1,51 @@ |
||||
package com.hai.service.impl; |
||||
|
||||
import com.hai.dao.HighDiscountMapper; |
||||
import com.hai.entity.HighDiscount; |
||||
import com.hai.entity.HighDiscountCouponRel; |
||||
import com.hai.entity.HighDiscountExample; |
||||
import com.hai.service.HighDiscountService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/4/3 21:39 |
||||
*/ |
||||
@Service("highDiscountService") |
||||
public class HighDiscountServiceImpl implements HighDiscountService { |
||||
|
||||
@Resource |
||||
private HighDiscountMapper highDiscountMapper; |
||||
|
||||
@Resource |
||||
private HighDiscountCouponRel highDiscountCouponRel; |
||||
|
||||
@Override |
||||
public void insertDiscount(HighDiscount highDiscount) { |
||||
highDiscountMapper.insert(highDiscount); |
||||
} |
||||
|
||||
@Override |
||||
public void updateDiscount(HighDiscount highDiscount) { |
||||
highDiscountMapper.updateByPrimaryKey(highDiscount); |
||||
} |
||||
|
||||
@Override |
||||
public HighDiscount getDiscountById(Long id) { |
||||
return highDiscountMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public List<HighDiscount> getDiscount(Map<String, Object> map) { |
||||
HighDiscountExample example = new HighDiscountExample(); |
||||
HighDiscountExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
example.setOrderByClause("update_time desc"); |
||||
return highDiscountMapper.selectByExample(example); |
||||
} |
||||
} |
Loading…
Reference in new issue