diff --git a/bweb/src/main/java/com/bweb/controller/discount/DiscountController.java b/bweb/src/main/java/com/bweb/controller/discount/DiscountController.java new file mode 100644 index 0000000..5d3da3d --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/discount/DiscountController.java @@ -0,0 +1,227 @@ +package com.bweb.controller.discount; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.CouponDiscount; +import com.hfkj.entity.CouponDiscountGoodsRel; +import com.hfkj.entity.GoodsMsg; +import com.hfkj.entity.GoodsSpecs; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.model.discount.DiscountGoodsModel; +import com.hfkj.service.discount.CouponDiscountService; +import com.hfkj.service.goods.impl.GoodsMsgServiceImpl; +import com.hfkj.service.goods.impl.GoodsSpecsServiceImpl; +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.BeanUtils; +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.*; + +@Controller +@RequestMapping(value="/discount") +@Api(value="优惠券") +public class DiscountController { + + private static final Logger log = LoggerFactory.getLogger(DiscountController.class); + + @Resource + private CouponDiscountService couponDiscountService; + + @Resource + private UserCenter userCenter; + @Autowired + private GoodsMsgServiceImpl goodsMsgService; + @Autowired + private GoodsSpecsServiceImpl goodsSpecsService; + + @RequestMapping(value="/editDiscount",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑商品品牌") + public ResponseData editDiscount(@RequestBody CouponDiscount body, HttpServletRequest request) { + + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + + if (body == null + || body.getImg() == null + || body.getType() == null + || body.getEffectiveNum() == null + || body.getEffectiveDay() == null + || body.getSalesEndTime() == null + || StringUtils.isBlank(body.getName())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + if (body.getType() == 1 ){ + if ( body.getCondition() == null || body.getPrice() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } + if (body.getType() == 2 ){ + if (body.getPrice() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } + if (body.getType() == 3){ + if ( body.getPercentage() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } + + CouponDiscount couponDiscount; + + if (body.getId() != null) { + // 查询品牌 + couponDiscount = couponDiscountService.queryDetail(body.getId()); + if (couponDiscount == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + } + } else { + couponDiscount = new CouponDiscount(); + couponDiscount.setCreateTime(new Date()); + couponDiscount.setLimitNum(0); + } + + couponDiscount.setUpdateTime(new Date()); + couponDiscount.setStatus(1); + couponDiscount.setType(body.getType()); + couponDiscount.setEffectiveNum(body.getEffectiveNum()); + couponDiscount.setName(body.getName()); + couponDiscount.setPercentage(body.getPercentage()); + couponDiscount.setPrice(body.getPrice()); + couponDiscount.setCondition(body.getCondition()); + couponDiscount.setSalesEndTime(body.getSalesEndTime()); + couponDiscount.setEffectiveDay(body.getEffectiveDay()); + couponDiscount.setImg(body.getImg()); + couponDiscount.setOpId(userModel.getAccount().getId()); + couponDiscount.setOpName(userModel.getAccount().getUserName()); + + if (body.getId() != null) { + couponDiscountService.update(couponDiscount); + } else { + couponDiscountService.create(couponDiscount); + } + + return ResponseMsgUtil.success("操作成功"); + } + + + @RequestMapping(value="/getListDiscount",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData getListDiscount(@RequestParam(value = "name" , required = false) String name, + @RequestParam(value = "type" , required = false) Integer type, + @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + try { + + Map map = new HashMap<>(); + map.put("name", name); + map.put("type", type); + map.put("status", status); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(couponDiscountService.getList(map))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delete",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "删除") + public ResponseData delete(@RequestParam(value = "id" , required = false) Long id) { + try { + + couponDiscountService.delete(id , false); + + return ResponseMsgUtil.success("删除成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getListDiscountGoodsRel",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData getListDiscountGoodsRel(@RequestParam(value = "discountId" , required = false) Long discountId) { + try { + + Map map = new HashMap<>(); + map.put("discountId", discountId); + + List list = couponDiscountService.getListGoodsRel(map); + + List discountGoodsModelList = new ArrayList<>(); + + + for (CouponDiscountGoodsRel goodsRel : list) { + DiscountGoodsModel discountGoodsModel = new DiscountGoodsModel(); + GoodsSpecs goodsSpecs = goodsSpecsService.queryDetail(goodsRel.getSpecsId()); + GoodsMsg goodsMsg = goodsMsgService.queryDetail(goodsSpecs.getGoodsId()); + + BeanUtils.copyProperties(goodsRel, discountGoodsModel); + discountGoodsModel.setSalePrice(goodsSpecs.getSalePrice()); + discountGoodsModel.setGoodsName(goodsMsg.getTitle()); + discountGoodsModel.setSpecsName(goodsSpecs.getName()); + discountGoodsModelList.add(discountGoodsModel); + } + + return ResponseMsgUtil.success(discountGoodsModelList); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/bindDiscountSpecs",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "绑定优惠券规格") + public ResponseData bindDiscountSpecs(@RequestBody JSONObject body) { + + if (body == null + || body.getLong("discountId") == null + || StringUtils.isBlank(body.getString("specsIds"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + couponDiscountService.deleteDiscountGoodsRelDiscountId(body.getLong("discountId")); + + String[] specsIds = body.getString("specsIds").split(","); + + for (String specsId : specsIds) { + CouponDiscountGoodsRel goodsRel = new CouponDiscountGoodsRel(); + goodsRel.setDiscountId(body.getLong("discountId")); + goodsRel.setSpecsId(Long.valueOf(specsId)); + goodsRel.setCreateTime(new Date()); + goodsRel.setStatus(1); + + couponDiscountService.createGoodsRel(goodsRel); + } + + return ResponseMsgUtil.success("操作成功"); + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java index 790ef99..7a04624 100644 --- a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java @@ -58,52 +58,69 @@ public class GoodsController { @ApiOperation(value = "编辑商品信息") public ResponseData editGoodsMsg(@RequestBody GoodsMsg body, HttpServletRequest request) { - SessionObject sessionObject = userCenter.getSessionObject(request); - SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + try { - if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); - } - if (body == null - || body.getGoodsBrand() == null - || body.getGoodsType() == null - || body.getType() == null - || StringUtils.isBlank(body.getListImg()) - || StringUtils.isBlank(body.getBannerImg()) - || StringUtils.isBlank(body.getDetailImg()) - || StringUtils.isBlank(body.getTitle())) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); - } + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); - GoodsMsg goodsMsg; + if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); - if (body.getId() != null) { - // 查询品牌 - goodsMsg = goodsMsgService.queryDetail(body.getId()); - if (goodsMsg == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); } - } else { - goodsMsg = new GoodsMsg(); - goodsMsg.setCreateTime(new Date()); - } - goodsMsg.setUpdateTime(new Date()); - goodsMsg.setGoodsBrandName(goodsBrandService.findGoodsBrandName(body.getGoodsBrand())); - goodsMsg.setGoodsTypeName(goodsTypeService.findGoodsType(body.getGoodsType())); - goodsMsg.setStatus(2); - goodsMsg.setTitle(body.getTitle()); - goodsMsg.setMerId(userModel.getAccount().getId()); - goodsMsg.setMerName(userModel.getAccount().getUserName()); - - if (body.getId() != null) { - goodsMsgService.update(goodsMsg); - } else { - goodsMsgService.create(goodsMsg); + if (body == null + || body.getGoodsBrand() == null + || body.getGoodsType() == null + || body.getType() == null + || StringUtils.isBlank(body.getListImg()) + || StringUtils.isBlank(body.getBannerImg()) + || StringUtils.isBlank(body.getDetailImg()) + || StringUtils.isBlank(body.getTitle())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + GoodsMsg goodsMsg; + + if (body.getId() != null) { + // 查询品牌 + goodsMsg = goodsMsgService.queryDetail(body.getId()); + if (goodsMsg == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + } + } else { + goodsMsg = new GoodsMsg(); + goodsMsg.setCreateTime(new Date()); + goodsMsg.setSaleNum(0); + } + + goodsMsg.setUpdateTime(new Date()); + goodsMsg.setGoodsBrandName(goodsBrandService.findGoodsBrandName(body.getGoodsBrand())); + goodsMsg.setGoodsTypeName(goodsTypeService.findGoodsType(body.getGoodsType())); + goodsMsg.setGoodsType(body.getGoodsType()); + goodsMsg.setType(body.getType()); + goodsMsg.setGoodsBrand(body.getGoodsBrand()); + goodsMsg.setStatus(2); + goodsMsg.setTitle(body.getTitle()); + goodsMsg.setListImg(body.getListImg()); + goodsMsg.setBannerImg(body.getBannerImg()); + goodsMsg.setDetailImg(body.getDetailImg()); + goodsMsg.setMerId(userModel.getAccount().getId()); + goodsMsg.setMerName(userModel.getAccount().getUserName()); + + if (body.getId() != null) { + goodsMsgService.update(goodsMsg); + } else { + goodsMsgService.create(goodsMsg); + } + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); } - return ResponseMsgUtil.success("操作成功"); } @RequestMapping(value="/editGoodsSpecs",method = RequestMethod.POST) @@ -111,104 +128,108 @@ public class GoodsController { @ApiOperation(value = "编辑商品规格") public ResponseData editGoodsSpecs(@RequestBody GoodsModelSpecs body, HttpServletRequest request) { - SessionObject sessionObject = userCenter.getSessionObject(request); - SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); - if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); - } - - if (body == null - || body.getGoodsId() == null - || body.getOriginalPrice() == null - || body.getSalePrice() == null - || body.getPurLimit() == null - || body.getStock() == null - || StringUtils.isBlank(body.getBannerImg()) - || StringUtils.isBlank(body.getShowImg()) - || StringUtils.isBlank(body.getName())) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); - } - GoodsMsg goodsMsg = goodsMsgService.queryDetail(body.getGoodsId()); - - if (goodsMsg == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); - } + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); + } - GoodsSpecs goodsSpecs; - GoodsVpd goodsVpd; + if (body == null + || body.getGoodsId() == null + || body.getOriginalPrice() == null + || body.getSalePrice() == null + || body.getPurLimit() == null + || body.getStock() == null + || body.getSalesEndTime() == null + || StringUtils.isBlank(body.getShowImg()) + || StringUtils.isBlank(body.getName())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + GoodsMsg goodsMsg = goodsMsgService.queryDetail(body.getGoodsId()); - if (body.getId() != null) { - // 查询规格 - goodsSpecs = goodsSpecsService.queryDetail(body.getId()); - if (goodsSpecs == null) { + if (goodsMsg == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); } - } else { - goodsSpecs = new GoodsSpecs(); - goodsSpecs.setCreateTime(new Date()); - } - goodsSpecs.setUpdateTime(new Date()); - goodsSpecs.setGoodsId(body.getGoodsId()); - goodsSpecs.setOriginalPrice(body.getOriginalPrice()); - goodsSpecs.setSalePrice(body.getSalePrice()); - goodsSpecs.setPurLimit(body.getPurLimit()); - goodsSpecs.setStock(body.getStock()); - goodsSpecs.setBannerImg(body.getBannerImg()); - goodsSpecs.setShowImg(body.getShowImg()); - goodsSpecs.setName(body.getName()); - goodsSpecs.setStatus(1); - - - if (goodsSpecs.getId() != null) { - goodsSpecsService.update(goodsSpecs); - } else { - goodsSpecsService.create(goodsSpecs); - } + GoodsSpecs goodsSpecs; + GoodsVpd goodsVpd; - // 判断当前商品是否是虚拟商品 - if(goodsMsg.getType() == 2) { - // 判断必填项 - if ( body.getSpecsId() == null - || body.getRecycleDay() == null - || body.getType() == null - || body.getSalesEndTime() == null - || body.getSource() == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + if (body.getId() != null) { + // 查询规格 + goodsSpecs = goodsSpecsService.queryDetail(body.getSpecsId()); + if (goodsSpecs == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + } + } else { + goodsSpecs = new GoodsSpecs(); + goodsSpecs.setCreateTime(new Date()); } - // 查询虚拟产品 - goodsVpd = goodsVpdService.queryDetailBySpecsId(goodsSpecs.getId()); - - if (goodsVpd == null) { - goodsVpd = new GoodsVpd(); - goodsVpd.setCreateTime(new Date()); + goodsSpecs.setUpdateTime(new Date()); + goodsSpecs.setGoodsId(body.getGoodsId()); + goodsSpecs.setOriginalPrice(body.getOriginalPrice()); + goodsSpecs.setSalePrice(body.getSalePrice()); + goodsSpecs.setPurLimit(body.getPurLimit()); + goodsSpecs.setStock(body.getStock()); + goodsSpecs.setSalesEndTime(body.getSalesEndTime()); + goodsSpecs.setShowImg(body.getShowImg()); + goodsSpecs.setName(body.getName()); + goodsSpecs.setStatus(1); + + if (goodsSpecs.getId() != null) { + goodsSpecsService.update(goodsSpecs); + } else { + goodsSpecsService.create(goodsSpecs); } - goodsVpd.setSpecsId(goodsSpecs.getId()); - goodsVpd.setRecycleDay(body.getRecycleDay()); - goodsVpd.setType(body.getType()); - goodsVpd.setJumpType(body.getJumpType()); - goodsVpd.setJumpUrl(body.getJumpUrl()); - goodsVpd.setAppidId(body.getAppidId()); - goodsVpd.setSalesEndTime(body.getSalesEndTime()); - goodsVpd.setSource(body.getSource()); - goodsVpd.setSalesEndTime(body.getSalesEndTime()); - goodsVpd.setUpdateTime(new Date()); - - if (goodsVpd.getId() != null) { - goodsVpdService.update(goodsVpd); - } else { - goodsVpdService.create(goodsVpd); + // 判断当前商品是否是虚拟商品 + if(goodsMsg.getType() == 2) { + // 判断必填项 + if ( goodsSpecs.getId() == null + || body.getValidDay() == null + || body.getType() == null + || body.getSource() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询虚拟产品 + goodsVpd = goodsVpdService.queryDetailBySpecsId(goodsSpecs.getId()); + + if (goodsVpd == null) { + goodsVpd = new GoodsVpd(); + goodsVpd.setCreateTime(new Date()); + } + + goodsVpd.setSpecsId(goodsSpecs.getId()); + goodsVpd.setValidDay(body.getValidDay()); + goodsVpd.setType(body.getType()); + goodsVpd.setJumpType(body.getJumpType()); + goodsVpd.setJumpUrl(body.getJumpUrl()); + goodsVpd.setAppid(body.getAppid()); + goodsVpd.setKey(body.getKey()); + goodsVpd.setSalesEndTime(body.getSalesEndTime()); + goodsVpd.setSource(body.getSource()); + goodsVpd.setUpdateTime(new Date()); + + if (goodsVpd.getId() != null) { + goodsVpdService.update(goodsVpd); + } else { + goodsVpdService.create(goodsVpd); + } } - } - return ResponseMsgUtil.success("操作成功"); + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } } @RequestMapping(value="/getListGoods",method = RequestMethod.GET) @@ -220,13 +241,17 @@ public class GoodsController { @RequestParam(value = "type" , required = false) Integer type, @RequestParam(value = "status" , required = false) Integer status, @RequestParam(value = "pageNum" , required = true) Integer pageNum, - @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + @RequestParam(value = "pageSize" , required = true) Integer pageSize, HttpServletRequest request) { try { + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + Map map = new HashMap<>(); map.put("title", title); map.put("goodsType", goodsType); map.put("goodsBrand", goodsBrand); + map.put("merId", userModel.getAccount().getId()); map.put("type", type); map.put("status", status); @@ -240,17 +265,12 @@ public class GoodsController { } - @RequestMapping(value="/getGoodsDetail",method = RequestMethod.GET) + @RequestMapping(value="/getGoodsSpecsList",method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "查询商品详情") - public ResponseData getGoodsDetail(@RequestParam(value = "id" , required = false) Long id) { + @ApiOperation(value = "查询商品规格列表") + public ResponseData getGoodsSpecsList(@RequestParam(value = "id" , required = false) Long id) { try { - - GoodsModel goodsModel = new GoodsModel(); - GoodsMsg goodsMsg = goodsMsgService.queryDetail(id); - BeanUtils.copyProperties(goodsMsg, goodsModel); - Map map = new HashMap<>(); map.put("goodsId" , id); @@ -265,6 +285,7 @@ public class GoodsController { if (goodsVpd != null) { BeanUtils.copyProperties(goodsVpd, goodsModelSpec); } + goodsModelSpec.setSpecsId(goodsSpec.getId()); goodsModelSpecs.add(goodsModelSpec); } @@ -276,5 +297,71 @@ public class GoodsController { } } + @RequestMapping(value="/getGoodsSpecsListAll",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商品规格列表") + public ResponseData getGoodsSpecsListAll() { + try { + Map map = new HashMap<>(); + map.put("status" , 1); + List goodsMsgList = goodsMsgService.getList(new HashMap<>()); + + List goodsModelSpecs = new ArrayList<>(); + + for (GoodsMsg goodsMsg : goodsMsgList) { + Map mapGoods = new HashMap<>(); + mapGoods.put("goodsId" , goodsMsg.getId()); + + List goodsSpecs = goodsSpecsService.getList(mapGoods); + for (GoodsSpecs goodsSpec : goodsSpecs) { + GoodsModelSpecs goodsModelSpec = new GoodsModelSpecs(); + BeanUtils.copyProperties(goodsSpec, goodsModelSpec); + goodsModelSpec.setGoodsName(goodsMsg.getTitle()); + goodsModelSpec.setSpecsId(goodsSpec.getId()); + goodsModelSpecs.add(goodsModelSpec); + } + + } + + return ResponseMsgUtil.success(goodsModelSpecs); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/deleteGoodsMsg",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "删除") + public ResponseData deleteGoodsMsg(@RequestParam(value = "id" , required = false) Long id) { + try { + + goodsMsgService.delete(id , false); + + return ResponseMsgUtil.success("删除成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/deleteGoodsSpecs",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "删除规格") + public ResponseData deleteGoodsSpecs(@RequestParam(value = "id" , required = false) Long id) { + try { + + goodsSpecsService.delete(id , false); + + return ResponseMsgUtil.success("删除成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/cweb/src/main/java/com/cweb/config/AuthConfig.java b/cweb/src/main/java/com/cweb/config/AuthConfig.java index 9ad7d75..7f91ea8 100644 --- a/cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -86,48 +86,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/**/api-docs") .excludePathPatterns("/**/springfox-swagger-ui/**") .excludePathPatterns("/**/swagger-ui.html") - .excludePathPatterns("/login/*") - .excludePathPatterns("/order/*") - .excludePathPatterns("/coupon/getCouponList") - .excludePathPatterns("/wechatpay/*") - .excludePathPatterns("/coupon/getCouponById") - .excludePathPatterns("/discount/getDiscountByQrCode") - .excludePathPatterns("/discount/getDiscountById") - .excludePathPatterns("/discount/getCouponByDiscount") - .excludePathPatterns("/discount/getDiscountByDiscountAgentId") - .excludePathPatterns("/highMerchantStore/getMerchantStoreById") - .excludePathPatterns("/highMerchantStore/getStoreListByCoupon") - .excludePathPatterns("/highMerchantStore/getStoreList") - .excludePathPatterns("/highMerchantStore/getMerchantList") - .excludePathPatterns("/highMerchantStore/getStoreListByMerchant") - .excludePathPatterns("/sms/sendSmsCode") - .excludePathPatterns("/sms/getSmsCode") - .excludePathPatterns("/activity/getWinLotteryList") - .excludePathPatterns("/user/login") - .excludePathPatterns("/user/unionPhoneLogin") - .excludePathPatterns("/user/getUnionId") - .excludePathPatterns("/highUser/setCacheParam") - .excludePathPatterns("/highUser/getCacheParam") - .excludePathPatterns("/highUser/delCacheParam") - .excludePathPatterns("/order/orderToH5Pay") - .excludePathPatterns("/order/orderToPay") - .excludePathPatterns("/test/*") - .excludePathPatterns("/cmsContent/*") - .excludePathPatterns("/highGas/*") - .excludePathPatterns("/outRechargeOrder/*") - .excludePathPatterns("/wechat/*") - .excludePathPatterns("/tuanyou/*") - .excludePathPatterns("/unionPay/*") - .excludePathPatterns("/highGas/*") - .excludePathPatterns("/common/*") - .excludePathPatterns("/order/qzOrderToPay") - .excludePathPatterns("/czOrder/orderRefundNotify") - .excludePathPatterns("/cmsContent/*") - .excludePathPatterns("/highBrand/*") - .excludePathPatterns("/highGoodsType/*") - .excludePathPatterns("/sendSms/*") - .excludePathPatterns("/test/*") - .excludePathPatterns("/sms/*") + .excludePathPatterns("/goods/*") ; } diff --git a/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java b/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java new file mode 100644 index 0000000..c6fb2af --- /dev/null +++ b/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java @@ -0,0 +1,211 @@ +package com.cweb.controller.goods; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.PageUtil; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.GoodsMsg; +import com.hfkj.entity.GoodsSpecs; +import com.hfkj.entity.GoodsType; +import com.hfkj.entity.GoodsVpd; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.model.goods.GoodsModel; +import com.hfkj.model.goods.GoodsModelSpecs; +import com.hfkj.model.goods.GoodsTypeModel; +import com.hfkj.service.goods.*; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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.BeanUtils; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +@Controller +@RequestMapping(value="/goods") +@Api(value="商品信息") +public class GoodsController { + + private static final Logger log = LoggerFactory.getLogger(GoodsController.class); + + @Resource + private GoodsTypeService goodsTypeService; + + @Resource + private GoodsBrandService goodsBrandService; + + @Resource + private GoodsMsgService goodsMsgService; + + @Resource + private GoodsSpecsService goodsSpecsService; + + @Resource + private GoodsVpdService goodsVpdService; + + + @RequestMapping(value="/getListGoodsType",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商品分类列表") + public ResponseData getListGoodsType() { + try { + + List list = goodsTypeService.getList(new HashMap<>()); + + List goodsTypeModels = goodsTypeService.getGoodsTypeModelList(list); + + return ResponseMsgUtil.success(goodsTypeModels); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getListBrand",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询品牌列表") + public ResponseData getListBrand(@RequestParam(value = "title" , required = false) String title) { + try { + + Map map = new HashMap<>(); + map.put("title", title); + + return ResponseMsgUtil.success(goodsBrandService.getList(map)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getListGoods", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商品列表") + public ResponseData getListGoods( + @RequestParam(value = "title", required = false) String title, + @RequestParam(value = "goodsType", required = false) Long goodsType, + @RequestParam(value = "goodsBrand", required = false) Long goodsBrand, + @RequestParam(value = "price", required = false) Integer price, + @RequestParam(value = "saleNum", required = false) Integer saleNum, + @RequestParam(value = "time", required = false) Integer time, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize + ) { + try { + + + Map map = new HashMap<>(); + + map.put("title", title); + map.put("goodsType", goodsType); + map.put("goodsBrand", goodsBrand); + map.put("saleNum", saleNum); + map.put("time", time); + map.put("status", 1); + + List list = goodsMsgService.getList(map); + + List goodsModels = new ArrayList<>(); + + for (GoodsMsg goodsMsg : list) { + + GoodsModel goodsModel = new GoodsModel(); + + Map mapSpecs = new HashMap<>(); + mapSpecs.put("goodsId" , goodsMsg.getId()); + + List goodsSpecs = goodsSpecsService.getList(mapSpecs); + if (!goodsSpecs.isEmpty()) { + BigDecimal minPrice = goodsSpecs.get(0).getSalePrice(); + BigDecimal minOriginalPrice = goodsSpecs.get(0).getOriginalPrice(); + + for (GoodsSpecs specs : goodsSpecs) { + if (specs.getSalePrice().compareTo(minPrice) < 0) { + minPrice = specs.getSalePrice(); + minOriginalPrice = specs.getOriginalPrice(); + } + } + BeanUtils.copyProperties(goodsMsg, goodsModel); + goodsModel.setOriginalPrice(minOriginalPrice); + goodsModel.setPrice(minPrice); + + goodsModels.add(goodsModel); + + } + } + + if (price != null) { + if (price == 1) { + goodsModels = goodsModels.stream().sorted(Comparator.comparing(GoodsModel::getPrice)).collect(Collectors.toList()); + } + if (price == 2) { + goodsModels = goodsModels.stream().sorted(Comparator.comparing(GoodsModel::getPrice).reversed()).collect(Collectors.toList()); + } + } + + + return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, goodsModels.size(), pageSize, new PageInfo<>(goodsModels))); + + } catch (Exception e) { + log.error("GoodsDetailController --> getListUser() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/getGoodsDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商品详情") + public ResponseData getGoodsDetail(@RequestParam(value = "id" , required = false) Long id) { + try { + + GoodsMsg goodsMsg = goodsMsgService.queryDetail(id); + + GoodsModel goodsModel = new GoodsModel(); + + BeanUtils.copyProperties(goodsMsg, goodsModel); + + Map map = new HashMap<>(); + map.put("goodsId" , id); + + List goodsSpecs = goodsSpecsService.getList(map); + + List goodsModelSpecs = new ArrayList<>(); + + for (GoodsSpecs goodsSpec : goodsSpecs) { + GoodsModelSpecs goodsModelSpec = new GoodsModelSpecs(); + BeanUtils.copyProperties(goodsSpec, goodsModelSpec); + GoodsVpd goodsVpd = goodsVpdService.queryDetailBySpecsId(goodsSpec.getId()); + if (goodsVpd != null) { + BeanUtils.copyProperties(goodsVpd, goodsModelSpec); + } + goodsModelSpec.setSpecsId(goodsSpec.getId()); + goodsModelSpecs.add(goodsModelSpec); + } + + goodsModel.setGoodsModelSpecs(goodsModelSpecs); + + return ResponseMsgUtil.success(goodsModel); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/service/src/main/java/com/hfkj/dao/CouponDiscountGoodsRelMapper.java b/service/src/main/java/com/hfkj/dao/CouponDiscountGoodsRelMapper.java new file mode 100644 index 0000000..60d7e51 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/CouponDiscountGoodsRelMapper.java @@ -0,0 +1,108 @@ +package com.hfkj.dao; + +import com.hfkj.entity.CouponDiscountGoodsRel; +import com.hfkj.entity.CouponDiscountGoodsRelExample; +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 CouponDiscountGoodsRelMapper extends CouponDiscountGoodsRelMapperExt { + @SelectProvider(type=CouponDiscountGoodsRelSqlProvider.class, method="countByExample") + long countByExample(CouponDiscountGoodsRelExample example); + + @DeleteProvider(type=CouponDiscountGoodsRelSqlProvider.class, method="deleteByExample") + int deleteByExample(CouponDiscountGoodsRelExample example); + + @Delete({ + "delete from coupon_discount_goods_rel", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into coupon_discount_goods_rel (discount_id, create_time, ", + "specs_id, `status`, ", + "ext_1, ext_2, ext_3)", + "values (#{discountId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{specsId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(CouponDiscountGoodsRel record); + + @InsertProvider(type=CouponDiscountGoodsRelSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(CouponDiscountGoodsRel record); + + @SelectProvider(type=CouponDiscountGoodsRelSqlProvider.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="specs_id", property="specsId", 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 selectByExample(CouponDiscountGoodsRelExample example); + + @Select({ + "select", + "id, discount_id, create_time, specs_id, `status`, ext_1, ext_2, ext_3", + "from coupon_discount_goods_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="specs_id", property="specsId", 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) + }) + CouponDiscountGoodsRel selectByPrimaryKey(Long id); + + @UpdateProvider(type=CouponDiscountGoodsRelSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") CouponDiscountGoodsRel record, @Param("example") CouponDiscountGoodsRelExample example); + + @UpdateProvider(type=CouponDiscountGoodsRelSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") CouponDiscountGoodsRel record, @Param("example") CouponDiscountGoodsRelExample example); + + @UpdateProvider(type=CouponDiscountGoodsRelSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(CouponDiscountGoodsRel record); + + @Update({ + "update coupon_discount_goods_rel", + "set discount_id = #{discountId,jdbcType=BIGINT},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "specs_id = #{specsId,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(CouponDiscountGoodsRel record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/CouponDiscountGoodsRelMapperExt.java b/service/src/main/java/com/hfkj/dao/CouponDiscountGoodsRelMapperExt.java new file mode 100644 index 0000000..274d160 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/CouponDiscountGoodsRelMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface CouponDiscountGoodsRelMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/CouponDiscountGoodsRelSqlProvider.java b/service/src/main/java/com/hfkj/dao/CouponDiscountGoodsRelSqlProvider.java new file mode 100644 index 0000000..b6a75cd --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/CouponDiscountGoodsRelSqlProvider.java @@ -0,0 +1,276 @@ +package com.hfkj.dao; + +import com.hfkj.entity.CouponDiscountGoodsRel; +import com.hfkj.entity.CouponDiscountGoodsRelExample.Criteria; +import com.hfkj.entity.CouponDiscountGoodsRelExample.Criterion; +import com.hfkj.entity.CouponDiscountGoodsRelExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class CouponDiscountGoodsRelSqlProvider { + + public String countByExample(CouponDiscountGoodsRelExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("coupon_discount_goods_rel"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(CouponDiscountGoodsRelExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("coupon_discount_goods_rel"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(CouponDiscountGoodsRel record) { + SQL sql = new SQL(); + sql.INSERT_INTO("coupon_discount_goods_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.getSpecsId() != null) { + sql.VALUES("specs_id", "#{specsId,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(CouponDiscountGoodsRelExample 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("specs_id"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("coupon_discount_goods_rel"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + CouponDiscountGoodsRel record = (CouponDiscountGoodsRel) parameter.get("record"); + CouponDiscountGoodsRelExample example = (CouponDiscountGoodsRelExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("coupon_discount_goods_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.getSpecsId() != null) { + sql.SET("specs_id = #{record.specsId,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 parameter) { + SQL sql = new SQL(); + sql.UPDATE("coupon_discount_goods_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("specs_id = #{record.specsId,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}"); + + CouponDiscountGoodsRelExample example = (CouponDiscountGoodsRelExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(CouponDiscountGoodsRel record) { + SQL sql = new SQL(); + sql.UPDATE("coupon_discount_goods_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.getSpecsId() != null) { + sql.SET("specs_id = #{specsId,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, CouponDiscountGoodsRelExample 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 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 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()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/CouponDiscountMapper.java b/service/src/main/java/com/hfkj/dao/CouponDiscountMapper.java new file mode 100644 index 0000000..b6800a3 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/CouponDiscountMapper.java @@ -0,0 +1,153 @@ +package com.hfkj.dao; + +import com.hfkj.entity.CouponDiscount; +import com.hfkj.entity.CouponDiscountExample; +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 CouponDiscountMapper extends CouponDiscountMapperExt { + @SelectProvider(type=CouponDiscountSqlProvider.class, method="countByExample") + long countByExample(CouponDiscountExample example); + + @DeleteProvider(type=CouponDiscountSqlProvider.class, method="deleteByExample") + int deleteByExample(CouponDiscountExample example); + + @Delete({ + "delete from coupon_discount", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into coupon_discount (`name`, img, ", + "`type`, `condition`, ", + "price, percentage, ", + "limit_num, effective_day, ", + "effective_num, sales_end_time, ", + "create_time, update_time, ", + "op_id, op_name, `status`, ", + "ext_1, ext_2, ext_3)", + "values (#{name,jdbcType=VARCHAR}, #{img,jdbcType=VARCHAR}, ", + "#{type,jdbcType=INTEGER}, #{condition,jdbcType=DECIMAL}, ", + "#{price,jdbcType=DECIMAL}, #{percentage,jdbcType=DECIMAL}, ", + "#{limitNum,jdbcType=INTEGER}, #{effectiveDay,jdbcType=INTEGER}, ", + "#{effectiveNum,jdbcType=INTEGER}, #{salesEndTime,jdbcType=TIMESTAMP}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(CouponDiscount record); + + @InsertProvider(type=CouponDiscountSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(CouponDiscount record); + + @SelectProvider(type=CouponDiscountSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="condition", property="condition", jdbcType=JdbcType.DECIMAL), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="percentage", property="percentage", jdbcType=JdbcType.DECIMAL), + @Result(column="limit_num", property="limitNum", jdbcType=JdbcType.INTEGER), + @Result(column="effective_day", property="effectiveDay", jdbcType=JdbcType.INTEGER), + @Result(column="effective_num", property="effectiveNum", 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="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", 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 selectByExample(CouponDiscountExample example); + + @Select({ + "select", + "id, `name`, img, `type`, `condition`, price, percentage, limit_num, effective_day, ", + "effective_num, sales_end_time, create_time, update_time, op_id, op_name, `status`, ", + "ext_1, ext_2, ext_3", + "from coupon_discount", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="condition", property="condition", jdbcType=JdbcType.DECIMAL), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="percentage", property="percentage", jdbcType=JdbcType.DECIMAL), + @Result(column="limit_num", property="limitNum", jdbcType=JdbcType.INTEGER), + @Result(column="effective_day", property="effectiveDay", jdbcType=JdbcType.INTEGER), + @Result(column="effective_num", property="effectiveNum", 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="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", 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) + }) + CouponDiscount selectByPrimaryKey(Long id); + + @UpdateProvider(type=CouponDiscountSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") CouponDiscount record, @Param("example") CouponDiscountExample example); + + @UpdateProvider(type=CouponDiscountSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") CouponDiscount record, @Param("example") CouponDiscountExample example); + + @UpdateProvider(type=CouponDiscountSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(CouponDiscount record); + + @Update({ + "update coupon_discount", + "set `name` = #{name,jdbcType=VARCHAR},", + "img = #{img,jdbcType=VARCHAR},", + "`type` = #{type,jdbcType=INTEGER},", + "`condition` = #{condition,jdbcType=DECIMAL},", + "price = #{price,jdbcType=DECIMAL},", + "percentage = #{percentage,jdbcType=DECIMAL},", + "limit_num = #{limitNum,jdbcType=INTEGER},", + "effective_day = #{effectiveDay,jdbcType=INTEGER},", + "effective_num = #{effectiveNum,jdbcType=INTEGER},", + "sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "op_id = #{opId,jdbcType=BIGINT},", + "op_name = #{opName,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(CouponDiscount record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/CouponDiscountMapperExt.java b/service/src/main/java/com/hfkj/dao/CouponDiscountMapperExt.java new file mode 100644 index 0000000..0318c41 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/CouponDiscountMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface CouponDiscountMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/CouponDiscountSqlProvider.java b/service/src/main/java/com/hfkj/dao/CouponDiscountSqlProvider.java new file mode 100644 index 0000000..6568e1b --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/CouponDiscountSqlProvider.java @@ -0,0 +1,430 @@ +package com.hfkj.dao; + +import com.hfkj.entity.CouponDiscount; +import com.hfkj.entity.CouponDiscountExample.Criteria; +import com.hfkj.entity.CouponDiscountExample.Criterion; +import com.hfkj.entity.CouponDiscountExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class CouponDiscountSqlProvider { + + public String countByExample(CouponDiscountExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("coupon_discount"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(CouponDiscountExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("coupon_discount"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(CouponDiscount record) { + SQL sql = new SQL(); + sql.INSERT_INTO("coupon_discount"); + + if (record.getName() != null) { + sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); + } + + if (record.getImg() != null) { + sql.VALUES("img", "#{img,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getCondition() != null) { + sql.VALUES("`condition`", "#{condition,jdbcType=DECIMAL}"); + } + + if (record.getPrice() != null) { + sql.VALUES("price", "#{price,jdbcType=DECIMAL}"); + } + + if (record.getPercentage() != null) { + sql.VALUES("percentage", "#{percentage,jdbcType=DECIMAL}"); + } + + if (record.getLimitNum() != null) { + sql.VALUES("limit_num", "#{limitNum,jdbcType=INTEGER}"); + } + + if (record.getEffectiveDay() != null) { + sql.VALUES("effective_day", "#{effectiveDay,jdbcType=INTEGER}"); + } + + if (record.getEffectiveNum() != null) { + sql.VALUES("effective_num", "#{effectiveNum,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.getOpId() != null) { + sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.VALUES("op_name", "#{opName,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(CouponDiscountExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("`name`"); + sql.SELECT("img"); + sql.SELECT("`type`"); + sql.SELECT("`condition`"); + sql.SELECT("price"); + sql.SELECT("percentage"); + sql.SELECT("limit_num"); + sql.SELECT("effective_day"); + sql.SELECT("effective_num"); + sql.SELECT("sales_end_time"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("op_id"); + sql.SELECT("op_name"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("coupon_discount"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + CouponDiscount record = (CouponDiscount) parameter.get("record"); + CouponDiscountExample example = (CouponDiscountExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("coupon_discount"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getName() != null) { + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + } + + if (record.getImg() != null) { + sql.SET("img = #{record.img,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getCondition() != null) { + sql.SET("`condition` = #{record.condition,jdbcType=DECIMAL}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + } + + if (record.getPercentage() != null) { + sql.SET("percentage = #{record.percentage,jdbcType=DECIMAL}"); + } + + if (record.getLimitNum() != null) { + sql.SET("limit_num = #{record.limitNum,jdbcType=INTEGER}"); + } + + if (record.getEffectiveDay() != null) { + sql.SET("effective_day = #{record.effectiveDay,jdbcType=INTEGER}"); + } + + if (record.getEffectiveNum() != null) { + sql.SET("effective_num = #{record.effectiveNum,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.getOpId() != null) { + sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{record.opName,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 parameter) { + SQL sql = new SQL(); + sql.UPDATE("coupon_discount"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + sql.SET("img = #{record.img,jdbcType=VARCHAR}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("`condition` = #{record.condition,jdbcType=DECIMAL}"); + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + sql.SET("percentage = #{record.percentage,jdbcType=DECIMAL}"); + sql.SET("limit_num = #{record.limitNum,jdbcType=INTEGER}"); + sql.SET("effective_day = #{record.effectiveDay,jdbcType=INTEGER}"); + sql.SET("effective_num = #{record.effectiveNum,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("op_id = #{record.opId,jdbcType=BIGINT}"); + sql.SET("op_name = #{record.opName,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}"); + + CouponDiscountExample example = (CouponDiscountExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(CouponDiscount record) { + SQL sql = new SQL(); + sql.UPDATE("coupon_discount"); + + if (record.getName() != null) { + sql.SET("`name` = #{name,jdbcType=VARCHAR}"); + } + + if (record.getImg() != null) { + sql.SET("img = #{img,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getCondition() != null) { + sql.SET("`condition` = #{condition,jdbcType=DECIMAL}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{price,jdbcType=DECIMAL}"); + } + + if (record.getPercentage() != null) { + sql.SET("percentage = #{percentage,jdbcType=DECIMAL}"); + } + + if (record.getLimitNum() != null) { + sql.SET("limit_num = #{limitNum,jdbcType=INTEGER}"); + } + + if (record.getEffectiveDay() != null) { + sql.SET("effective_day = #{effectiveDay,jdbcType=INTEGER}"); + } + + if (record.getEffectiveNum() != null) { + sql.SET("effective_num = #{effectiveNum,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.getOpId() != null) { + sql.SET("op_id = #{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{opName,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, CouponDiscountExample 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 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 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()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/GoodsMsgMapper.java b/service/src/main/java/com/hfkj/dao/GoodsMsgMapper.java index 14bfde8..f05fa4b 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsMsgMapper.java +++ b/service/src/main/java/com/hfkj/dao/GoodsMsgMapper.java @@ -40,7 +40,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { @Insert({ "insert into goods_msg (goods_type_name, goods_type, ", - "`type`, goods_brand_name, ", + "sale_num, `type`, goods_brand_name, ", "goods_brand, goods_label, ", "goods_explain, title, ", "list_img, banner_img, ", @@ -49,7 +49,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { "mer_id, mer_name, ext_1, ", "ext_2, ext_3)", "values (#{goodsTypeName,jdbcType=VARCHAR}, #{goodsType,jdbcType=BIGINT}, ", - "#{type,jdbcType=INTEGER}, #{goodsBrandName,jdbcType=VARCHAR}, ", + "#{saleNum,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{goodsBrandName,jdbcType=VARCHAR}, ", "#{goodsBrand,jdbcType=BIGINT}, #{goodsLabel,jdbcType=VARCHAR}, ", "#{goodsExplain,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, ", "#{listImg,jdbcType=VARCHAR}, #{bannerImg,jdbcType=VARCHAR}, ", @@ -70,6 +70,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="goods_type_name", property="goodsTypeName", jdbcType=JdbcType.VARCHAR), @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.BIGINT), + @Result(column="sale_num", property="saleNum", jdbcType=JdbcType.INTEGER), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="goods_brand_name", property="goodsBrandName", jdbcType=JdbcType.VARCHAR), @Result(column="goods_brand", property="goodsBrand", jdbcType=JdbcType.BIGINT), @@ -92,9 +93,9 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { @Select({ "select", - "id, goods_type_name, goods_type, `type`, goods_brand_name, goods_brand, goods_label, ", - "goods_explain, title, list_img, banner_img, detail_img, `status`, create_time, ", - "update_time, mer_id, mer_name, ext_1, ext_2, ext_3", + "id, goods_type_name, goods_type, sale_num, `type`, goods_brand_name, goods_brand, ", + "goods_label, goods_explain, title, list_img, banner_img, detail_img, `status`, ", + "create_time, update_time, mer_id, mer_name, ext_1, ext_2, ext_3", "from goods_msg", "where id = #{id,jdbcType=BIGINT}" }) @@ -102,6 +103,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="goods_type_name", property="goodsTypeName", jdbcType=JdbcType.VARCHAR), @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.BIGINT), + @Result(column="sale_num", property="saleNum", jdbcType=JdbcType.INTEGER), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="goods_brand_name", property="goodsBrandName", jdbcType=JdbcType.VARCHAR), @Result(column="goods_brand", property="goodsBrand", jdbcType=JdbcType.BIGINT), @@ -135,6 +137,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt { "update goods_msg", "set goods_type_name = #{goodsTypeName,jdbcType=VARCHAR},", "goods_type = #{goodsType,jdbcType=BIGINT},", + "sale_num = #{saleNum,jdbcType=INTEGER},", "`type` = #{type,jdbcType=INTEGER},", "goods_brand_name = #{goodsBrandName,jdbcType=VARCHAR},", "goods_brand = #{goodsBrand,jdbcType=BIGINT},", diff --git a/service/src/main/java/com/hfkj/dao/GoodsMsgSqlProvider.java b/service/src/main/java/com/hfkj/dao/GoodsMsgSqlProvider.java index 993db9a..1aae4b2 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsMsgSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/GoodsMsgSqlProvider.java @@ -36,6 +36,10 @@ public class GoodsMsgSqlProvider { sql.VALUES("goods_type", "#{goodsType,jdbcType=BIGINT}"); } + if (record.getSaleNum() != null) { + sql.VALUES("sale_num", "#{saleNum,jdbcType=INTEGER}"); + } + if (record.getType() != null) { sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); } @@ -116,6 +120,7 @@ public class GoodsMsgSqlProvider { } sql.SELECT("goods_type_name"); sql.SELECT("goods_type"); + sql.SELECT("sale_num"); sql.SELECT("`type`"); sql.SELECT("goods_brand_name"); sql.SELECT("goods_brand"); @@ -162,6 +167,10 @@ public class GoodsMsgSqlProvider { sql.SET("goods_type = #{record.goodsType,jdbcType=BIGINT}"); } + if (record.getSaleNum() != null) { + sql.SET("sale_num = #{record.saleNum,jdbcType=INTEGER}"); + } + if (record.getType() != null) { sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); } @@ -241,6 +250,7 @@ public class GoodsMsgSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("goods_type_name = #{record.goodsTypeName,jdbcType=VARCHAR}"); sql.SET("goods_type = #{record.goodsType,jdbcType=BIGINT}"); + sql.SET("sale_num = #{record.saleNum,jdbcType=INTEGER}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("goods_brand_name = #{record.goodsBrandName,jdbcType=VARCHAR}"); sql.SET("goods_brand = #{record.goodsBrand,jdbcType=BIGINT}"); @@ -276,6 +286,10 @@ public class GoodsMsgSqlProvider { sql.SET("goods_type = #{goodsType,jdbcType=BIGINT}"); } + if (record.getSaleNum() != null) { + sql.SET("sale_num = #{saleNum,jdbcType=INTEGER}"); + } + if (record.getType() != null) { sql.SET("`type` = #{type,jdbcType=INTEGER}"); } diff --git a/service/src/main/java/com/hfkj/dao/GoodsSpecsMapper.java b/service/src/main/java/com/hfkj/dao/GoodsSpecsMapper.java index 6dd0c65..520bff5 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsSpecsMapper.java +++ b/service/src/main/java/com/hfkj/dao/GoodsSpecsMapper.java @@ -42,14 +42,14 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { "insert into goods_specs (goods_id, `name`, ", "pur_limit, sale_price, ", "original_price, stock, ", - "show_img, banner_img, ", + "show_img, sales_end_time, ", "`status`, create_time, ", "update_time, ext_1, ", "ext_2, ext_3)", "values (#{goodsId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ", "#{purLimit,jdbcType=INTEGER}, #{salePrice,jdbcType=DECIMAL}, ", "#{originalPrice,jdbcType=DECIMAL}, #{stock,jdbcType=INTEGER}, ", - "#{showImg,jdbcType=VARCHAR}, #{bannerImg,jdbcType=VARCHAR}, ", + "#{showImg,jdbcType=VARCHAR}, #{salesEndTime,jdbcType=TIMESTAMP}, ", "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" @@ -71,7 +71,7 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { @Result(column="original_price", property="originalPrice", jdbcType=JdbcType.DECIMAL), @Result(column="stock", property="stock", jdbcType=JdbcType.INTEGER), @Result(column="show_img", property="showImg", jdbcType=JdbcType.VARCHAR), - @Result(column="banner_img", property="bannerImg", jdbcType=JdbcType.VARCHAR), + @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @@ -84,7 +84,7 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { @Select({ "select", "id, goods_id, `name`, pur_limit, sale_price, original_price, stock, show_img, ", - "banner_img, `status`, create_time, update_time, ext_1, ext_2, ext_3", + "sales_end_time, `status`, create_time, update_time, ext_1, ext_2, ext_3", "from goods_specs", "where id = #{id,jdbcType=BIGINT}" }) @@ -97,7 +97,7 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { @Result(column="original_price", property="originalPrice", jdbcType=JdbcType.DECIMAL), @Result(column="stock", property="stock", jdbcType=JdbcType.INTEGER), @Result(column="show_img", property="showImg", jdbcType=JdbcType.VARCHAR), - @Result(column="banner_img", property="bannerImg", jdbcType=JdbcType.VARCHAR), + @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @@ -125,7 +125,7 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { "original_price = #{originalPrice,jdbcType=DECIMAL},", "stock = #{stock,jdbcType=INTEGER},", "show_img = #{showImg,jdbcType=VARCHAR},", - "banner_img = #{bannerImg,jdbcType=VARCHAR},", + "sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},", "`status` = #{status,jdbcType=INTEGER},", "create_time = #{createTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", @@ -135,4 +135,4 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { "where id = #{id,jdbcType=BIGINT}" }) int updateByPrimaryKey(GoodsSpecs record); -} \ No newline at end of file +} diff --git a/service/src/main/java/com/hfkj/dao/GoodsSpecsSqlProvider.java b/service/src/main/java/com/hfkj/dao/GoodsSpecsSqlProvider.java index a2fe7dd..fc278b5 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsSpecsSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/GoodsSpecsSqlProvider.java @@ -56,8 +56,8 @@ public class GoodsSpecsSqlProvider { sql.VALUES("show_img", "#{showImg,jdbcType=VARCHAR}"); } - if (record.getBannerImg() != null) { - sql.VALUES("banner_img", "#{bannerImg,jdbcType=VARCHAR}"); + if (record.getSalesEndTime() != null) { + sql.VALUES("sales_end_time", "#{salesEndTime,jdbcType=TIMESTAMP}"); } if (record.getStatus() != null) { @@ -101,7 +101,7 @@ public class GoodsSpecsSqlProvider { sql.SELECT("original_price"); sql.SELECT("stock"); sql.SELECT("show_img"); - sql.SELECT("banner_img"); + sql.SELECT("sales_end_time"); sql.SELECT("`status`"); sql.SELECT("create_time"); sql.SELECT("update_time"); @@ -157,8 +157,8 @@ public class GoodsSpecsSqlProvider { sql.SET("show_img = #{record.showImg,jdbcType=VARCHAR}"); } - if (record.getBannerImg() != null) { - sql.SET("banner_img = #{record.bannerImg,jdbcType=VARCHAR}"); + if (record.getSalesEndTime() != null) { + sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); } if (record.getStatus() != null) { @@ -201,7 +201,7 @@ public class GoodsSpecsSqlProvider { sql.SET("original_price = #{record.originalPrice,jdbcType=DECIMAL}"); sql.SET("stock = #{record.stock,jdbcType=INTEGER}"); sql.SET("show_img = #{record.showImg,jdbcType=VARCHAR}"); - sql.SET("banner_img = #{record.bannerImg,jdbcType=VARCHAR}"); + sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); @@ -246,8 +246,8 @@ public class GoodsSpecsSqlProvider { sql.SET("show_img = #{showImg,jdbcType=VARCHAR}"); } - if (record.getBannerImg() != null) { - sql.SET("banner_img = #{bannerImg,jdbcType=VARCHAR}"); + if (record.getSalesEndTime() != null) { + sql.SET("sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP}"); } if (record.getStatus() != null) { @@ -371,4 +371,4 @@ public class GoodsSpecsSqlProvider { sql.WHERE(sb.toString()); } } -} \ No newline at end of file +} diff --git a/service/src/main/java/com/hfkj/dao/GoodsVpdMapper.java b/service/src/main/java/com/hfkj/dao/GoodsVpdMapper.java index 2551719..3793840 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsVpdMapper.java +++ b/service/src/main/java/com/hfkj/dao/GoodsVpdMapper.java @@ -40,17 +40,19 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { @Insert({ "insert into goods_vpd (specs_id, `key`, ", - "recycle_day, sales_end_time, ", - "`type`, `source`, jump_type, ", - "jump_url, appid_id, ", - "create_time, update_time, ", - "ext_1, ext_2, ext_3)", + "valid_day, `type`, ", + "`source`, jump_type, ", + "sales_end_time, jump_url, ", + "appid, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", "values (#{specsId,jdbcType=BIGINT}, #{key,jdbcType=VARCHAR}, ", - "#{recycleDay,jdbcType=INTEGER}, #{salesEndTime,jdbcType=TIMESTAMP}, ", - "#{type,jdbcType=INTEGER}, #{source,jdbcType=INTEGER}, #{jumpType,jdbcType=INTEGER}, ", - "#{jumpUrl,jdbcType=VARCHAR}, #{appidId,jdbcType=VARCHAR}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{validDay,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, ", + "#{source,jdbcType=INTEGER}, #{jumpType,jdbcType=INTEGER}, ", + "#{salesEndTime,jdbcType=TIMESTAMP}, #{jumpUrl,jdbcType=VARCHAR}, ", + "#{appid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(GoodsVpd record); @@ -64,13 +66,13 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="specs_id", property="specsId", jdbcType=JdbcType.BIGINT), @Result(column="key", property="key", jdbcType=JdbcType.VARCHAR), - @Result(column="recycle_day", property="recycleDay", jdbcType=JdbcType.INTEGER), - @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="valid_day", property="validDay", jdbcType=JdbcType.INTEGER), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="source", property="source", jdbcType=JdbcType.INTEGER), @Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER), + @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="jump_url", property="jumpUrl", jdbcType=JdbcType.VARCHAR), - @Result(column="appid_id", property="appidId", jdbcType=JdbcType.VARCHAR), + @Result(column="appid", property="appid", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -81,8 +83,8 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { @Select({ "select", - "id, specs_id, `key`, recycle_day, sales_end_time, `type`, `source`, jump_type, ", - "jump_url, appid_id, create_time, update_time, ext_1, ext_2, ext_3", + "id, specs_id, `key`, valid_day, `type`, `source`, jump_type, sales_end_time, ", + "jump_url, appid, create_time, update_time, ext_1, ext_2, ext_3", "from goods_vpd", "where id = #{id,jdbcType=BIGINT}" }) @@ -90,13 +92,13 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="specs_id", property="specsId", jdbcType=JdbcType.BIGINT), @Result(column="key", property="key", jdbcType=JdbcType.VARCHAR), - @Result(column="recycle_day", property="recycleDay", jdbcType=JdbcType.INTEGER), - @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="valid_day", property="validDay", jdbcType=JdbcType.INTEGER), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="source", property="source", jdbcType=JdbcType.INTEGER), @Result(column="jump_type", property="jumpType", jdbcType=JdbcType.INTEGER), + @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="jump_url", property="jumpUrl", jdbcType=JdbcType.VARCHAR), - @Result(column="appid_id", property="appidId", jdbcType=JdbcType.VARCHAR), + @Result(column="appid", property="appid", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -118,13 +120,13 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { "update goods_vpd", "set specs_id = #{specsId,jdbcType=BIGINT},", "`key` = #{key,jdbcType=VARCHAR},", - "recycle_day = #{recycleDay,jdbcType=INTEGER},", - "sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},", + "valid_day = #{validDay,jdbcType=INTEGER},", "`type` = #{type,jdbcType=INTEGER},", "`source` = #{source,jdbcType=INTEGER},", "jump_type = #{jumpType,jdbcType=INTEGER},", + "sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},", "jump_url = #{jumpUrl,jdbcType=VARCHAR},", - "appid_id = #{appidId,jdbcType=VARCHAR},", + "appid = #{appid,jdbcType=VARCHAR},", "create_time = #{createTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", "ext_1 = #{ext1,jdbcType=VARCHAR},", @@ -133,4 +135,4 @@ public interface GoodsVpdMapper extends GoodsVpdMapperExt { "where id = #{id,jdbcType=BIGINT}" }) int updateByPrimaryKey(GoodsVpd record); -} \ No newline at end of file +} diff --git a/service/src/main/java/com/hfkj/dao/GoodsVpdSqlProvider.java b/service/src/main/java/com/hfkj/dao/GoodsVpdSqlProvider.java index fdf5384..1b04543 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsVpdSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/GoodsVpdSqlProvider.java @@ -36,12 +36,8 @@ public class GoodsVpdSqlProvider { sql.VALUES("`key`", "#{key,jdbcType=VARCHAR}"); } - if (record.getRecycleDay() != null) { - sql.VALUES("recycle_day", "#{recycleDay,jdbcType=INTEGER}"); - } - - if (record.getSalesEndTime() != null) { - sql.VALUES("sales_end_time", "#{salesEndTime,jdbcType=TIMESTAMP}"); + if (record.getValidDay() != null) { + sql.VALUES("valid_day", "#{validDay,jdbcType=INTEGER}"); } if (record.getType() != null) { @@ -56,12 +52,16 @@ public class GoodsVpdSqlProvider { sql.VALUES("jump_type", "#{jumpType,jdbcType=INTEGER}"); } + if (record.getSalesEndTime() != null) { + sql.VALUES("sales_end_time", "#{salesEndTime,jdbcType=TIMESTAMP}"); + } + if (record.getJumpUrl() != null) { sql.VALUES("jump_url", "#{jumpUrl,jdbcType=VARCHAR}"); } - if (record.getAppidId() != null) { - sql.VALUES("appid_id", "#{appidId,jdbcType=VARCHAR}"); + if (record.getAppid() != null) { + sql.VALUES("appid", "#{appid,jdbcType=VARCHAR}"); } if (record.getCreateTime() != null) { @@ -96,13 +96,13 @@ public class GoodsVpdSqlProvider { } sql.SELECT("specs_id"); sql.SELECT("`key`"); - sql.SELECT("recycle_day"); - sql.SELECT("sales_end_time"); + sql.SELECT("valid_day"); sql.SELECT("`type`"); sql.SELECT("`source`"); sql.SELECT("jump_type"); + sql.SELECT("sales_end_time"); sql.SELECT("jump_url"); - sql.SELECT("appid_id"); + sql.SELECT("appid"); sql.SELECT("create_time"); sql.SELECT("update_time"); sql.SELECT("ext_1"); @@ -137,12 +137,8 @@ public class GoodsVpdSqlProvider { sql.SET("`key` = #{record.key,jdbcType=VARCHAR}"); } - if (record.getRecycleDay() != null) { - sql.SET("recycle_day = #{record.recycleDay,jdbcType=INTEGER}"); - } - - if (record.getSalesEndTime() != null) { - sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); + if (record.getValidDay() != null) { + sql.SET("valid_day = #{record.validDay,jdbcType=INTEGER}"); } if (record.getType() != null) { @@ -157,12 +153,16 @@ public class GoodsVpdSqlProvider { sql.SET("jump_type = #{record.jumpType,jdbcType=INTEGER}"); } + if (record.getSalesEndTime() != null) { + sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); + } + if (record.getJumpUrl() != null) { sql.SET("jump_url = #{record.jumpUrl,jdbcType=VARCHAR}"); } - if (record.getAppidId() != null) { - sql.SET("appid_id = #{record.appidId,jdbcType=VARCHAR}"); + if (record.getAppid() != null) { + sql.SET("appid = #{record.appid,jdbcType=VARCHAR}"); } if (record.getCreateTime() != null) { @@ -196,13 +196,13 @@ public class GoodsVpdSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("specs_id = #{record.specsId,jdbcType=BIGINT}"); sql.SET("`key` = #{record.key,jdbcType=VARCHAR}"); - sql.SET("recycle_day = #{record.recycleDay,jdbcType=INTEGER}"); - sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); + sql.SET("valid_day = #{record.validDay,jdbcType=INTEGER}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("`source` = #{record.source,jdbcType=INTEGER}"); sql.SET("jump_type = #{record.jumpType,jdbcType=INTEGER}"); + sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); sql.SET("jump_url = #{record.jumpUrl,jdbcType=VARCHAR}"); - sql.SET("appid_id = #{record.appidId,jdbcType=VARCHAR}"); + sql.SET("appid = #{record.appid,jdbcType=VARCHAR}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); @@ -226,12 +226,8 @@ public class GoodsVpdSqlProvider { sql.SET("`key` = #{key,jdbcType=VARCHAR}"); } - if (record.getRecycleDay() != null) { - sql.SET("recycle_day = #{recycleDay,jdbcType=INTEGER}"); - } - - if (record.getSalesEndTime() != null) { - sql.SET("sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP}"); + if (record.getValidDay() != null) { + sql.SET("valid_day = #{validDay,jdbcType=INTEGER}"); } if (record.getType() != null) { @@ -246,12 +242,16 @@ public class GoodsVpdSqlProvider { sql.SET("jump_type = #{jumpType,jdbcType=INTEGER}"); } + if (record.getSalesEndTime() != null) { + sql.SET("sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP}"); + } + if (record.getJumpUrl() != null) { sql.SET("jump_url = #{jumpUrl,jdbcType=VARCHAR}"); } - if (record.getAppidId() != null) { - sql.SET("appid_id = #{appidId,jdbcType=VARCHAR}"); + if (record.getAppid() != null) { + sql.SET("appid = #{appid,jdbcType=VARCHAR}"); } if (record.getCreateTime() != null) { @@ -371,4 +371,4 @@ public class GoodsVpdSqlProvider { sql.WHERE(sb.toString()); } } -} \ No newline at end of file +} diff --git a/service/src/main/java/com/hfkj/entity/CouponDiscount.java b/service/src/main/java/com/hfkj/entity/CouponDiscount.java new file mode 100644 index 0000000..b3de17f --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/CouponDiscount.java @@ -0,0 +1,345 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * coupon_discount + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class CouponDiscount implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 优惠券名称 + */ + private String name; + + /** + * 优惠券图片 + */ + private String img; + + /** + * 卡卷类型 1:满减 2:抵扣 3:折扣 + */ + private Integer type; + + /** + * 优惠券条件(满减价格) + */ + private BigDecimal condition; + + /** + * 优惠券价格 + */ + private BigDecimal price; + + /** + * 折扣百分比(折扣使用) + */ + private BigDecimal percentage; + + /** + * 限制数量 + */ + private Integer limitNum; + + /** + * 领取有效天数 + */ + private Integer effectiveDay; + + /** + * 领取数量 + */ + private Integer effectiveNum; + + /** + * 使用截止日期 + */ + private Date salesEndTime; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 操作人id + */ + private Long opId; + + /** + * 操作人名称 + */ + private String opName; + + /** + * 状态:0.删除 1.编辑中 2.已上架 + */ + 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 String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public BigDecimal getCondition() { + return condition; + } + + public void setCondition(BigDecimal condition) { + this.condition = condition; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public BigDecimal getPercentage() { + return percentage; + } + + public void setPercentage(BigDecimal percentage) { + this.percentage = percentage; + } + + public Integer getLimitNum() { + return limitNum; + } + + public void setLimitNum(Integer limitNum) { + this.limitNum = limitNum; + } + + public Integer getEffectiveDay() { + return effectiveDay; + } + + public void setEffectiveDay(Integer effectiveDay) { + this.effectiveDay = effectiveDay; + } + + public Integer getEffectiveNum() { + return effectiveNum; + } + + public void setEffectiveNum(Integer effectiveNum) { + this.effectiveNum = effectiveNum; + } + + 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 getOpId() { + return opId; + } + + public void setOpId(Long opId) { + this.opId = opId; + } + + public String getOpName() { + return opName; + } + + public void setOpName(String opName) { + this.opName = opName; + } + + 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; + } + CouponDiscount other = (CouponDiscount) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getCondition() == null ? other.getCondition() == null : this.getCondition().equals(other.getCondition())) + && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) + && (this.getPercentage() == null ? other.getPercentage() == null : this.getPercentage().equals(other.getPercentage())) + && (this.getLimitNum() == null ? other.getLimitNum() == null : this.getLimitNum().equals(other.getLimitNum())) + && (this.getEffectiveDay() == null ? other.getEffectiveDay() == null : this.getEffectiveDay().equals(other.getEffectiveDay())) + && (this.getEffectiveNum() == null ? other.getEffectiveNum() == null : this.getEffectiveNum().equals(other.getEffectiveNum())) + && (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.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId())) + && (this.getOpName() == null ? other.getOpName() == null : this.getOpName().equals(other.getOpName())) + && (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 + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getCondition() == null) ? 0 : getCondition().hashCode()); + result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); + result = prime * result + ((getPercentage() == null) ? 0 : getPercentage().hashCode()); + result = prime * result + ((getLimitNum() == null) ? 0 : getLimitNum().hashCode()); + result = prime * result + ((getEffectiveDay() == null) ? 0 : getEffectiveDay().hashCode()); + result = prime * result + ((getEffectiveNum() == null) ? 0 : getEffectiveNum().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 + ((getOpId() == null) ? 0 : getOpId().hashCode()); + result = prime * result + ((getOpName() == null) ? 0 : getOpName().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(", name=").append(name); + sb.append(", img=").append(img); + sb.append(", type=").append(type); + sb.append(", condition=").append(condition); + sb.append(", price=").append(price); + sb.append(", percentage=").append(percentage); + sb.append(", limitNum=").append(limitNum); + sb.append(", effectiveDay=").append(effectiveDay); + sb.append(", effectiveNum=").append(effectiveNum); + sb.append(", salesEndTime=").append(salesEndTime); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", opId=").append(opId); + sb.append(", opName=").append(opName); + 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(); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/CouponDiscountExample.java b/service/src/main/java/com/hfkj/entity/CouponDiscountExample.java new file mode 100644 index 0000000..f30c4b8 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/CouponDiscountExample.java @@ -0,0 +1,1424 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class CouponDiscountExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public CouponDiscountExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andImgIsNull() { + addCriterion("img is null"); + return (Criteria) this; + } + + public Criteria andImgIsNotNull() { + addCriterion("img is not null"); + return (Criteria) this; + } + + public Criteria andImgEqualTo(String value) { + addCriterion("img =", value, "img"); + return (Criteria) this; + } + + public Criteria andImgNotEqualTo(String value) { + addCriterion("img <>", value, "img"); + return (Criteria) this; + } + + public Criteria andImgGreaterThan(String value) { + addCriterion("img >", value, "img"); + return (Criteria) this; + } + + public Criteria andImgGreaterThanOrEqualTo(String value) { + addCriterion("img >=", value, "img"); + return (Criteria) this; + } + + public Criteria andImgLessThan(String value) { + addCriterion("img <", value, "img"); + return (Criteria) this; + } + + public Criteria andImgLessThanOrEqualTo(String value) { + addCriterion("img <=", value, "img"); + return (Criteria) this; + } + + public Criteria andImgLike(String value) { + addCriterion("img like", value, "img"); + return (Criteria) this; + } + + public Criteria andImgNotLike(String value) { + addCriterion("img not like", value, "img"); + return (Criteria) this; + } + + public Criteria andImgIn(List values) { + addCriterion("img in", values, "img"); + return (Criteria) this; + } + + public Criteria andImgNotIn(List values) { + addCriterion("img not in", values, "img"); + return (Criteria) this; + } + + public Criteria andImgBetween(String value1, String value2) { + addCriterion("img between", value1, value2, "img"); + return (Criteria) this; + } + + public Criteria andImgNotBetween(String value1, String value2) { + addCriterion("img not between", value1, value2, "img"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andConditionIsNull() { + addCriterion("`condition` is null"); + return (Criteria) this; + } + + public Criteria andConditionIsNotNull() { + addCriterion("`condition` is not null"); + return (Criteria) this; + } + + public Criteria andConditionEqualTo(BigDecimal value) { + addCriterion("`condition` =", value, "condition"); + return (Criteria) this; + } + + public Criteria andConditionNotEqualTo(BigDecimal value) { + addCriterion("`condition` <>", value, "condition"); + return (Criteria) this; + } + + public Criteria andConditionGreaterThan(BigDecimal value) { + addCriterion("`condition` >", value, "condition"); + return (Criteria) this; + } + + public Criteria andConditionGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("`condition` >=", value, "condition"); + return (Criteria) this; + } + + public Criteria andConditionLessThan(BigDecimal value) { + addCriterion("`condition` <", value, "condition"); + return (Criteria) this; + } + + public Criteria andConditionLessThanOrEqualTo(BigDecimal value) { + addCriterion("`condition` <=", value, "condition"); + return (Criteria) this; + } + + public Criteria andConditionIn(List values) { + addCriterion("`condition` in", values, "condition"); + return (Criteria) this; + } + + public Criteria andConditionNotIn(List values) { + addCriterion("`condition` not in", values, "condition"); + return (Criteria) this; + } + + public Criteria andConditionBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("`condition` between", value1, value2, "condition"); + return (Criteria) this; + } + + public Criteria andConditionNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("`condition` not between", value1, value2, "condition"); + return (Criteria) this; + } + + public Criteria andPriceIsNull() { + addCriterion("price is null"); + return (Criteria) this; + } + + public Criteria andPriceIsNotNull() { + addCriterion("price is not null"); + return (Criteria) this; + } + + public Criteria andPriceEqualTo(BigDecimal value) { + addCriterion("price =", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotEqualTo(BigDecimal value) { + addCriterion("price <>", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThan(BigDecimal value) { + addCriterion("price >", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price >=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThan(BigDecimal value) { + addCriterion("price <", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("price <=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceIn(List values) { + addCriterion("price in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotIn(List values) { + addCriterion("price not in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price not between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andPercentageIsNull() { + addCriterion("percentage is null"); + return (Criteria) this; + } + + public Criteria andPercentageIsNotNull() { + addCriterion("percentage is not null"); + return (Criteria) this; + } + + public Criteria andPercentageEqualTo(BigDecimal value) { + addCriterion("percentage =", value, "percentage"); + return (Criteria) this; + } + + public Criteria andPercentageNotEqualTo(BigDecimal value) { + addCriterion("percentage <>", value, "percentage"); + return (Criteria) this; + } + + public Criteria andPercentageGreaterThan(BigDecimal value) { + addCriterion("percentage >", value, "percentage"); + return (Criteria) this; + } + + public Criteria andPercentageGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("percentage >=", value, "percentage"); + return (Criteria) this; + } + + public Criteria andPercentageLessThan(BigDecimal value) { + addCriterion("percentage <", value, "percentage"); + return (Criteria) this; + } + + public Criteria andPercentageLessThanOrEqualTo(BigDecimal value) { + addCriterion("percentage <=", value, "percentage"); + return (Criteria) this; + } + + public Criteria andPercentageIn(List values) { + addCriterion("percentage in", values, "percentage"); + return (Criteria) this; + } + + public Criteria andPercentageNotIn(List values) { + addCriterion("percentage not in", values, "percentage"); + return (Criteria) this; + } + + public Criteria andPercentageBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("percentage between", value1, value2, "percentage"); + return (Criteria) this; + } + + public Criteria andPercentageNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("percentage not between", value1, value2, "percentage"); + return (Criteria) this; + } + + public Criteria andLimitNumIsNull() { + addCriterion("limit_num is null"); + return (Criteria) this; + } + + public Criteria andLimitNumIsNotNull() { + addCriterion("limit_num is not null"); + return (Criteria) this; + } + + public Criteria andLimitNumEqualTo(Integer value) { + addCriterion("limit_num =", value, "limitNum"); + return (Criteria) this; + } + + public Criteria andLimitNumNotEqualTo(Integer value) { + addCriterion("limit_num <>", value, "limitNum"); + return (Criteria) this; + } + + public Criteria andLimitNumGreaterThan(Integer value) { + addCriterion("limit_num >", value, "limitNum"); + return (Criteria) this; + } + + public Criteria andLimitNumGreaterThanOrEqualTo(Integer value) { + addCriterion("limit_num >=", value, "limitNum"); + return (Criteria) this; + } + + public Criteria andLimitNumLessThan(Integer value) { + addCriterion("limit_num <", value, "limitNum"); + return (Criteria) this; + } + + public Criteria andLimitNumLessThanOrEqualTo(Integer value) { + addCriterion("limit_num <=", value, "limitNum"); + return (Criteria) this; + } + + public Criteria andLimitNumIn(List values) { + addCriterion("limit_num in", values, "limitNum"); + return (Criteria) this; + } + + public Criteria andLimitNumNotIn(List values) { + addCriterion("limit_num not in", values, "limitNum"); + return (Criteria) this; + } + + public Criteria andLimitNumBetween(Integer value1, Integer value2) { + addCriterion("limit_num between", value1, value2, "limitNum"); + return (Criteria) this; + } + + public Criteria andLimitNumNotBetween(Integer value1, Integer value2) { + addCriterion("limit_num not between", value1, value2, "limitNum"); + return (Criteria) this; + } + + public Criteria andEffectiveDayIsNull() { + addCriterion("effective_day is null"); + return (Criteria) this; + } + + public Criteria andEffectiveDayIsNotNull() { + addCriterion("effective_day is not null"); + return (Criteria) this; + } + + public Criteria andEffectiveDayEqualTo(Integer value) { + addCriterion("effective_day =", value, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveDayNotEqualTo(Integer value) { + addCriterion("effective_day <>", value, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveDayGreaterThan(Integer value) { + addCriterion("effective_day >", value, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveDayGreaterThanOrEqualTo(Integer value) { + addCriterion("effective_day >=", value, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveDayLessThan(Integer value) { + addCriterion("effective_day <", value, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveDayLessThanOrEqualTo(Integer value) { + addCriterion("effective_day <=", value, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveDayIn(List values) { + addCriterion("effective_day in", values, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveDayNotIn(List values) { + addCriterion("effective_day not in", values, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveDayBetween(Integer value1, Integer value2) { + addCriterion("effective_day between", value1, value2, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveDayNotBetween(Integer value1, Integer value2) { + addCriterion("effective_day not between", value1, value2, "effectiveDay"); + return (Criteria) this; + } + + public Criteria andEffectiveNumIsNull() { + addCriterion("effective_num is null"); + return (Criteria) this; + } + + public Criteria andEffectiveNumIsNotNull() { + addCriterion("effective_num is not null"); + return (Criteria) this; + } + + public Criteria andEffectiveNumEqualTo(Integer value) { + addCriterion("effective_num =", value, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andEffectiveNumNotEqualTo(Integer value) { + addCriterion("effective_num <>", value, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andEffectiveNumGreaterThan(Integer value) { + addCriterion("effective_num >", value, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andEffectiveNumGreaterThanOrEqualTo(Integer value) { + addCriterion("effective_num >=", value, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andEffectiveNumLessThan(Integer value) { + addCriterion("effective_num <", value, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andEffectiveNumLessThanOrEqualTo(Integer value) { + addCriterion("effective_num <=", value, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andEffectiveNumIn(List values) { + addCriterion("effective_num in", values, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andEffectiveNumNotIn(List values) { + addCriterion("effective_num not in", values, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andEffectiveNumBetween(Integer value1, Integer value2) { + addCriterion("effective_num between", value1, value2, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andEffectiveNumNotBetween(Integer value1, Integer value2) { + addCriterion("effective_num not between", value1, value2, "effectiveNum"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeIsNull() { + addCriterion("sales_end_time is null"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeIsNotNull() { + addCriterion("sales_end_time is not null"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeEqualTo(Date value) { + addCriterion("sales_end_time =", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeNotEqualTo(Date value) { + addCriterion("sales_end_time <>", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeGreaterThan(Date value) { + addCriterion("sales_end_time >", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeGreaterThanOrEqualTo(Date value) { + addCriterion("sales_end_time >=", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeLessThan(Date value) { + addCriterion("sales_end_time <", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeLessThanOrEqualTo(Date value) { + addCriterion("sales_end_time <=", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeIn(List values) { + addCriterion("sales_end_time in", values, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeNotIn(List values) { + addCriterion("sales_end_time not in", values, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeBetween(Date value1, Date value2) { + addCriterion("sales_end_time between", value1, value2, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeNotBetween(Date value1, Date value2) { + addCriterion("sales_end_time not between", value1, value2, "salesEndTime"); + 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 values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List 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 andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andOpIdIsNull() { + addCriterion("op_id is null"); + return (Criteria) this; + } + + public Criteria andOpIdIsNotNull() { + addCriterion("op_id is not null"); + return (Criteria) this; + } + + public Criteria andOpIdEqualTo(Long value) { + addCriterion("op_id =", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotEqualTo(Long value) { + addCriterion("op_id <>", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThan(Long value) { + addCriterion("op_id >", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_id >=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThan(Long value) { + addCriterion("op_id <", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThanOrEqualTo(Long value) { + addCriterion("op_id <=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdIn(List values) { + addCriterion("op_id in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotIn(List values) { + addCriterion("op_id not in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdBetween(Long value1, Long value2) { + addCriterion("op_id between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotBetween(Long value1, Long value2) { + addCriterion("op_id not between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpNameIsNull() { + addCriterion("op_name is null"); + return (Criteria) this; + } + + public Criteria andOpNameIsNotNull() { + addCriterion("op_name is not null"); + return (Criteria) this; + } + + public Criteria andOpNameEqualTo(String value) { + addCriterion("op_name =", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotEqualTo(String value) { + addCriterion("op_name <>", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThan(String value) { + addCriterion("op_name >", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThanOrEqualTo(String value) { + addCriterion("op_name >=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThan(String value) { + addCriterion("op_name <", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThanOrEqualTo(String value) { + addCriterion("op_name <=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLike(String value) { + addCriterion("op_name like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotLike(String value) { + addCriterion("op_name not like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameIn(List values) { + addCriterion("op_name in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotIn(List values) { + addCriterion("op_name not in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameBetween(String value1, String value2) { + addCriterion("op_name between", value1, value2, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotBetween(String value1, String value2) { + addCriterion("op_name not between", value1, value2, "opName"); + 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 values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List 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 values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List 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 values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List 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 values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List 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); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/CouponDiscountGoodsRel.java b/service/src/main/java/com/hfkj/entity/CouponDiscountGoodsRel.java new file mode 100644 index 0000000..196bc44 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/CouponDiscountGoodsRel.java @@ -0,0 +1,168 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * coupon_discount_goods_rel + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class CouponDiscountGoodsRel implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 优惠券id + */ + private Long discountId; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 规格id + */ + private Long specsId; + + /** + * 状态 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 getSpecsId() { + return specsId; + } + + public void setSpecsId(Long specsId) { + this.specsId = specsId; + } + + 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; + } + CouponDiscountGoodsRel other = (CouponDiscountGoodsRel) 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.getSpecsId() == null ? other.getSpecsId() == null : this.getSpecsId().equals(other.getSpecsId())) + && (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 + ((getSpecsId() == null) ? 0 : getSpecsId().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(", specsId=").append(specsId); + 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(); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/CouponDiscountGoodsRelExample.java b/service/src/main/java/com/hfkj/entity/CouponDiscountGoodsRelExample.java new file mode 100644 index 0000000..6be7607 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/CouponDiscountGoodsRelExample.java @@ -0,0 +1,733 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class CouponDiscountGoodsRelExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public CouponDiscountGoodsRelExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 values) { + addCriterion("discount_id in", values, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotIn(List 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 values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List 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 andSpecsIdIsNull() { + addCriterion("specs_id is null"); + return (Criteria) this; + } + + public Criteria andSpecsIdIsNotNull() { + addCriterion("specs_id is not null"); + return (Criteria) this; + } + + public Criteria andSpecsIdEqualTo(Long value) { + addCriterion("specs_id =", value, "specsId"); + return (Criteria) this; + } + + public Criteria andSpecsIdNotEqualTo(Long value) { + addCriterion("specs_id <>", value, "specsId"); + return (Criteria) this; + } + + public Criteria andSpecsIdGreaterThan(Long value) { + addCriterion("specs_id >", value, "specsId"); + return (Criteria) this; + } + + public Criteria andSpecsIdGreaterThanOrEqualTo(Long value) { + addCriterion("specs_id >=", value, "specsId"); + return (Criteria) this; + } + + public Criteria andSpecsIdLessThan(Long value) { + addCriterion("specs_id <", value, "specsId"); + return (Criteria) this; + } + + public Criteria andSpecsIdLessThanOrEqualTo(Long value) { + addCriterion("specs_id <=", value, "specsId"); + return (Criteria) this; + } + + public Criteria andSpecsIdIn(List values) { + addCriterion("specs_id in", values, "specsId"); + return (Criteria) this; + } + + public Criteria andSpecsIdNotIn(List values) { + addCriterion("specs_id not in", values, "specsId"); + return (Criteria) this; + } + + public Criteria andSpecsIdBetween(Long value1, Long value2) { + addCriterion("specs_id between", value1, value2, "specsId"); + return (Criteria) this; + } + + public Criteria andSpecsIdNotBetween(Long value1, Long value2) { + addCriterion("specs_id not between", value1, value2, "specsId"); + 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 values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List 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 values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List 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 values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List 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 values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List 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); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/GoodsMsg.java b/service/src/main/java/com/hfkj/entity/GoodsMsg.java index aa5d5bd..f4c5e2b 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsMsg.java +++ b/service/src/main/java/com/hfkj/entity/GoodsMsg.java @@ -28,6 +28,11 @@ public class GoodsMsg implements Serializable { */ private Long goodsType; + /** + * 销量 + */ + private Integer saleNum; + /** * 类型:1.实物商品 2.虚拟商品 */ @@ -139,6 +144,14 @@ public class GoodsMsg implements Serializable { this.goodsType = goodsType; } + public Integer getSaleNum() { + return saleNum; + } + + public void setSaleNum(Integer saleNum) { + this.saleNum = saleNum; + } + public Integer getType() { return type; } @@ -290,6 +303,7 @@ public class GoodsMsg implements Serializable { return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getGoodsTypeName() == null ? other.getGoodsTypeName() == null : this.getGoodsTypeName().equals(other.getGoodsTypeName())) && (this.getGoodsType() == null ? other.getGoodsType() == null : this.getGoodsType().equals(other.getGoodsType())) + && (this.getSaleNum() == null ? other.getSaleNum() == null : this.getSaleNum().equals(other.getSaleNum())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getGoodsBrandName() == null ? other.getGoodsBrandName() == null : this.getGoodsBrandName().equals(other.getGoodsBrandName())) && (this.getGoodsBrand() == null ? other.getGoodsBrand() == null : this.getGoodsBrand().equals(other.getGoodsBrand())) @@ -316,6 +330,7 @@ public class GoodsMsg implements Serializable { result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getGoodsTypeName() == null) ? 0 : getGoodsTypeName().hashCode()); result = prime * result + ((getGoodsType() == null) ? 0 : getGoodsType().hashCode()); + result = prime * result + ((getSaleNum() == null) ? 0 : getSaleNum().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getGoodsBrandName() == null) ? 0 : getGoodsBrandName().hashCode()); result = prime * result + ((getGoodsBrand() == null) ? 0 : getGoodsBrand().hashCode()); @@ -345,6 +360,7 @@ public class GoodsMsg implements Serializable { sb.append(", id=").append(id); sb.append(", goodsTypeName=").append(goodsTypeName); sb.append(", goodsType=").append(goodsType); + sb.append(", saleNum=").append(saleNum); sb.append(", type=").append(type); sb.append(", goodsBrandName=").append(goodsBrandName); sb.append(", goodsBrand=").append(goodsBrand); diff --git a/service/src/main/java/com/hfkj/entity/GoodsMsgExample.java b/service/src/main/java/com/hfkj/entity/GoodsMsgExample.java index a58db62..6cfb085 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsMsgExample.java +++ b/service/src/main/java/com/hfkj/entity/GoodsMsgExample.java @@ -315,6 +315,66 @@ public class GoodsMsgExample { return (Criteria) this; } + public Criteria andSaleNumIsNull() { + addCriterion("sale_num is null"); + return (Criteria) this; + } + + public Criteria andSaleNumIsNotNull() { + addCriterion("sale_num is not null"); + return (Criteria) this; + } + + public Criteria andSaleNumEqualTo(Integer value) { + addCriterion("sale_num =", value, "saleNum"); + return (Criteria) this; + } + + public Criteria andSaleNumNotEqualTo(Integer value) { + addCriterion("sale_num <>", value, "saleNum"); + return (Criteria) this; + } + + public Criteria andSaleNumGreaterThan(Integer value) { + addCriterion("sale_num >", value, "saleNum"); + return (Criteria) this; + } + + public Criteria andSaleNumGreaterThanOrEqualTo(Integer value) { + addCriterion("sale_num >=", value, "saleNum"); + return (Criteria) this; + } + + public Criteria andSaleNumLessThan(Integer value) { + addCriterion("sale_num <", value, "saleNum"); + return (Criteria) this; + } + + public Criteria andSaleNumLessThanOrEqualTo(Integer value) { + addCriterion("sale_num <=", value, "saleNum"); + return (Criteria) this; + } + + public Criteria andSaleNumIn(List values) { + addCriterion("sale_num in", values, "saleNum"); + return (Criteria) this; + } + + public Criteria andSaleNumNotIn(List values) { + addCriterion("sale_num not in", values, "saleNum"); + return (Criteria) this; + } + + public Criteria andSaleNumBetween(Integer value1, Integer value2) { + addCriterion("sale_num between", value1, value2, "saleNum"); + return (Criteria) this; + } + + public Criteria andSaleNumNotBetween(Integer value1, Integer value2) { + addCriterion("sale_num not between", value1, value2, "saleNum"); + return (Criteria) this; + } + public Criteria andTypeIsNull() { addCriterion("`type` is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/entity/GoodsSpecs.java b/service/src/main/java/com/hfkj/entity/GoodsSpecs.java index ebe10b1..24ba80d 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsSpecs.java +++ b/service/src/main/java/com/hfkj/entity/GoodsSpecs.java @@ -55,9 +55,9 @@ public class GoodsSpecs implements Serializable { private String showImg; /** - * 轮播图 + * 销售截止日期 */ - private String bannerImg; + private Date salesEndTime; /** * 状态:0:删除 1:正常 @@ -155,12 +155,12 @@ public class GoodsSpecs implements Serializable { this.showImg = showImg; } - public String getBannerImg() { - return bannerImg; + public Date getSalesEndTime() { + return salesEndTime; } - public void setBannerImg(String bannerImg) { - this.bannerImg = bannerImg; + public void setSalesEndTime(Date salesEndTime) { + this.salesEndTime = salesEndTime; } public Integer getStatus() { @@ -231,7 +231,7 @@ public class GoodsSpecs implements Serializable { && (this.getOriginalPrice() == null ? other.getOriginalPrice() == null : this.getOriginalPrice().equals(other.getOriginalPrice())) && (this.getStock() == null ? other.getStock() == null : this.getStock().equals(other.getStock())) && (this.getShowImg() == null ? other.getShowImg() == null : this.getShowImg().equals(other.getShowImg())) - && (this.getBannerImg() == null ? other.getBannerImg() == null : this.getBannerImg().equals(other.getBannerImg())) + && (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) @@ -252,7 +252,7 @@ public class GoodsSpecs implements Serializable { result = prime * result + ((getOriginalPrice() == null) ? 0 : getOriginalPrice().hashCode()); result = prime * result + ((getStock() == null) ? 0 : getStock().hashCode()); result = prime * result + ((getShowImg() == null) ? 0 : getShowImg().hashCode()); - result = prime * result + ((getBannerImg() == null) ? 0 : getBannerImg().hashCode()); + result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); @@ -276,7 +276,7 @@ public class GoodsSpecs implements Serializable { sb.append(", originalPrice=").append(originalPrice); sb.append(", stock=").append(stock); sb.append(", showImg=").append(showImg); - sb.append(", bannerImg=").append(bannerImg); + sb.append(", salesEndTime=").append(salesEndTime); sb.append(", status=").append(status); sb.append(", createTime=").append(createTime); sb.append(", updateTime=").append(updateTime); @@ -287,4 +287,4 @@ public class GoodsSpecs implements Serializable { sb.append("]"); return sb.toString(); } -} \ No newline at end of file +} diff --git a/service/src/main/java/com/hfkj/entity/GoodsSpecsExample.java b/service/src/main/java/com/hfkj/entity/GoodsSpecsExample.java index 52f7f79..921fbbd 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsSpecsExample.java +++ b/service/src/main/java/com/hfkj/entity/GoodsSpecsExample.java @@ -626,73 +626,63 @@ public class GoodsSpecsExample { return (Criteria) this; } - public Criteria andBannerImgIsNull() { - addCriterion("banner_img is null"); + public Criteria andSalesEndTimeIsNull() { + addCriterion("sales_end_time is null"); return (Criteria) this; } - public Criteria andBannerImgIsNotNull() { - addCriterion("banner_img is not null"); + public Criteria andSalesEndTimeIsNotNull() { + addCriterion("sales_end_time is not null"); return (Criteria) this; } - public Criteria andBannerImgEqualTo(String value) { - addCriterion("banner_img =", value, "bannerImg"); + public Criteria andSalesEndTimeEqualTo(Date value) { + addCriterion("sales_end_time =", value, "salesEndTime"); return (Criteria) this; } - public Criteria andBannerImgNotEqualTo(String value) { - addCriterion("banner_img <>", value, "bannerImg"); + public Criteria andSalesEndTimeNotEqualTo(Date value) { + addCriterion("sales_end_time <>", value, "salesEndTime"); return (Criteria) this; } - public Criteria andBannerImgGreaterThan(String value) { - addCriterion("banner_img >", value, "bannerImg"); + public Criteria andSalesEndTimeGreaterThan(Date value) { + addCriterion("sales_end_time >", value, "salesEndTime"); return (Criteria) this; } - public Criteria andBannerImgGreaterThanOrEqualTo(String value) { - addCriterion("banner_img >=", value, "bannerImg"); + public Criteria andSalesEndTimeGreaterThanOrEqualTo(Date value) { + addCriterion("sales_end_time >=", value, "salesEndTime"); return (Criteria) this; } - public Criteria andBannerImgLessThan(String value) { - addCriterion("banner_img <", value, "bannerImg"); + public Criteria andSalesEndTimeLessThan(Date value) { + addCriterion("sales_end_time <", value, "salesEndTime"); return (Criteria) this; } - public Criteria andBannerImgLessThanOrEqualTo(String value) { - addCriterion("banner_img <=", value, "bannerImg"); + public Criteria andSalesEndTimeLessThanOrEqualTo(Date value) { + addCriterion("sales_end_time <=", value, "salesEndTime"); return (Criteria) this; } - public Criteria andBannerImgLike(String value) { - addCriterion("banner_img like", value, "bannerImg"); + public Criteria andSalesEndTimeIn(List values) { + addCriterion("sales_end_time in", values, "salesEndTime"); return (Criteria) this; } - public Criteria andBannerImgNotLike(String value) { - addCriterion("banner_img not like", value, "bannerImg"); + public Criteria andSalesEndTimeNotIn(List values) { + addCriterion("sales_end_time not in", values, "salesEndTime"); return (Criteria) this; } - public Criteria andBannerImgIn(List values) { - addCriterion("banner_img in", values, "bannerImg"); + public Criteria andSalesEndTimeBetween(Date value1, Date value2) { + addCriterion("sales_end_time between", value1, value2, "salesEndTime"); return (Criteria) this; } - public Criteria andBannerImgNotIn(List values) { - addCriterion("banner_img not in", values, "bannerImg"); - return (Criteria) this; - } - - public Criteria andBannerImgBetween(String value1, String value2) { - addCriterion("banner_img between", value1, value2, "bannerImg"); - return (Criteria) this; - } - - public Criteria andBannerImgNotBetween(String value1, String value2) { - addCriterion("banner_img not between", value1, value2, "bannerImg"); + public Criteria andSalesEndTimeNotBetween(Date value1, Date value2) { + addCriterion("sales_end_time not between", value1, value2, "salesEndTime"); return (Criteria) this; } @@ -1181,4 +1171,4 @@ public class GoodsSpecsExample { this(condition, value, secondValue, null); } } -} \ No newline at end of file +} diff --git a/service/src/main/java/com/hfkj/entity/GoodsVpd.java b/service/src/main/java/com/hfkj/entity/GoodsVpd.java index 83bc6f6..4dde190 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsVpd.java +++ b/service/src/main/java/com/hfkj/entity/GoodsVpd.java @@ -31,12 +31,7 @@ public class GoodsVpd implements Serializable { /** * 归库天数 */ - private Integer recycleDay; - - /** - * 销售截止日期 - */ - private Date salesEndTime; + private Integer validDay; /** * 类型 1:内部虚拟商品 2:外部虚拟产品 @@ -53,6 +48,11 @@ public class GoodsVpd implements Serializable { */ private Integer jumpType; + /** + * 销售截止日期 + */ + private Date salesEndTime; + /** * 跳转地址 */ @@ -61,7 +61,7 @@ public class GoodsVpd implements Serializable { /** * 应用ID */ - private String appidId; + private String appid; /** * 创建时间 @@ -105,20 +105,12 @@ public class GoodsVpd implements Serializable { this.key = key; } - public Integer getRecycleDay() { - return recycleDay; - } - - public void setRecycleDay(Integer recycleDay) { - this.recycleDay = recycleDay; - } - - public Date getSalesEndTime() { - return salesEndTime; + public Integer getValidDay() { + return validDay; } - public void setSalesEndTime(Date salesEndTime) { - this.salesEndTime = salesEndTime; + public void setValidDay(Integer validDay) { + this.validDay = validDay; } public Integer getType() { @@ -145,6 +137,14 @@ public class GoodsVpd implements Serializable { this.jumpType = jumpType; } + public Date getSalesEndTime() { + return salesEndTime; + } + + public void setSalesEndTime(Date salesEndTime) { + this.salesEndTime = salesEndTime; + } + public String getJumpUrl() { return jumpUrl; } @@ -153,12 +153,12 @@ public class GoodsVpd implements Serializable { this.jumpUrl = jumpUrl; } - public String getAppidId() { - return appidId; + public String getAppid() { + return appid; } - public void setAppidId(String appidId) { - this.appidId = appidId; + public void setAppid(String appid) { + this.appid = appid; } public Date getCreateTime() { @@ -216,13 +216,13 @@ public class GoodsVpd implements Serializable { return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getSpecsId() == null ? other.getSpecsId() == null : this.getSpecsId().equals(other.getSpecsId())) && (this.getKey() == null ? other.getKey() == null : this.getKey().equals(other.getKey())) - && (this.getRecycleDay() == null ? other.getRecycleDay() == null : this.getRecycleDay().equals(other.getRecycleDay())) - && (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime())) + && (this.getValidDay() == null ? other.getValidDay() == null : this.getValidDay().equals(other.getValidDay())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource())) && (this.getJumpType() == null ? other.getJumpType() == null : this.getJumpType().equals(other.getJumpType())) + && (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime())) && (this.getJumpUrl() == null ? other.getJumpUrl() == null : this.getJumpUrl().equals(other.getJumpUrl())) - && (this.getAppidId() == null ? other.getAppidId() == null : this.getAppidId().equals(other.getAppidId())) + && (this.getAppid() == null ? other.getAppid() == null : this.getAppid().equals(other.getAppid())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) @@ -237,13 +237,13 @@ public class GoodsVpd implements Serializable { result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getSpecsId() == null) ? 0 : getSpecsId().hashCode()); result = prime * result + ((getKey() == null) ? 0 : getKey().hashCode()); - result = prime * result + ((getRecycleDay() == null) ? 0 : getRecycleDay().hashCode()); - result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode()); + result = prime * result + ((getValidDay() == null) ? 0 : getValidDay().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode()); result = prime * result + ((getJumpType() == null) ? 0 : getJumpType().hashCode()); + result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode()); result = prime * result + ((getJumpUrl() == null) ? 0 : getJumpUrl().hashCode()); - result = prime * result + ((getAppidId() == null) ? 0 : getAppidId().hashCode()); + result = prime * result + ((getAppid() == null) ? 0 : getAppid().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); @@ -261,13 +261,13 @@ public class GoodsVpd implements Serializable { sb.append(", id=").append(id); sb.append(", specsId=").append(specsId); sb.append(", key=").append(key); - sb.append(", recycleDay=").append(recycleDay); - sb.append(", salesEndTime=").append(salesEndTime); + sb.append(", validDay=").append(validDay); sb.append(", type=").append(type); sb.append(", source=").append(source); sb.append(", jumpType=").append(jumpType); + sb.append(", salesEndTime=").append(salesEndTime); sb.append(", jumpUrl=").append(jumpUrl); - sb.append(", appidId=").append(appidId); + sb.append(", appid=").append(appid); sb.append(", createTime=").append(createTime); sb.append(", updateTime=").append(updateTime); sb.append(", ext1=").append(ext1); @@ -277,4 +277,4 @@ public class GoodsVpd implements Serializable { sb.append("]"); return sb.toString(); } -} \ No newline at end of file +} diff --git a/service/src/main/java/com/hfkj/entity/GoodsVpdExample.java b/service/src/main/java/com/hfkj/entity/GoodsVpdExample.java index c2c3b1c..54e79e4 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsVpdExample.java +++ b/service/src/main/java/com/hfkj/entity/GoodsVpdExample.java @@ -315,123 +315,63 @@ public class GoodsVpdExample { return (Criteria) this; } - public Criteria andRecycleDayIsNull() { - addCriterion("recycle_day is null"); + public Criteria andValidDayIsNull() { + addCriterion("valid_day is null"); return (Criteria) this; } - public Criteria andRecycleDayIsNotNull() { - addCriterion("recycle_day is not null"); + public Criteria andValidDayIsNotNull() { + addCriterion("valid_day is not null"); return (Criteria) this; } - public Criteria andRecycleDayEqualTo(Integer value) { - addCriterion("recycle_day =", value, "recycleDay"); + public Criteria andValidDayEqualTo(Integer value) { + addCriterion("valid_day =", value, "validDay"); return (Criteria) this; } - public Criteria andRecycleDayNotEqualTo(Integer value) { - addCriterion("recycle_day <>", value, "recycleDay"); + public Criteria andValidDayNotEqualTo(Integer value) { + addCriterion("valid_day <>", value, "validDay"); return (Criteria) this; } - public Criteria andRecycleDayGreaterThan(Integer value) { - addCriterion("recycle_day >", value, "recycleDay"); + public Criteria andValidDayGreaterThan(Integer value) { + addCriterion("valid_day >", value, "validDay"); return (Criteria) this; } - public Criteria andRecycleDayGreaterThanOrEqualTo(Integer value) { - addCriterion("recycle_day >=", value, "recycleDay"); + public Criteria andValidDayGreaterThanOrEqualTo(Integer value) { + addCriterion("valid_day >=", value, "validDay"); return (Criteria) this; } - public Criteria andRecycleDayLessThan(Integer value) { - addCriterion("recycle_day <", value, "recycleDay"); + public Criteria andValidDayLessThan(Integer value) { + addCriterion("valid_day <", value, "validDay"); return (Criteria) this; } - public Criteria andRecycleDayLessThanOrEqualTo(Integer value) { - addCriterion("recycle_day <=", value, "recycleDay"); + public Criteria andValidDayLessThanOrEqualTo(Integer value) { + addCriterion("valid_day <=", value, "validDay"); return (Criteria) this; } - public Criteria andRecycleDayIn(List values) { - addCriterion("recycle_day in", values, "recycleDay"); + public Criteria andValidDayIn(List values) { + addCriterion("valid_day in", values, "validDay"); return (Criteria) this; } - public Criteria andRecycleDayNotIn(List values) { - addCriterion("recycle_day not in", values, "recycleDay"); + public Criteria andValidDayNotIn(List values) { + addCriterion("valid_day not in", values, "validDay"); return (Criteria) this; } - public Criteria andRecycleDayBetween(Integer value1, Integer value2) { - addCriterion("recycle_day between", value1, value2, "recycleDay"); + public Criteria andValidDayBetween(Integer value1, Integer value2) { + addCriterion("valid_day between", value1, value2, "validDay"); return (Criteria) this; } - public Criteria andRecycleDayNotBetween(Integer value1, Integer value2) { - addCriterion("recycle_day not between", value1, value2, "recycleDay"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeIsNull() { - addCriterion("sales_end_time is null"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeIsNotNull() { - addCriterion("sales_end_time is not null"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeEqualTo(Date value) { - addCriterion("sales_end_time =", value, "salesEndTime"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeNotEqualTo(Date value) { - addCriterion("sales_end_time <>", value, "salesEndTime"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeGreaterThan(Date value) { - addCriterion("sales_end_time >", value, "salesEndTime"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeGreaterThanOrEqualTo(Date value) { - addCriterion("sales_end_time >=", value, "salesEndTime"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeLessThan(Date value) { - addCriterion("sales_end_time <", value, "salesEndTime"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeLessThanOrEqualTo(Date value) { - addCriterion("sales_end_time <=", value, "salesEndTime"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeIn(List values) { - addCriterion("sales_end_time in", values, "salesEndTime"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeNotIn(List values) { - addCriterion("sales_end_time not in", values, "salesEndTime"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeBetween(Date value1, Date value2) { - addCriterion("sales_end_time between", value1, value2, "salesEndTime"); - return (Criteria) this; - } - - public Criteria andSalesEndTimeNotBetween(Date value1, Date value2) { - addCriterion("sales_end_time not between", value1, value2, "salesEndTime"); + public Criteria andValidDayNotBetween(Integer value1, Integer value2) { + addCriterion("valid_day not between", value1, value2, "validDay"); return (Criteria) this; } @@ -615,6 +555,66 @@ public class GoodsVpdExample { return (Criteria) this; } + public Criteria andSalesEndTimeIsNull() { + addCriterion("sales_end_time is null"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeIsNotNull() { + addCriterion("sales_end_time is not null"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeEqualTo(Date value) { + addCriterion("sales_end_time =", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeNotEqualTo(Date value) { + addCriterion("sales_end_time <>", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeGreaterThan(Date value) { + addCriterion("sales_end_time >", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeGreaterThanOrEqualTo(Date value) { + addCriterion("sales_end_time >=", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeLessThan(Date value) { + addCriterion("sales_end_time <", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeLessThanOrEqualTo(Date value) { + addCriterion("sales_end_time <=", value, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeIn(List values) { + addCriterion("sales_end_time in", values, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeNotIn(List values) { + addCriterion("sales_end_time not in", values, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeBetween(Date value1, Date value2) { + addCriterion("sales_end_time between", value1, value2, "salesEndTime"); + return (Criteria) this; + } + + public Criteria andSalesEndTimeNotBetween(Date value1, Date value2) { + addCriterion("sales_end_time not between", value1, value2, "salesEndTime"); + return (Criteria) this; + } + public Criteria andJumpUrlIsNull() { addCriterion("jump_url is null"); return (Criteria) this; @@ -685,73 +685,73 @@ public class GoodsVpdExample { return (Criteria) this; } - public Criteria andAppidIdIsNull() { - addCriterion("appid_id is null"); + public Criteria andAppidIsNull() { + addCriterion("appid is null"); return (Criteria) this; } - public Criteria andAppidIdIsNotNull() { - addCriterion("appid_id is not null"); + public Criteria andAppidIsNotNull() { + addCriterion("appid is not null"); return (Criteria) this; } - public Criteria andAppidIdEqualTo(String value) { - addCriterion("appid_id =", value, "appidId"); + public Criteria andAppidEqualTo(String value) { + addCriterion("appid =", value, "appid"); return (Criteria) this; } - public Criteria andAppidIdNotEqualTo(String value) { - addCriterion("appid_id <>", value, "appidId"); + public Criteria andAppidNotEqualTo(String value) { + addCriterion("appid <>", value, "appid"); return (Criteria) this; } - public Criteria andAppidIdGreaterThan(String value) { - addCriterion("appid_id >", value, "appidId"); + public Criteria andAppidGreaterThan(String value) { + addCriterion("appid >", value, "appid"); return (Criteria) this; } - public Criteria andAppidIdGreaterThanOrEqualTo(String value) { - addCriterion("appid_id >=", value, "appidId"); + public Criteria andAppidGreaterThanOrEqualTo(String value) { + addCriterion("appid >=", value, "appid"); return (Criteria) this; } - public Criteria andAppidIdLessThan(String value) { - addCriterion("appid_id <", value, "appidId"); + public Criteria andAppidLessThan(String value) { + addCriterion("appid <", value, "appid"); return (Criteria) this; } - public Criteria andAppidIdLessThanOrEqualTo(String value) { - addCriterion("appid_id <=", value, "appidId"); + public Criteria andAppidLessThanOrEqualTo(String value) { + addCriterion("appid <=", value, "appid"); return (Criteria) this; } - public Criteria andAppidIdLike(String value) { - addCriterion("appid_id like", value, "appidId"); + public Criteria andAppidLike(String value) { + addCriterion("appid like", value, "appid"); return (Criteria) this; } - public Criteria andAppidIdNotLike(String value) { - addCriterion("appid_id not like", value, "appidId"); + public Criteria andAppidNotLike(String value) { + addCriterion("appid not like", value, "appid"); return (Criteria) this; } - public Criteria andAppidIdIn(List values) { - addCriterion("appid_id in", values, "appidId"); + public Criteria andAppidIn(List values) { + addCriterion("appid in", values, "appid"); return (Criteria) this; } - public Criteria andAppidIdNotIn(List values) { - addCriterion("appid_id not in", values, "appidId"); + public Criteria andAppidNotIn(List values) { + addCriterion("appid not in", values, "appid"); return (Criteria) this; } - public Criteria andAppidIdBetween(String value1, String value2) { - addCriterion("appid_id between", value1, value2, "appidId"); + public Criteria andAppidBetween(String value1, String value2) { + addCriterion("appid between", value1, value2, "appid"); return (Criteria) this; } - public Criteria andAppidIdNotBetween(String value1, String value2) { - addCriterion("appid_id not between", value1, value2, "appidId"); + public Criteria andAppidNotBetween(String value1, String value2) { + addCriterion("appid not between", value1, value2, "appid"); return (Criteria) this; } @@ -1180,4 +1180,4 @@ public class GoodsVpdExample { this(condition, value, secondValue, null); } } -} \ No newline at end of file +} diff --git a/service/src/main/java/com/hfkj/model/discount/DiscountGoodsModel.java b/service/src/main/java/com/hfkj/model/discount/DiscountGoodsModel.java new file mode 100644 index 0000000..a8b5bd4 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/discount/DiscountGoodsModel.java @@ -0,0 +1,26 @@ +package com.hfkj.model.discount; + +import com.hfkj.entity.CouponDiscountGoodsRel; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DiscountGoodsModel extends CouponDiscountGoodsRel { + + /** + * 商品名称 + */ + private String goodsName; + + /** + * sku名称 + */ + private String SpecsName; + + /** + * 售价 + */ + private BigDecimal salePrice; + +} diff --git a/service/src/main/java/com/hfkj/model/goods/GoodsModel.java b/service/src/main/java/com/hfkj/model/goods/GoodsModel.java index 64f5bfc..d7238a2 100644 --- a/service/src/main/java/com/hfkj/model/goods/GoodsModel.java +++ b/service/src/main/java/com/hfkj/model/goods/GoodsModel.java @@ -4,10 +4,15 @@ import com.hfkj.entity.GoodsMsg; import com.hfkj.entity.GoodsSpecs; import lombok.Data; +import java.math.BigDecimal; import java.util.List; @Data public class GoodsModel extends GoodsMsg { + private BigDecimal price; + + private BigDecimal originalPrice; + List goodsModelSpecs; } diff --git a/service/src/main/java/com/hfkj/model/goods/GoodsModelSpecs.java b/service/src/main/java/com/hfkj/model/goods/GoodsModelSpecs.java index 5c0cef0..b03b161 100644 --- a/service/src/main/java/com/hfkj/model/goods/GoodsModelSpecs.java +++ b/service/src/main/java/com/hfkj/model/goods/GoodsModelSpecs.java @@ -9,7 +9,10 @@ import java.util.Date; @Data public class GoodsModelSpecs extends GoodsSpecs { - GoodsMsg goodsMsg; + /** + * 商品名称 + */ + private String goodsName; /** * 商品规格id @@ -22,9 +25,9 @@ public class GoodsModelSpecs extends GoodsSpecs { private String key; /** - * 归库天数 + * 有效天数 */ - private Integer recycleDay; + private Integer validDay; /** * 销售截止日期 @@ -54,5 +57,5 @@ public class GoodsModelSpecs extends GoodsSpecs { /** * 应用ID */ - private String appidId; + private String appid; } diff --git a/service/src/main/java/com/hfkj/service/discount/CouponDiscountService.java b/service/src/main/java/com/hfkj/service/discount/CouponDiscountService.java new file mode 100644 index 0000000..9e52dce --- /dev/null +++ b/service/src/main/java/com/hfkj/service/discount/CouponDiscountService.java @@ -0,0 +1,118 @@ +package com.hfkj.service.discount; + +import com.hfkj.entity.CouponDiscount; +import com.hfkj.entity.CouponDiscountGoodsRel; + +import java.util.List; +import java.util.Map; + +/** + * @serviceName CouponDiscountService.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 优惠券管理 + * @createTime 15:07 2024/4/19 + **/ +public interface CouponDiscountService { + + /** + * @Author Sum1Dream + * @Name create + * @Description // 创建 + * @Date 15:11 2024/4/19 + * @Param CouponDiscount + * @return void + */ + void create(CouponDiscount couponDiscount); + + /** + * @Author Sum1Dream + * @Name update + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param CouponDiscount + * @return void + */ + void update(CouponDiscount couponDiscount); + + /** + * @Author Sum1Dream + * @Name delete + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param id + * @return void + */ + void delete(Long id , Boolean fullDelete); + + /** + * @Author Sum1Dream + * @Name queryDetail + * @Description // 根据ID查询详情 + * @Date 15:12 2024/4/19 + * @Param id + * @return com.hfkj.entity.CouponDiscount + */ + CouponDiscount queryDetail(Long id); + + /** + * @Author Sum1Dream + * @Name queryDetailByMap + * @Description // 根据多条件查询 + * @Date 15:12 2024/4/19 + * @Param map + * @return com.hfkj.entity.CouponDiscount + */ + CouponDiscount queryDetailByMap(Map map); + + /** + * @Author Sum1Dream + * @Name getList + * @Description // 根据多条件查询列表 + * @Date 15:13 2024/4/19 + * @Param map + * @return java.util.List + */ + List getList(Map map); + + /** + * @Author Sum1Dream + * @Name getListGoodsRel + * @Description // 根据多条件查询列表 + * @Date 15:13 2024/4/19 + * @Param map + * @return java.util.List + */ + List getListGoodsRel(Map map); + + /** + * @Author Sum1Dream + * @Name create + * @Description // 创建 + * @Date 15:11 2024/4/19 + * @Param createGoodsRel + * @return void + */ + void createGoodsRel(CouponDiscountGoodsRel couponDiscountGoodsRel); + + /** + * @Author Sum1Dream + * @Name deleteDiscountGoodsRel + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param id + * @return void + */ + void deleteDiscountGoodsRel(Long id); + + /** + * @Author Sum1Dream + * @Name deleteDiscountGoodsRelDiscountId + * @Description // 修改 + * @Date 15:12 2024/4/19 + * @Param id + * @return void + */ + void deleteDiscountGoodsRelDiscountId(Long discountId); + +} diff --git a/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountServiceImpl.java b/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountServiceImpl.java new file mode 100644 index 0000000..9cc2a91 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountServiceImpl.java @@ -0,0 +1,107 @@ +package com.hfkj.service.discount.impl; + +import com.hfkj.dao.CouponDiscountGoodsRelMapper; +import com.hfkj.dao.CouponDiscountMapper; +import com.hfkj.entity.*; +import com.hfkj.service.discount.CouponDiscountService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("couponDiscountService") +public class CouponDiscountServiceImpl implements CouponDiscountService { + + @Resource + private CouponDiscountMapper couponDiscountMapper; + + @Resource + private CouponDiscountGoodsRelMapper couponDiscountGoodsRelMapper; + + @Override + public void create(CouponDiscount couponDiscount) { + couponDiscountMapper.insert(couponDiscount); + } + + @Override + public void update(CouponDiscount couponDiscount) { + couponDiscountMapper.updateByPrimaryKeySelective(couponDiscount); + } + + @Override + public void delete(Long id, Boolean fullDelete) { + if (fullDelete) { + couponDiscountMapper.deleteByPrimaryKey(id); + } else { + CouponDiscount couponDiscount = queryDetail(id); + couponDiscount.setStatus(0); + couponDiscount.setUpdateTime(new Date()); + update(couponDiscount); + } + } + + @Override + public CouponDiscount queryDetail(Long id) { + return couponDiscountMapper.selectByPrimaryKey(id); + } + + @Override + public CouponDiscount queryDetailByMap(Map map) { + return null; + } + + @Override + public List getList(Map map) { + + CouponDiscountExample example = new CouponDiscountExample(); + CouponDiscountExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); + } + if (StringUtils.isNotBlank(MapUtils.getString(map, "name"))) { + criteria.andNameLike("%"+MapUtils.getString(map, "name")+"%"); + } + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } else { + criteria.andStatusNotEqualTo(0); + } + + return couponDiscountMapper.selectByExample(example); + } + + @Override + public List getListGoodsRel(Map map) { + CouponDiscountGoodsRelExample example = new CouponDiscountGoodsRelExample(); + CouponDiscountGoodsRelExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(map, "discountId") != null) { + criteria.andDiscountIdEqualTo(MapUtils.getLong(map, "discountId")); + } + + return couponDiscountGoodsRelMapper.selectByExample(example); + } + + @Override + public void createGoodsRel(CouponDiscountGoodsRel couponDiscountGoodsRel) { + couponDiscountGoodsRelMapper.insert(couponDiscountGoodsRel); + } + + @Override + public void deleteDiscountGoodsRel(Long id) { + couponDiscountGoodsRelMapper.deleteByPrimaryKey(id); + } + + @Override + public void deleteDiscountGoodsRelDiscountId(Long discountId) { + CouponDiscountGoodsRelExample example = new CouponDiscountGoodsRelExample(); + example.createCriteria().andDiscountIdEqualTo(discountId); + couponDiscountGoodsRelMapper.deleteByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/goods/GoodsBrandService.java b/service/src/main/java/com/hfkj/service/goods/GoodsBrandService.java index 6c9dbba..355c37a 100644 --- a/service/src/main/java/com/hfkj/service/goods/GoodsBrandService.java +++ b/service/src/main/java/com/hfkj/service/goods/GoodsBrandService.java @@ -74,6 +74,14 @@ public interface GoodsBrandService { */ List getList(Map map); + /** + * @Author Sum1Dream + * @Name findGoodsBrandName + * @Description // 根据id查询商品品牌 + * @Date 15:13 2024/4/19 + * @Param map + * @return java.util.List + */ String findGoodsBrandName(Long id); } diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java index 4eb49db..276a7a5 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java @@ -67,6 +67,9 @@ public class GoodsMsgServiceImpl implements GoodsMsgService { if (MapUtils.getLong(map, "goodsBrand") != null) { criteria.andGoodsBrandEqualTo(MapUtils.getLong(map, "goodsBrand")); } + if (MapUtils.getLong(map, "merId") != null) { + criteria.andMerIdEqualTo(MapUtils.getLong(map, "merId")); + } if (StringUtils.isNotBlank(MapUtils.getString(map, "title"))) { criteria.andTitleLike("%"+MapUtils.getString(map, "title")+"%"); } @@ -76,6 +79,15 @@ public class GoodsMsgServiceImpl implements GoodsMsgService { criteria.andStatusNotEqualTo(0); } + if (MapUtils.getInteger(map, "time") != null && MapUtils.getInteger(map, "time") == 1) { + example.setOrderByClause("create_time desc"); + } else { + example.setOrderByClause("update_time desc"); + } + + if (MapUtils.getInteger(map, "saleNum") != null && MapUtils.getInteger(map, "saleNum") == 2) { + example.setOrderByClause("sale_num desc"); + } return goodsMsgMapper.selectByExample(example); } diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java index 28def1c..90151ec 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java @@ -111,6 +111,9 @@ public class GoodsTypeServiceImpl implements GoodsTypeService { // 获取下级菜单 goodsTypeModel.setChildren(recursionGoodsType(list , goodsType.getId())); goodsTypeModels.add(goodsTypeModel); + if (goodsTypeModel.getChildren().isEmpty()){ + goodsTypeModel.setChildren(null); + } }