diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java index 6297e957..e487dcd3 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -5,15 +5,15 @@ import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; +import com.hai.common.utils.DateUtil; import com.hai.common.utils.MemberValidateUtil; import com.hai.common.utils.ResponseMsgUtil; -import com.hai.entity.HighCoupon; -import com.hai.entity.HighCouponHandsel; -import com.hai.entity.HighMerchant; -import com.hai.entity.HighMerchantStore; +import com.hai.entity.*; +import com.hai.enum_type.ApproveType; import com.hai.model.HighCouponModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; +import com.hai.service.HighApproveService; import com.hai.service.HighCouponService; import com.hai.service.HighMerchantService; import io.swagger.annotations.Api; @@ -23,14 +23,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.time.Year; import java.util.Date; /** @@ -54,6 +50,9 @@ public class HighCouponController { @Resource private HighCouponService highCouponService; + @Resource + private HighApproveService highApproveService; + @RequestMapping(value="/insertCoupon",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "增加卡卷") @@ -62,13 +61,14 @@ public class HighCouponController { SessionObject sessionObject = userCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); if (highCoupon.getMerchantId() == null - || StringUtils.isNotBlank(highCoupon.getCouponKey()) - || StringUtils.isNotBlank(highCoupon.getCouponName()) - || StringUtils.isNotBlank(highCoupon.getCouponValue()) - || StringUtils.isNotBlank(highCoupon.getCouponImg()) - || StringUtils.isNotBlank(highCoupon.getCouponCarouselImg()) - || StringUtils.isNotBlank(highCoupon.getCouponDesc()) + || StringUtils.isBlank(highCoupon.getCouponName()) + || StringUtils.isBlank(highCoupon.getCouponImg()) + || StringUtils.isBlank(highCoupon.getCouponCarouselImg()) + || StringUtils.isBlank(highCoupon.getCouponDesc()) + || highCoupon.getCouponPrice() == null || highCoupon.getCouponType() == null + || highCoupon.getSalesEndTime() == null + || highCoupon.getRecycleDay() == null || highCoupon.getLimitNumber()== null || highCoupon.getSalesPrice()== null || highCoupon.getIsPresent() == null) { @@ -97,12 +97,14 @@ public class HighCouponController { throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); } + String setCouponKey = DateUtil.date2String(new Date(), "yyyyMMddhhmmss") + ((Math.random()*9+1)*10000); //订单号生成 年月日小时分秒 + 5位随机数 + highCoupon.setCouponKey(setCouponKey); highCoupon.setCompanyId(merchant.getCompanyId()); highCoupon.setOperatorId(userInfoModel.getSecUser().getId()); highCoupon.setOperatorName(userInfoModel.getSecUser().getUserName()); highCoupon.setCreateTime(new Date()); highCoupon.setUpdateTime(new Date()); - highCoupon.setStatus(1); // 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 + highCoupon.setStatus(1); // 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回 highCouponService.insertCoupon(highCoupon); return ResponseMsgUtil.success(highCoupon); @@ -120,14 +122,19 @@ public class HighCouponController { try { SessionObject sessionObject = userCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); - if (highCoupon.getId() == null - || highCoupon.getMerchantId() == null - || StringUtils.isNotBlank(highCoupon.getCouponKey()) - || StringUtils.isNotBlank(highCoupon.getCouponName()) - || StringUtils.isNotBlank(highCoupon.getCouponValue()) - || StringUtils.isNotBlank(highCoupon.getCouponImg()) + if (highCoupon.getMerchantId() == null + || StringUtils.isBlank(highCoupon.getCouponName()) + || StringUtils.isBlank(highCoupon.getCouponImg()) + || StringUtils.isBlank(highCoupon.getCouponCarouselImg()) + || StringUtils.isBlank(highCoupon.getCouponDesc()) + || highCoupon.getCouponPrice() == null + || highCoupon.getCouponType() == null + || highCoupon.getSalesEndTime() == null + || highCoupon.getRecycleDay() == null + || highCoupon.getLimitNumber()== null + || highCoupon.getSalesPrice()== null || highCoupon.getIsPresent() == null) { - log.error("HighCouponController -> updateCoupon() error!","参数错误"); + log.error("HighCouponController -> insertCoupon() error!","参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } @@ -148,6 +155,13 @@ public class HighCouponController { } } + // 查询卡券 + HighCouponModel coupon = highCouponService.getCouponById(highCoupon.getId()); + if (coupon == null) { + log.error("HighCouponController -> updateCoupon() error!","未找到卡卷信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, ""); + } + // 查询商户 HighMerchant merchant = highMerchantService.getMerchantById(highCoupon.getCompanyId()); if (merchant == null) { @@ -159,6 +173,7 @@ public class HighCouponController { highCoupon.setOperatorId(userInfoModel.getSecUser().getId()); highCoupon.setOperatorName(userInfoModel.getSecUser().getUserName()); highCoupon.setUpdateTime(new Date()); + highCouponService.updateCoupon(highCoupon); return ResponseMsgUtil.success(highCoupon); @@ -168,4 +183,58 @@ public class HighCouponController { } } + @RequestMapping(value="/upShelfApprove",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "卡卷上架审批") + public ResponseData upShelfApprove(@RequestParam(name = "id", required = true) Long id, HttpServletRequest request) { + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + // 查询卡券 + HighCouponModel coupon = highCouponService.getCouponById(id); + if (coupon == null) { + log.error("HighCouponController -> upShelfApprove() error!","未找到卡卷信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, ""); + } + // 如果卡卷状态不处于 编辑中、已下架、审上架批驳回 + if (coupon.getStatus() != 1 || coupon.getStatus() != 3 || coupon.getStatus() != 102) { + log.error("HighCouponController -> upShelfApprove() error!","卡卷状态错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_UNABLE_UP_SHELF, ""); + } + + HighApprove approve = new HighApprove(); + approve.setObjectType(ApproveType.UP_SHELF_APPROVE.getType()); + approve.setObjectId(id); + approve.setApproveSerialNo(DateUtil.date2String(new Date(), "MMddhhmmss") + ((Math.random()*9+1)*10000)); + approve.setStatus(1); + approve.setCreateTime(new Date()); + approve.setUpdateTime(new Date()); + approve.setSubmitOperatorId(userInfoModel.getSecUser().getId()); + approve.setSubmitOperatorName(userInfoModel.getSecUser().getUserName()); + + // 增加审批 + highApproveService.insertApprove(approve); + + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("HighCouponController -> upShelfApprove() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/ofShelfApprove",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "卡卷下架") + public ResponseData ofShelfApprove(@RequestParam(name = "id", required = true) Long id) { + try { + + highCouponService.ofShelfApprove(id); + + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("HighCouponController -> ofShelfApprove() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java b/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java index 1b053448..20d3004f 100644 --- a/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java +++ b/hai-service/src/main/java/com/hai/common/exception/ErrorCode.java @@ -80,6 +80,9 @@ public enum ErrorCode { PHONE_NUM_EXISTED("2108","电话号码已被使用"), MERCHANT_STATUS_ERROR("2109","商户状态不正常,请联系管理员"), SELECT_HANDSEL_COUPON_ERROR("2110","请选择赠送卡卷名单"), + NOT_FOUND_COUPON("2111","未找到卡卷信息"), + WRITE_COUPON_NUMBER_ERROR("2112","请填写卡卷数量"), + COUPON_UNABLE_UP_SHELF("2113","卡卷状态错误"), STATUS_ERROR("3000","状态错误"), diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponMapper.java b/hai-service/src/main/java/com/hai/dao/HighCouponMapper.java index 9a5e5516..3a696510 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponMapper.java @@ -41,9 +41,10 @@ public interface HighCouponMapper extends HighCouponMapperExt { @Insert({ "insert into high_coupon (company_id, merchant_id, ", "coupon_key, coupon_name, ", - "coupon_value, coupon_img, ", + "coupon_price, coupon_img, ", "coupon_carousel_img, coupon_desc, ", - "coupon_type, limit_number, ", + "coupon_type, sales_end_time, ", + "recycle_day, limit_number, ", "sales_price, sales_count, ", "is_present, create_time, ", "update_time, operator_id, ", @@ -51,9 +52,10 @@ public interface HighCouponMapper extends HighCouponMapperExt { "ext_1, ext_2, ext_3)", "values (#{companyId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ", "#{couponKey,jdbcType=VARCHAR}, #{couponName,jdbcType=VARCHAR}, ", - "#{couponValue,jdbcType=VARCHAR}, #{couponImg,jdbcType=VARCHAR}, ", + "#{couponPrice,jdbcType=DECIMAL}, #{couponImg,jdbcType=VARCHAR}, ", "#{couponCarouselImg,jdbcType=VARCHAR}, #{couponDesc,jdbcType=VARCHAR}, ", - "#{couponType,jdbcType=INTEGER}, #{limitNumber,jdbcType=INTEGER}, ", + "#{couponType,jdbcType=INTEGER}, #{salesEndTime,jdbcType=TIMESTAMP}, ", + "#{recycleDay,jdbcType=INTEGER}, #{limitNumber,jdbcType=INTEGER}, ", "#{salesPrice,jdbcType=DECIMAL}, #{salesCount,jdbcType=INTEGER}, ", "#{isPresent,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ", @@ -74,11 +76,13 @@ public interface HighCouponMapper extends HighCouponMapperExt { @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), @Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR), - @Result(column="coupon_value", property="couponValue", jdbcType=JdbcType.VARCHAR), + @Result(column="coupon_price", property="couponPrice", jdbcType=JdbcType.DECIMAL), @Result(column="coupon_img", property="couponImg", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_carousel_img", property="couponCarouselImg", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_desc", property="couponDesc", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_type", property="couponType", jdbcType=JdbcType.INTEGER), + @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="recycle_day", property="recycleDay", jdbcType=JdbcType.INTEGER), @Result(column="limit_number", property="limitNumber", jdbcType=JdbcType.INTEGER), @Result(column="sales_price", property="salesPrice", jdbcType=JdbcType.DECIMAL), @Result(column="sales_count", property="salesCount", jdbcType=JdbcType.INTEGER), @@ -96,10 +100,10 @@ public interface HighCouponMapper extends HighCouponMapperExt { @Select({ "select", - "id, company_id, merchant_id, coupon_key, coupon_name, coupon_value, coupon_img, ", - "coupon_carousel_img, coupon_desc, coupon_type, limit_number, sales_price, sales_count, ", - "is_present, create_time, update_time, operator_id, operator_name, `status`, ", - "ext_1, ext_2, ext_3", + "id, company_id, merchant_id, coupon_key, coupon_name, coupon_price, coupon_img, ", + "coupon_carousel_img, coupon_desc, coupon_type, sales_end_time, recycle_day, ", + "limit_number, sales_price, sales_count, is_present, create_time, update_time, ", + "operator_id, operator_name, `status`, ext_1, ext_2, ext_3", "from high_coupon", "where id = #{id,jdbcType=BIGINT}" }) @@ -109,11 +113,13 @@ public interface HighCouponMapper extends HighCouponMapperExt { @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), @Result(column="coupon_key", property="couponKey", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR), - @Result(column="coupon_value", property="couponValue", jdbcType=JdbcType.VARCHAR), + @Result(column="coupon_price", property="couponPrice", jdbcType=JdbcType.DECIMAL), @Result(column="coupon_img", property="couponImg", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_carousel_img", property="couponCarouselImg", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_desc", property="couponDesc", jdbcType=JdbcType.VARCHAR), @Result(column="coupon_type", property="couponType", jdbcType=JdbcType.INTEGER), + @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="recycle_day", property="recycleDay", jdbcType=JdbcType.INTEGER), @Result(column="limit_number", property="limitNumber", jdbcType=JdbcType.INTEGER), @Result(column="sales_price", property="salesPrice", jdbcType=JdbcType.DECIMAL), @Result(column="sales_count", property="salesCount", jdbcType=JdbcType.INTEGER), @@ -144,11 +150,13 @@ public interface HighCouponMapper extends HighCouponMapperExt { "merchant_id = #{merchantId,jdbcType=BIGINT},", "coupon_key = #{couponKey,jdbcType=VARCHAR},", "coupon_name = #{couponName,jdbcType=VARCHAR},", - "coupon_value = #{couponValue,jdbcType=VARCHAR},", + "coupon_price = #{couponPrice,jdbcType=DECIMAL},", "coupon_img = #{couponImg,jdbcType=VARCHAR},", "coupon_carousel_img = #{couponCarouselImg,jdbcType=VARCHAR},", "coupon_desc = #{couponDesc,jdbcType=VARCHAR},", "coupon_type = #{couponType,jdbcType=INTEGER},", + "sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},", + "recycle_day = #{recycleDay,jdbcType=INTEGER},", "limit_number = #{limitNumber,jdbcType=INTEGER},", "sales_price = #{salesPrice,jdbcType=DECIMAL},", "sales_count = #{salesCount,jdbcType=INTEGER},", diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponRecycleMapper.java b/hai-service/src/main/java/com/hai/dao/HighCouponRecycleMapper.java new file mode 100644 index 00000000..1c913163 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighCouponRecycleMapper.java @@ -0,0 +1,81 @@ +package com.hai.dao; + +import com.hai.entity.HighCouponRecycle; +import com.hai.entity.HighCouponRecycleExample; +import java.util.List; +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.SelectProvider; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface HighCouponRecycleMapper extends HighCouponRecycleMapperExt { + @SelectProvider(type=HighCouponRecycleSqlProvider.class, method="countByExample") + long countByExample(HighCouponRecycleExample example); + + @DeleteProvider(type=HighCouponRecycleSqlProvider.class, method="deleteByExample") + int deleteByExample(HighCouponRecycleExample example); + + @Insert({ + "insert into high_coupon_recycle (coupon_id, coupon_name, ", + "merchant_id, coupon_sales_code, ", + "coupon_code_id, user_id, ", + "user_phone, order_no, ", + "order_id, receive_time, ", + "create_time, `status`, ", + "ext_1, ext_3, ext_2)", + "values (#{couponId,jdbcType=BIGINT}, #{couponName,jdbcType=VARCHAR}, ", + "#{merchantId,jdbcType=BIGINT}, #{couponSalesCode,jdbcType=VARCHAR}, ", + "#{couponCodeId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ", + "#{userPhone,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ", + "#{orderId,jdbcType=BIGINT}, #{receiveTime,jdbcType=TIMESTAMP}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighCouponRecycle record); + + @InsertProvider(type=HighCouponRecycleSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighCouponRecycle record); + + @SelectProvider(type=HighCouponRecycleSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT), + @Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT), + @Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR), + @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), + @Result(column="coupon_sales_code", property="couponSalesCode", jdbcType=JdbcType.VARCHAR), + @Result(column="coupon_code_id", property="couponCodeId", jdbcType=JdbcType.BIGINT), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT), + @Result(column="receive_time", property="receiveTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(HighCouponRecycleExample example); + + @UpdateProvider(type=HighCouponRecycleSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighCouponRecycle record, @Param("example") HighCouponRecycleExample example); + + @UpdateProvider(type=HighCouponRecycleSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighCouponRecycle record, @Param("example") HighCouponRecycleExample example); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponRecycleMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighCouponRecycleMapperExt.java new file mode 100644 index 00000000..960502f2 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighCouponRecycleMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighCouponRecycleMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponRecycleSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighCouponRecycleSqlProvider.java new file mode 100644 index 00000000..8485e295 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighCouponRecycleSqlProvider.java @@ -0,0 +1,319 @@ +package com.hai.dao; + +import com.hai.entity.HighCouponRecycle; +import com.hai.entity.HighCouponRecycleExample.Criteria; +import com.hai.entity.HighCouponRecycleExample.Criterion; +import com.hai.entity.HighCouponRecycleExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighCouponRecycleSqlProvider { + + public String countByExample(HighCouponRecycleExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_coupon_recycle"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighCouponRecycleExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_coupon_recycle"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighCouponRecycle record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_coupon_recycle"); + + if (record.getCouponId() != null) { + sql.VALUES("coupon_id", "#{couponId,jdbcType=BIGINT}"); + } + + if (record.getCouponName() != null) { + sql.VALUES("coupon_name", "#{couponName,jdbcType=VARCHAR}"); + } + + if (record.getMerchantId() != null) { + sql.VALUES("merchant_id", "#{merchantId,jdbcType=BIGINT}"); + } + + if (record.getCouponSalesCode() != null) { + sql.VALUES("coupon_sales_code", "#{couponSalesCode,jdbcType=VARCHAR}"); + } + + if (record.getCouponCodeId() != null) { + sql.VALUES("coupon_code_id", "#{couponCodeId,jdbcType=BIGINT}"); + } + + if (record.getUserId() != null) { + sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getOrderNo() != null) { + sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); + } + + if (record.getOrderId() != null) { + sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}"); + } + + if (record.getReceiveTime() != null) { + sql.VALUES("receive_time", "#{receiveTime,jdbcType=TIMESTAMP}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(HighCouponRecycleExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("coupon_id"); + sql.SELECT("coupon_name"); + sql.SELECT("merchant_id"); + sql.SELECT("coupon_sales_code"); + sql.SELECT("coupon_code_id"); + sql.SELECT("user_id"); + sql.SELECT("user_phone"); + sql.SELECT("order_no"); + sql.SELECT("order_id"); + sql.SELECT("receive_time"); + sql.SELECT("create_time"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_3"); + sql.SELECT("ext_2"); + sql.FROM("high_coupon_recycle"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighCouponRecycle record = (HighCouponRecycle) parameter.get("record"); + HighCouponRecycleExample example = (HighCouponRecycleExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_coupon_recycle"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getCouponId() != null) { + sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}"); + } + + if (record.getCouponName() != null) { + sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); + } + + if (record.getMerchantId() != null) { + sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); + } + + if (record.getCouponSalesCode() != null) { + sql.SET("coupon_sales_code = #{record.couponSalesCode,jdbcType=VARCHAR}"); + } + + if (record.getCouponCodeId() != null) { + sql.SET("coupon_code_id = #{record.couponCodeId,jdbcType=BIGINT}"); + } + + if (record.getUserId() != null) { + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + } + + if (record.getOrderNo() != null) { + sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); + } + + if (record.getOrderId() != null) { + sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); + } + + if (record.getReceiveTime() != null) { + sql.SET("receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("high_coupon_recycle"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("coupon_id = #{record.couponId,jdbcType=BIGINT}"); + sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); + sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); + sql.SET("coupon_sales_code = #{record.couponSalesCode,jdbcType=VARCHAR}"); + sql.SET("coupon_code_id = #{record.couponCodeId,jdbcType=BIGINT}"); + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); + sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); + sql.SET("receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + + HighCouponRecycleExample example = (HighCouponRecycleExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + protected void applyWhere(SQL sql, HighCouponRecycleExample 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/hai-service/src/main/java/com/hai/dao/HighCouponSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighCouponSqlProvider.java index 9c2acd23..e4145954 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponSqlProvider.java @@ -44,8 +44,8 @@ public class HighCouponSqlProvider { sql.VALUES("coupon_name", "#{couponName,jdbcType=VARCHAR}"); } - if (record.getCouponValue() != null) { - sql.VALUES("coupon_value", "#{couponValue,jdbcType=VARCHAR}"); + if (record.getCouponPrice() != null) { + sql.VALUES("coupon_price", "#{couponPrice,jdbcType=DECIMAL}"); } if (record.getCouponImg() != null) { @@ -64,6 +64,14 @@ public class HighCouponSqlProvider { sql.VALUES("coupon_type", "#{couponType,jdbcType=INTEGER}"); } + if (record.getSalesEndTime() != null) { + sql.VALUES("sales_end_time", "#{salesEndTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRecycleDay() != null) { + sql.VALUES("recycle_day", "#{recycleDay,jdbcType=INTEGER}"); + } + if (record.getLimitNumber() != null) { sql.VALUES("limit_number", "#{limitNumber,jdbcType=INTEGER}"); } @@ -126,11 +134,13 @@ public class HighCouponSqlProvider { sql.SELECT("merchant_id"); sql.SELECT("coupon_key"); sql.SELECT("coupon_name"); - sql.SELECT("coupon_value"); + sql.SELECT("coupon_price"); sql.SELECT("coupon_img"); sql.SELECT("coupon_carousel_img"); sql.SELECT("coupon_desc"); sql.SELECT("coupon_type"); + sql.SELECT("sales_end_time"); + sql.SELECT("recycle_day"); sql.SELECT("limit_number"); sql.SELECT("sales_price"); sql.SELECT("sales_count"); @@ -180,8 +190,8 @@ public class HighCouponSqlProvider { sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); } - if (record.getCouponValue() != null) { - sql.SET("coupon_value = #{record.couponValue,jdbcType=VARCHAR}"); + if (record.getCouponPrice() != null) { + sql.SET("coupon_price = #{record.couponPrice,jdbcType=DECIMAL}"); } if (record.getCouponImg() != null) { @@ -200,6 +210,14 @@ public class HighCouponSqlProvider { sql.SET("coupon_type = #{record.couponType,jdbcType=INTEGER}"); } + if (record.getSalesEndTime() != null) { + sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRecycleDay() != null) { + sql.SET("recycle_day = #{record.recycleDay,jdbcType=INTEGER}"); + } + if (record.getLimitNumber() != null) { sql.SET("limit_number = #{record.limitNumber,jdbcType=INTEGER}"); } @@ -261,11 +279,13 @@ public class HighCouponSqlProvider { sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); sql.SET("coupon_key = #{record.couponKey,jdbcType=VARCHAR}"); sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}"); - sql.SET("coupon_value = #{record.couponValue,jdbcType=VARCHAR}"); + sql.SET("coupon_price = #{record.couponPrice,jdbcType=DECIMAL}"); sql.SET("coupon_img = #{record.couponImg,jdbcType=VARCHAR}"); sql.SET("coupon_carousel_img = #{record.couponCarouselImg,jdbcType=VARCHAR}"); sql.SET("coupon_desc = #{record.couponDesc,jdbcType=VARCHAR}"); sql.SET("coupon_type = #{record.couponType,jdbcType=INTEGER}"); + sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); + sql.SET("recycle_day = #{record.recycleDay,jdbcType=INTEGER}"); sql.SET("limit_number = #{record.limitNumber,jdbcType=INTEGER}"); sql.SET("sales_price = #{record.salesPrice,jdbcType=DECIMAL}"); sql.SET("sales_count = #{record.salesCount,jdbcType=INTEGER}"); @@ -304,8 +324,8 @@ public class HighCouponSqlProvider { sql.SET("coupon_name = #{couponName,jdbcType=VARCHAR}"); } - if (record.getCouponValue() != null) { - sql.SET("coupon_value = #{couponValue,jdbcType=VARCHAR}"); + if (record.getCouponPrice() != null) { + sql.SET("coupon_price = #{couponPrice,jdbcType=DECIMAL}"); } if (record.getCouponImg() != null) { @@ -324,6 +344,14 @@ public class HighCouponSqlProvider { sql.SET("coupon_type = #{couponType,jdbcType=INTEGER}"); } + if (record.getSalesEndTime() != null) { + sql.SET("sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRecycleDay() != null) { + sql.SET("recycle_day = #{recycleDay,jdbcType=INTEGER}"); + } + if (record.getLimitNumber() != null) { sql.SET("limit_number = #{limitNumber,jdbcType=INTEGER}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferMapper.java b/hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferMapper.java index 502c691e..6d5c4eb6 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferMapper.java @@ -46,7 +46,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt "operator_name, `status`, ", "ext_1, ext_2, ext_3)", "values (#{objectType,jdbcType=INTEGER}, #{objectId,jdbcType=BIGINT}, ", - "#{newSalePrice,jdbcType=REAL}, #{promptlyType,jdbcType=BIT}, ", + "#{newSalePrice,jdbcType=DECIMAL}, #{promptlyType,jdbcType=BIT}, ", "#{effectiveTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, ", "#{createTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ", "#{operatorName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", @@ -64,7 +64,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), - @Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.REAL), + @Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.DECIMAL), @Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT), @Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR), @@ -89,7 +89,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), - @Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.REAL), + @Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.DECIMAL), @Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT), @Result(column="effective_time", property="effectiveTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR), @@ -116,7 +116,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt "update high_goods_price_refer", "set object_type = #{objectType,jdbcType=INTEGER},", "object_id = #{objectId,jdbcType=BIGINT},", - "new_sale_price = #{newSalePrice,jdbcType=REAL},", + "new_sale_price = #{newSalePrice,jdbcType=DECIMAL},", "promptly_type = #{promptlyType,jdbcType=BIT},", "effective_time = #{effectiveTime,jdbcType=TIMESTAMP},", "remark = #{remark,jdbcType=VARCHAR},", diff --git a/hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferSqlProvider.java index 81f1513b..73117401 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferSqlProvider.java @@ -37,7 +37,7 @@ public class HighGoodsPriceReferSqlProvider { } if (record.getNewSalePrice() != null) { - sql.VALUES("new_sale_price", "#{newSalePrice,jdbcType=REAL}"); + sql.VALUES("new_sale_price", "#{newSalePrice,jdbcType=DECIMAL}"); } if (record.getPromptlyType() != null) { @@ -133,7 +133,7 @@ public class HighGoodsPriceReferSqlProvider { } if (record.getNewSalePrice() != null) { - sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=REAL}"); + sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=DECIMAL}"); } if (record.getPromptlyType() != null) { @@ -187,7 +187,7 @@ public class HighGoodsPriceReferSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}"); sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); - sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=REAL}"); + sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=DECIMAL}"); sql.SET("promptly_type = #{record.promptlyType,jdbcType=BIT}"); sql.SET("effective_time = #{record.effectiveTime,jdbcType=TIMESTAMP}"); sql.SET("remark = #{record.remark,jdbcType=VARCHAR}"); @@ -217,7 +217,7 @@ public class HighGoodsPriceReferSqlProvider { } if (record.getNewSalePrice() != null) { - sql.SET("new_sale_price = #{newSalePrice,jdbcType=REAL}"); + sql.SET("new_sale_price = #{newSalePrice,jdbcType=DECIMAL}"); } if (record.getPromptlyType() != null) { diff --git a/hai-service/src/main/java/com/hai/entity/HighCoupon.java b/hai-service/src/main/java/com/hai/entity/HighCoupon.java index 663490aa..fa7d1efa 100644 --- a/hai-service/src/main/java/com/hai/entity/HighCoupon.java +++ b/hai-service/src/main/java/com/hai/entity/HighCoupon.java @@ -1,6 +1,7 @@ package com.hai.entity; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -41,7 +42,7 @@ public class HighCoupon implements Serializable { /** * 卡券面值 */ - private String couponValue; + private BigDecimal couponPrice; /** * 卡券图片 @@ -63,6 +64,16 @@ public class HighCoupon implements Serializable { */ private Integer couponType; + /** + * 销售截止日期 + */ + private Date salesEndTime; + + /** + * 归库天数 + */ + private Integer recycleDay; + /** * 限购数量 */ @@ -71,7 +82,7 @@ public class HighCoupon implements Serializable { /** * 销售价格 */ - private Long salesPrice; + private BigDecimal salesPrice; /** * 销售数量 @@ -104,7 +115,7 @@ public class HighCoupon implements Serializable { private String operatorName; /** - * 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回 + * 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回 */ private Integer status; @@ -156,12 +167,12 @@ public class HighCoupon implements Serializable { this.couponName = couponName; } - public String getCouponValue() { - return couponValue; + public BigDecimal getCouponPrice() { + return couponPrice; } - public void setCouponValue(String couponValue) { - this.couponValue = couponValue; + public void setCouponPrice(BigDecimal couponPrice) { + this.couponPrice = couponPrice; } public String getCouponImg() { @@ -196,6 +207,22 @@ public class HighCoupon implements Serializable { this.couponType = couponType; } + public Date getSalesEndTime() { + return salesEndTime; + } + + public void setSalesEndTime(Date salesEndTime) { + this.salesEndTime = salesEndTime; + } + + public Integer getRecycleDay() { + return recycleDay; + } + + public void setRecycleDay(Integer recycleDay) { + this.recycleDay = recycleDay; + } + public Integer getLimitNumber() { return limitNumber; } @@ -204,11 +231,11 @@ public class HighCoupon implements Serializable { this.limitNumber = limitNumber; } - public Long getSalesPrice() { + public BigDecimal getSalesPrice() { return salesPrice; } - public void setSalesPrice(Long salesPrice) { + public void setSalesPrice(BigDecimal salesPrice) { this.salesPrice = salesPrice; } @@ -309,11 +336,13 @@ public class HighCoupon implements Serializable { && (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId())) && (this.getCouponKey() == null ? other.getCouponKey() == null : this.getCouponKey().equals(other.getCouponKey())) && (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName())) - && (this.getCouponValue() == null ? other.getCouponValue() == null : this.getCouponValue().equals(other.getCouponValue())) + && (this.getCouponPrice() == null ? other.getCouponPrice() == null : this.getCouponPrice().equals(other.getCouponPrice())) && (this.getCouponImg() == null ? other.getCouponImg() == null : this.getCouponImg().equals(other.getCouponImg())) && (this.getCouponCarouselImg() == null ? other.getCouponCarouselImg() == null : this.getCouponCarouselImg().equals(other.getCouponCarouselImg())) && (this.getCouponDesc() == null ? other.getCouponDesc() == null : this.getCouponDesc().equals(other.getCouponDesc())) && (this.getCouponType() == null ? other.getCouponType() == null : this.getCouponType().equals(other.getCouponType())) + && (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime())) + && (this.getRecycleDay() == null ? other.getRecycleDay() == null : this.getRecycleDay().equals(other.getRecycleDay())) && (this.getLimitNumber() == null ? other.getLimitNumber() == null : this.getLimitNumber().equals(other.getLimitNumber())) && (this.getSalesPrice() == null ? other.getSalesPrice() == null : this.getSalesPrice().equals(other.getSalesPrice())) && (this.getSalesCount() == null ? other.getSalesCount() == null : this.getSalesCount().equals(other.getSalesCount())) @@ -337,11 +366,13 @@ public class HighCoupon implements Serializable { result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode()); result = prime * result + ((getCouponKey() == null) ? 0 : getCouponKey().hashCode()); result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode()); - result = prime * result + ((getCouponValue() == null) ? 0 : getCouponValue().hashCode()); + result = prime * result + ((getCouponPrice() == null) ? 0 : getCouponPrice().hashCode()); result = prime * result + ((getCouponImg() == null) ? 0 : getCouponImg().hashCode()); result = prime * result + ((getCouponCarouselImg() == null) ? 0 : getCouponCarouselImg().hashCode()); result = prime * result + ((getCouponDesc() == null) ? 0 : getCouponDesc().hashCode()); result = prime * result + ((getCouponType() == null) ? 0 : getCouponType().hashCode()); + result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode()); + result = prime * result + ((getRecycleDay() == null) ? 0 : getRecycleDay().hashCode()); result = prime * result + ((getLimitNumber() == null) ? 0 : getLimitNumber().hashCode()); result = prime * result + ((getSalesPrice() == null) ? 0 : getSalesPrice().hashCode()); result = prime * result + ((getSalesCount() == null) ? 0 : getSalesCount().hashCode()); @@ -368,11 +399,13 @@ public class HighCoupon implements Serializable { sb.append(", merchantId=").append(merchantId); sb.append(", couponKey=").append(couponKey); sb.append(", couponName=").append(couponName); - sb.append(", couponValue=").append(couponValue); + sb.append(", couponPrice=").append(couponPrice); sb.append(", couponImg=").append(couponImg); sb.append(", couponCarouselImg=").append(couponCarouselImg); sb.append(", couponDesc=").append(couponDesc); sb.append(", couponType=").append(couponType); + sb.append(", salesEndTime=").append(salesEndTime); + sb.append(", recycleDay=").append(recycleDay); sb.append(", limitNumber=").append(limitNumber); sb.append(", salesPrice=").append(salesPrice); sb.append(", salesCount=").append(salesCount); diff --git a/hai-service/src/main/java/com/hai/entity/HighCouponCode.java b/hai-service/src/main/java/com/hai/entity/HighCouponCode.java index 878fc54f..af285c5f 100644 --- a/hai-service/src/main/java/com/hai/entity/HighCouponCode.java +++ b/hai-service/src/main/java/com/hai/entity/HighCouponCode.java @@ -64,7 +64,7 @@ public class HighCouponCode implements Serializable { private Date consumeTime; /** - * 状态:1.待销售 2.未使用 3.已使用 4.已过期 + * 状态:1.待销售 2.未使用 3.已使用 */ private Integer status; diff --git a/hai-service/src/main/java/com/hai/entity/HighCouponExample.java b/hai-service/src/main/java/com/hai/entity/HighCouponExample.java index 486fb08f..cb4d79d7 100644 --- a/hai-service/src/main/java/com/hai/entity/HighCouponExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighCouponExample.java @@ -1,5 +1,6 @@ package com.hai.entity; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -445,73 +446,63 @@ public class HighCouponExample { return (Criteria) this; } - public Criteria andCouponValueIsNull() { - addCriterion("coupon_value is null"); + public Criteria andCouponPriceIsNull() { + addCriterion("coupon_price is null"); return (Criteria) this; } - public Criteria andCouponValueIsNotNull() { - addCriterion("coupon_value is not null"); + public Criteria andCouponPriceIsNotNull() { + addCriterion("coupon_price is not null"); return (Criteria) this; } - public Criteria andCouponValueEqualTo(String value) { - addCriterion("coupon_value =", value, "couponValue"); + public Criteria andCouponPriceEqualTo(BigDecimal value) { + addCriterion("coupon_price =", value, "couponPrice"); return (Criteria) this; } - public Criteria andCouponValueNotEqualTo(String value) { - addCriterion("coupon_value <>", value, "couponValue"); + public Criteria andCouponPriceNotEqualTo(BigDecimal value) { + addCriterion("coupon_price <>", value, "couponPrice"); return (Criteria) this; } - public Criteria andCouponValueGreaterThan(String value) { - addCriterion("coupon_value >", value, "couponValue"); + public Criteria andCouponPriceGreaterThan(BigDecimal value) { + addCriterion("coupon_price >", value, "couponPrice"); return (Criteria) this; } - public Criteria andCouponValueGreaterThanOrEqualTo(String value) { - addCriterion("coupon_value >=", value, "couponValue"); + public Criteria andCouponPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("coupon_price >=", value, "couponPrice"); return (Criteria) this; } - public Criteria andCouponValueLessThan(String value) { - addCriterion("coupon_value <", value, "couponValue"); + public Criteria andCouponPriceLessThan(BigDecimal value) { + addCriterion("coupon_price <", value, "couponPrice"); return (Criteria) this; } - public Criteria andCouponValueLessThanOrEqualTo(String value) { - addCriterion("coupon_value <=", value, "couponValue"); + public Criteria andCouponPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("coupon_price <=", value, "couponPrice"); return (Criteria) this; } - public Criteria andCouponValueLike(String value) { - addCriterion("coupon_value like", value, "couponValue"); + public Criteria andCouponPriceIn(List values) { + addCriterion("coupon_price in", values, "couponPrice"); return (Criteria) this; } - public Criteria andCouponValueNotLike(String value) { - addCriterion("coupon_value not like", value, "couponValue"); + public Criteria andCouponPriceNotIn(List values) { + addCriterion("coupon_price not in", values, "couponPrice"); return (Criteria) this; } - public Criteria andCouponValueIn(List values) { - addCriterion("coupon_value in", values, "couponValue"); + public Criteria andCouponPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("coupon_price between", value1, value2, "couponPrice"); return (Criteria) this; } - public Criteria andCouponValueNotIn(List values) { - addCriterion("coupon_value not in", values, "couponValue"); - return (Criteria) this; - } - - public Criteria andCouponValueBetween(String value1, String value2) { - addCriterion("coupon_value between", value1, value2, "couponValue"); - return (Criteria) this; - } - - public Criteria andCouponValueNotBetween(String value1, String value2) { - addCriterion("coupon_value not between", value1, value2, "couponValue"); + public Criteria andCouponPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("coupon_price not between", value1, value2, "couponPrice"); return (Criteria) this; } @@ -785,6 +776,126 @@ public class HighCouponExample { 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 andRecycleDayIsNull() { + addCriterion("recycle_day is null"); + return (Criteria) this; + } + + public Criteria andRecycleDayIsNotNull() { + addCriterion("recycle_day is not null"); + return (Criteria) this; + } + + public Criteria andRecycleDayEqualTo(Integer value) { + addCriterion("recycle_day =", value, "recycleDay"); + return (Criteria) this; + } + + public Criteria andRecycleDayNotEqualTo(Integer value) { + addCriterion("recycle_day <>", value, "recycleDay"); + return (Criteria) this; + } + + public Criteria andRecycleDayGreaterThan(Integer value) { + addCriterion("recycle_day >", value, "recycleDay"); + return (Criteria) this; + } + + public Criteria andRecycleDayGreaterThanOrEqualTo(Integer value) { + addCriterion("recycle_day >=", value, "recycleDay"); + return (Criteria) this; + } + + public Criteria andRecycleDayLessThan(Integer value) { + addCriterion("recycle_day <", value, "recycleDay"); + return (Criteria) this; + } + + public Criteria andRecycleDayLessThanOrEqualTo(Integer value) { + addCriterion("recycle_day <=", value, "recycleDay"); + return (Criteria) this; + } + + public Criteria andRecycleDayIn(List values) { + addCriterion("recycle_day in", values, "recycleDay"); + return (Criteria) this; + } + + public Criteria andRecycleDayNotIn(List values) { + addCriterion("recycle_day not in", values, "recycleDay"); + return (Criteria) this; + } + + public Criteria andRecycleDayBetween(Integer value1, Integer value2) { + addCriterion("recycle_day between", value1, value2, "recycleDay"); + return (Criteria) this; + } + + public Criteria andRecycleDayNotBetween(Integer value1, Integer value2) { + addCriterion("recycle_day not between", value1, value2, "recycleDay"); + return (Criteria) this; + } + public Criteria andLimitNumberIsNull() { addCriterion("limit_number is null"); return (Criteria) this; @@ -855,52 +966,52 @@ public class HighCouponExample { return (Criteria) this; } - public Criteria andSalesPriceEqualTo(Long value) { + public Criteria andSalesPriceEqualTo(BigDecimal value) { addCriterion("sales_price =", value, "salesPrice"); return (Criteria) this; } - public Criteria andSalesPriceNotEqualTo(Long value) { + public Criteria andSalesPriceNotEqualTo(BigDecimal value) { addCriterion("sales_price <>", value, "salesPrice"); return (Criteria) this; } - public Criteria andSalesPriceGreaterThan(Long value) { + public Criteria andSalesPriceGreaterThan(BigDecimal value) { addCriterion("sales_price >", value, "salesPrice"); return (Criteria) this; } - public Criteria andSalesPriceGreaterThanOrEqualTo(Long value) { + public Criteria andSalesPriceGreaterThanOrEqualTo(BigDecimal value) { addCriterion("sales_price >=", value, "salesPrice"); return (Criteria) this; } - public Criteria andSalesPriceLessThan(Long value) { + public Criteria andSalesPriceLessThan(BigDecimal value) { addCriterion("sales_price <", value, "salesPrice"); return (Criteria) this; } - public Criteria andSalesPriceLessThanOrEqualTo(Long value) { + public Criteria andSalesPriceLessThanOrEqualTo(BigDecimal value) { addCriterion("sales_price <=", value, "salesPrice"); return (Criteria) this; } - public Criteria andSalesPriceIn(List values) { + public Criteria andSalesPriceIn(List values) { addCriterion("sales_price in", values, "salesPrice"); return (Criteria) this; } - public Criteria andSalesPriceNotIn(List values) { + public Criteria andSalesPriceNotIn(List values) { addCriterion("sales_price not in", values, "salesPrice"); return (Criteria) this; } - public Criteria andSalesPriceBetween(Long value1, Long value2) { + public Criteria andSalesPriceBetween(BigDecimal value1, BigDecimal value2) { addCriterion("sales_price between", value1, value2, "salesPrice"); return (Criteria) this; } - public Criteria andSalesPriceNotBetween(Long value1, Long value2) { + public Criteria andSalesPriceNotBetween(BigDecimal value1, BigDecimal value2) { addCriterion("sales_price not between", value1, value2, "salesPrice"); return (Criteria) this; } diff --git a/hai-service/src/main/java/com/hai/entity/HighCouponRecycle.java b/hai-service/src/main/java/com/hai/entity/HighCouponRecycle.java new file mode 100644 index 00000000..b89375a0 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighCouponRecycle.java @@ -0,0 +1,296 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_coupon_recycle + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighCouponRecycle implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 卡卷 + */ + private Long couponId; + + /** + * 卡卷名称 + */ + private String couponName; + + /** + * 商户 + */ + private Long merchantId; + + /** + * 销售码 + */ + private String couponSalesCode; + + /** + * 销售码id + */ + private Long couponCodeId; + + /** + * 用户id + */ + private Long userId; + + /** + * 用户手机号 + */ + private String userPhone; + + /** + * 订单流水号 + */ + private String orderNo; + + /** + * 订单id + */ + private Long orderId; + + /** + * 领取时间 + */ + private Date receiveTime; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 状态:1.过期 2.退款 + */ + private Integer status; + + private String ext1; + + private String ext3; + + private String ext2; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCouponId() { + return couponId; + } + + public void setCouponId(Long couponId) { + this.couponId = couponId; + } + + public String getCouponName() { + return couponName; + } + + public void setCouponName(String couponName) { + this.couponName = couponName; + } + + public Long getMerchantId() { + return merchantId; + } + + public void setMerchantId(Long merchantId) { + this.merchantId = merchantId; + } + + public String getCouponSalesCode() { + return couponSalesCode; + } + + public void setCouponSalesCode(String couponSalesCode) { + this.couponSalesCode = couponSalesCode; + } + + public Long getCouponCodeId() { + return couponCodeId; + } + + public void setCouponCodeId(Long couponCodeId) { + this.couponCodeId = couponCodeId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUserPhone() { + return userPhone; + } + + public void setUserPhone(String userPhone) { + this.userPhone = userPhone; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public Date getReceiveTime() { + return receiveTime; + } + + public void setReceiveTime(Date receiveTime) { + this.receiveTime = receiveTime; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + HighCouponRecycle other = (HighCouponRecycle) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId())) + && (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName())) + && (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId())) + && (this.getCouponSalesCode() == null ? other.getCouponSalesCode() == null : this.getCouponSalesCode().equals(other.getCouponSalesCode())) + && (this.getCouponCodeId() == null ? other.getCouponCodeId() == null : this.getCouponCodeId().equals(other.getCouponCodeId())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) + && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) + && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId())) + && (this.getReceiveTime() == null ? other.getReceiveTime() == null : this.getReceiveTime().equals(other.getReceiveTime())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode()); + result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode()); + result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode()); + result = prime * result + ((getCouponSalesCode() == null) ? 0 : getCouponSalesCode().hashCode()); + result = prime * result + ((getCouponCodeId() == null) ? 0 : getCouponCodeId().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); + result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); + result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); + result = prime * result + ((getReceiveTime() == null) ? 0 : getReceiveTime().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().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(", couponId=").append(couponId); + sb.append(", couponName=").append(couponName); + sb.append(", merchantId=").append(merchantId); + sb.append(", couponSalesCode=").append(couponSalesCode); + sb.append(", couponCodeId=").append(couponCodeId); + sb.append(", userId=").append(userId); + sb.append(", userPhone=").append(userPhone); + sb.append(", orderNo=").append(orderNo); + sb.append(", orderId=").append(orderId); + sb.append(", receiveTime=").append(receiveTime); + sb.append(", createTime=").append(createTime); + sb.append(", status=").append(status); + sb.append(", ext1=").append(ext1); + sb.append(", ext3=").append(ext3); + sb.append(", ext2=").append(ext2); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighCouponRecycleExample.java b/hai-service/src/main/java/com/hai/entity/HighCouponRecycleExample.java new file mode 100644 index 00000000..fea3a7b9 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighCouponRecycleExample.java @@ -0,0 +1,1253 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighCouponRecycleExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighCouponRecycleExample() { + 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 andCouponIdIsNull() { + addCriterion("coupon_id is null"); + return (Criteria) this; + } + + public Criteria andCouponIdIsNotNull() { + addCriterion("coupon_id is not null"); + return (Criteria) this; + } + + public Criteria andCouponIdEqualTo(Long value) { + addCriterion("coupon_id =", value, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdNotEqualTo(Long value) { + addCriterion("coupon_id <>", value, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdGreaterThan(Long value) { + addCriterion("coupon_id >", value, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdGreaterThanOrEqualTo(Long value) { + addCriterion("coupon_id >=", value, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdLessThan(Long value) { + addCriterion("coupon_id <", value, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdLessThanOrEqualTo(Long value) { + addCriterion("coupon_id <=", value, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdIn(List values) { + addCriterion("coupon_id in", values, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdNotIn(List values) { + addCriterion("coupon_id not in", values, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdBetween(Long value1, Long value2) { + addCriterion("coupon_id between", value1, value2, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponIdNotBetween(Long value1, Long value2) { + addCriterion("coupon_id not between", value1, value2, "couponId"); + return (Criteria) this; + } + + public Criteria andCouponNameIsNull() { + addCriterion("coupon_name is null"); + return (Criteria) this; + } + + public Criteria andCouponNameIsNotNull() { + addCriterion("coupon_name is not null"); + return (Criteria) this; + } + + public Criteria andCouponNameEqualTo(String value) { + addCriterion("coupon_name =", value, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameNotEqualTo(String value) { + addCriterion("coupon_name <>", value, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameGreaterThan(String value) { + addCriterion("coupon_name >", value, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameGreaterThanOrEqualTo(String value) { + addCriterion("coupon_name >=", value, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameLessThan(String value) { + addCriterion("coupon_name <", value, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameLessThanOrEqualTo(String value) { + addCriterion("coupon_name <=", value, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameLike(String value) { + addCriterion("coupon_name like", value, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameNotLike(String value) { + addCriterion("coupon_name not like", value, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameIn(List values) { + addCriterion("coupon_name in", values, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameNotIn(List values) { + addCriterion("coupon_name not in", values, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameBetween(String value1, String value2) { + addCriterion("coupon_name between", value1, value2, "couponName"); + return (Criteria) this; + } + + public Criteria andCouponNameNotBetween(String value1, String value2) { + addCriterion("coupon_name not between", value1, value2, "couponName"); + return (Criteria) this; + } + + public Criteria andMerchantIdIsNull() { + addCriterion("merchant_id is null"); + return (Criteria) this; + } + + public Criteria andMerchantIdIsNotNull() { + addCriterion("merchant_id is not null"); + return (Criteria) this; + } + + public Criteria andMerchantIdEqualTo(Long value) { + addCriterion("merchant_id =", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdNotEqualTo(Long value) { + addCriterion("merchant_id <>", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdGreaterThan(Long value) { + addCriterion("merchant_id >", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdGreaterThanOrEqualTo(Long value) { + addCriterion("merchant_id >=", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdLessThan(Long value) { + addCriterion("merchant_id <", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdLessThanOrEqualTo(Long value) { + addCriterion("merchant_id <=", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdIn(List values) { + addCriterion("merchant_id in", values, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdNotIn(List values) { + addCriterion("merchant_id not in", values, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdBetween(Long value1, Long value2) { + addCriterion("merchant_id between", value1, value2, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdNotBetween(Long value1, Long value2) { + addCriterion("merchant_id not between", value1, value2, "merchantId"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeIsNull() { + addCriterion("coupon_sales_code is null"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeIsNotNull() { + addCriterion("coupon_sales_code is not null"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeEqualTo(String value) { + addCriterion("coupon_sales_code =", value, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeNotEqualTo(String value) { + addCriterion("coupon_sales_code <>", value, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeGreaterThan(String value) { + addCriterion("coupon_sales_code >", value, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeGreaterThanOrEqualTo(String value) { + addCriterion("coupon_sales_code >=", value, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeLessThan(String value) { + addCriterion("coupon_sales_code <", value, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeLessThanOrEqualTo(String value) { + addCriterion("coupon_sales_code <=", value, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeLike(String value) { + addCriterion("coupon_sales_code like", value, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeNotLike(String value) { + addCriterion("coupon_sales_code not like", value, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeIn(List values) { + addCriterion("coupon_sales_code in", values, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeNotIn(List values) { + addCriterion("coupon_sales_code not in", values, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeBetween(String value1, String value2) { + addCriterion("coupon_sales_code between", value1, value2, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponSalesCodeNotBetween(String value1, String value2) { + addCriterion("coupon_sales_code not between", value1, value2, "couponSalesCode"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdIsNull() { + addCriterion("coupon_code_id is null"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdIsNotNull() { + addCriterion("coupon_code_id is not null"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdEqualTo(Long value) { + addCriterion("coupon_code_id =", value, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdNotEqualTo(Long value) { + addCriterion("coupon_code_id <>", value, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdGreaterThan(Long value) { + addCriterion("coupon_code_id >", value, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdGreaterThanOrEqualTo(Long value) { + addCriterion("coupon_code_id >=", value, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdLessThan(Long value) { + addCriterion("coupon_code_id <", value, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdLessThanOrEqualTo(Long value) { + addCriterion("coupon_code_id <=", value, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdIn(List values) { + addCriterion("coupon_code_id in", values, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdNotIn(List values) { + addCriterion("coupon_code_id not in", values, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdBetween(Long value1, Long value2) { + addCriterion("coupon_code_id between", value1, value2, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andCouponCodeIdNotBetween(Long value1, Long value2) { + addCriterion("coupon_code_id not between", value1, value2, "couponCodeId"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNull() { + addCriterion("user_phone is null"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNotNull() { + addCriterion("user_phone is not null"); + return (Criteria) this; + } + + public Criteria andUserPhoneEqualTo(String value) { + addCriterion("user_phone =", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotEqualTo(String value) { + addCriterion("user_phone <>", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThan(String value) { + addCriterion("user_phone >", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThanOrEqualTo(String value) { + addCriterion("user_phone >=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThan(String value) { + addCriterion("user_phone <", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThanOrEqualTo(String value) { + addCriterion("user_phone <=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLike(String value) { + addCriterion("user_phone like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotLike(String value) { + addCriterion("user_phone not like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneIn(List values) { + addCriterion("user_phone in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotIn(List values) { + addCriterion("user_phone not in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneBetween(String value1, String value2) { + addCriterion("user_phone between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotBetween(String value1, String value2) { + addCriterion("user_phone not between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andOrderNoIsNull() { + addCriterion("order_no is null"); + return (Criteria) this; + } + + public Criteria andOrderNoIsNotNull() { + addCriterion("order_no is not null"); + return (Criteria) this; + } + + public Criteria andOrderNoEqualTo(String value) { + addCriterion("order_no =", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotEqualTo(String value) { + addCriterion("order_no <>", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThan(String value) { + addCriterion("order_no >", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThanOrEqualTo(String value) { + addCriterion("order_no >=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThan(String value) { + addCriterion("order_no <", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThanOrEqualTo(String value) { + addCriterion("order_no <=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLike(String value) { + addCriterion("order_no like", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotLike(String value) { + addCriterion("order_no not like", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoIn(List values) { + addCriterion("order_no in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotIn(List values) { + addCriterion("order_no not in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoBetween(String value1, String value2) { + addCriterion("order_no between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotBetween(String value1, String value2) { + addCriterion("order_no not between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderIdIsNull() { + addCriterion("order_id is null"); + return (Criteria) this; + } + + public Criteria andOrderIdIsNotNull() { + addCriterion("order_id is not null"); + return (Criteria) this; + } + + public Criteria andOrderIdEqualTo(Long value) { + addCriterion("order_id =", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotEqualTo(Long value) { + addCriterion("order_id <>", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdGreaterThan(Long value) { + addCriterion("order_id >", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdGreaterThanOrEqualTo(Long value) { + addCriterion("order_id >=", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdLessThan(Long value) { + addCriterion("order_id <", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdLessThanOrEqualTo(Long value) { + addCriterion("order_id <=", value, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdIn(List values) { + addCriterion("order_id in", values, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotIn(List values) { + addCriterion("order_id not in", values, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdBetween(Long value1, Long value2) { + addCriterion("order_id between", value1, value2, "orderId"); + return (Criteria) this; + } + + public Criteria andOrderIdNotBetween(Long value1, Long value2) { + addCriterion("order_id not between", value1, value2, "orderId"); + return (Criteria) this; + } + + public Criteria andReceiveTimeIsNull() { + addCriterion("receive_time is null"); + return (Criteria) this; + } + + public Criteria andReceiveTimeIsNotNull() { + addCriterion("receive_time is not null"); + return (Criteria) this; + } + + public Criteria andReceiveTimeEqualTo(Date value) { + addCriterion("receive_time =", value, "receiveTime"); + return (Criteria) this; + } + + public Criteria andReceiveTimeNotEqualTo(Date value) { + addCriterion("receive_time <>", value, "receiveTime"); + return (Criteria) this; + } + + public Criteria andReceiveTimeGreaterThan(Date value) { + addCriterion("receive_time >", value, "receiveTime"); + return (Criteria) this; + } + + public Criteria andReceiveTimeGreaterThanOrEqualTo(Date value) { + addCriterion("receive_time >=", value, "receiveTime"); + return (Criteria) this; + } + + public Criteria andReceiveTimeLessThan(Date value) { + addCriterion("receive_time <", value, "receiveTime"); + return (Criteria) this; + } + + public Criteria andReceiveTimeLessThanOrEqualTo(Date value) { + addCriterion("receive_time <=", value, "receiveTime"); + return (Criteria) this; + } + + public Criteria andReceiveTimeIn(List values) { + addCriterion("receive_time in", values, "receiveTime"); + return (Criteria) this; + } + + public Criteria andReceiveTimeNotIn(List values) { + addCriterion("receive_time not in", values, "receiveTime"); + return (Criteria) this; + } + + public Criteria andReceiveTimeBetween(Date value1, Date value2) { + addCriterion("receive_time between", value1, value2, "receiveTime"); + return (Criteria) this; + } + + public Criteria andReceiveTimeNotBetween(Date value1, Date value2) { + addCriterion("receive_time not between", value1, value2, "receiveTime"); + 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 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 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 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 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/hai-service/src/main/java/com/hai/entity/HighGoodsPriceRefer.java b/hai-service/src/main/java/com/hai/entity/HighGoodsPriceRefer.java index e8cebc31..3c582633 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGoodsPriceRefer.java +++ b/hai-service/src/main/java/com/hai/entity/HighGoodsPriceRefer.java @@ -1,6 +1,7 @@ package com.hai.entity; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -31,7 +32,7 @@ public class HighGoodsPriceRefer implements Serializable { /** * 新销售价格 */ - private Float newSalePrice; + private BigDecimal newSalePrice; /** * 及时生效 0:否 1:是 @@ -64,7 +65,7 @@ public class HighGoodsPriceRefer implements Serializable { private String operatorName; /** - * 状态: 0:删除 1:未生效 2:已生效 3:已失效 101.审批中 102.审批驳回 + * 状态: 0:删除 1:待编辑 2:待生效 3:已生效 4:已失效 101.审批中 102.审批驳回 */ private Integer status; @@ -100,11 +101,11 @@ public class HighGoodsPriceRefer implements Serializable { this.objectId = objectId; } - public Float getNewSalePrice() { + public BigDecimal getNewSalePrice() { return newSalePrice; } - public void setNewSalePrice(Float newSalePrice) { + public void setNewSalePrice(BigDecimal newSalePrice) { this.newSalePrice = newSalePrice; } diff --git a/hai-service/src/main/java/com/hai/entity/HighGoodsPriceReferExample.java b/hai-service/src/main/java/com/hai/entity/HighGoodsPriceReferExample.java index ba483a9a..e2ee1161 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGoodsPriceReferExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighGoodsPriceReferExample.java @@ -1,5 +1,6 @@ package com.hai.entity; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -315,52 +316,52 @@ public class HighGoodsPriceReferExample { return (Criteria) this; } - public Criteria andNewSalePriceEqualTo(Float value) { + public Criteria andNewSalePriceEqualTo(BigDecimal value) { addCriterion("new_sale_price =", value, "newSalePrice"); return (Criteria) this; } - public Criteria andNewSalePriceNotEqualTo(Float value) { + public Criteria andNewSalePriceNotEqualTo(BigDecimal value) { addCriterion("new_sale_price <>", value, "newSalePrice"); return (Criteria) this; } - public Criteria andNewSalePriceGreaterThan(Float value) { + public Criteria andNewSalePriceGreaterThan(BigDecimal value) { addCriterion("new_sale_price >", value, "newSalePrice"); return (Criteria) this; } - public Criteria andNewSalePriceGreaterThanOrEqualTo(Float value) { + public Criteria andNewSalePriceGreaterThanOrEqualTo(BigDecimal value) { addCriterion("new_sale_price >=", value, "newSalePrice"); return (Criteria) this; } - public Criteria andNewSalePriceLessThan(Float value) { + public Criteria andNewSalePriceLessThan(BigDecimal value) { addCriterion("new_sale_price <", value, "newSalePrice"); return (Criteria) this; } - public Criteria andNewSalePriceLessThanOrEqualTo(Float value) { + public Criteria andNewSalePriceLessThanOrEqualTo(BigDecimal value) { addCriterion("new_sale_price <=", value, "newSalePrice"); return (Criteria) this; } - public Criteria andNewSalePriceIn(List values) { + public Criteria andNewSalePriceIn(List values) { addCriterion("new_sale_price in", values, "newSalePrice"); return (Criteria) this; } - public Criteria andNewSalePriceNotIn(List values) { + public Criteria andNewSalePriceNotIn(List values) { addCriterion("new_sale_price not in", values, "newSalePrice"); return (Criteria) this; } - public Criteria andNewSalePriceBetween(Float value1, Float value2) { + public Criteria andNewSalePriceBetween(BigDecimal value1, BigDecimal value2) { addCriterion("new_sale_price between", value1, value2, "newSalePrice"); return (Criteria) this; } - public Criteria andNewSalePriceNotBetween(Float value1, Float value2) { + public Criteria andNewSalePriceNotBetween(BigDecimal value1, BigDecimal value2) { addCriterion("new_sale_price not between", value1, value2, "newSalePrice"); return (Criteria) this; } diff --git a/hai-service/src/main/java/com/hai/enum_type/ApproveType.java b/hai-service/src/main/java/com/hai/enum_type/ApproveType.java new file mode 100644 index 00000000..7a82fad3 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/ApproveType.java @@ -0,0 +1,36 @@ +package com.hai.enum_type; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/14 20:41 + */ +public enum ApproveType { + UP_SHELF_APPROVE(1, "卡卷上架审批") + ; + + private Integer type; + + private String name; + + ApproveType(int type, String name) { + this.type = type; + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighApproveService.java b/hai-service/src/main/java/com/hai/service/HighApproveService.java new file mode 100644 index 00000000..fde1e1c1 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighApproveService.java @@ -0,0 +1,19 @@ +package com.hai.service; + +import com.hai.entity.HighApprove; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/14 20:46 + */ +public interface HighApproveService { + + /** + * @Author 胡锐 + * @Description 增加审批 + * @Date 2021/3/14 20:46 + **/ + void insertApprove(HighApprove highApprove); + +} diff --git a/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java new file mode 100644 index 00000000..44b20793 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighCouponCodeService.java @@ -0,0 +1,19 @@ +package com.hai.service; + +import com.hai.entity.HighCouponCode; + +/** + * @Auther: 胡锐 + * @Description: 卡券销售码 + * @Date: 2021/3/14 17:44 + */ +public interface HighCouponCodeService { + + /** + * @Author 胡锐 + * @Description 增加 + * @Date 2021/3/14 17:44 + **/ + void insertCouponCode(HighCouponCode highCouponCode); + +} diff --git a/hai-service/src/main/java/com/hai/service/HighCouponService.java b/hai-service/src/main/java/com/hai/service/HighCouponService.java index 01661c65..4bcd07f9 100644 --- a/hai-service/src/main/java/com/hai/service/HighCouponService.java +++ b/hai-service/src/main/java/com/hai/service/HighCouponService.java @@ -12,16 +12,45 @@ public interface HighCouponService { /** * @Author 胡锐 - * @Description 增加 + * @Description 增加卡卷业务 * @Date 2021/3/11 22:05 **/ void insertCoupon(HighCouponModel highCouponModel); /** * @Author 胡锐 - * @Description 修改 + * @Description 修改卡卷业务 * @Date 2021/3/12 20:41 **/ void updateCoupon(HighCouponModel highCouponModel); + /** + * @Author 胡锐 + * @Description 修改卡卷信息 + * @Date 2021/3/14 20:52 + **/ + void update(HighCoupon highCoupon); + + /** + * @Author 胡锐 + * @Description 卡卷上架 + * @Date 2021/3/14 22:46 + **/ + void upShelfApprove(Long id); + + /** + * @Author 胡锐 + * @Description 卡卷下架 + * @Date 2021/3/14 20:56 + **/ + void ofShelfApprove(Long id); + + + /** + * @Author 胡锐 + * @Description 根据id查询 + * @Date 2021/3/14 16:58 + **/ + HighCouponModel getCouponById(Long id); + } diff --git a/hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java b/hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java new file mode 100644 index 00000000..f681dd16 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java @@ -0,0 +1,36 @@ +package com.hai.service; + +import com.hai.entity.HighGoodsPriceRefer; + +import java.util.List; +import java.util.Map; + +/** + * @Auther: 胡锐 + * @Description: 产品销售价格配置 + * @Date: 2021/3/14 16:25 + */ +public interface HighGoodsPriceReferService { + + /** + * @Author 胡锐 + * @Description 增加 + * @Date 2021/3/14 16:26 + **/ + void insertPriceRefer(HighGoodsPriceRefer highGoodsPriceRefer); + + /** + * @Author 胡锐 + * @Description 卡卷价格 处于待编辑、已生效、待生效、审批中 全部失效 + * @Date 2021/3/14 20:14 + **/ + void couponAllPriceInvalid(Long couponId); + + /** + * @Author 胡锐 + * @Description 卡卷价格 处于待编辑、待生效、审批中 全部失效。但保留当前生效的价格 + * @Date 2021/3/14 21:00 + **/ + void couponAllInvalidKeepCurrent(Long couponId); + +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java new file mode 100644 index 00000000..65bf4932 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java @@ -0,0 +1,46 @@ +package com.hai.service.impl; + +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.dao.HighApproveMapper; +import com.hai.entity.HighApprove; +import com.hai.entity.HighCoupon; +import com.hai.enum_type.ApproveType; +import com.hai.model.HighCouponModel; +import com.hai.service.HighApproveService; +import com.hai.service.HighCouponService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.Objects; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/14 20:47 + */ +@Service("highApproveService") +public class HighApproveServiceImpl implements HighApproveService { + + @Resource + private HighApproveMapper highApproveMapper; + + @Resource + private HighCouponService highCouponService; + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW) + public void insertApprove(HighApprove highApprove) { + + // 卡卷上架审批 + if (Objects.equals(highApprove.getObjectType(), ApproveType.UP_SHELF_APPROVE.getType())) { + highCouponService.upShelfApprove(highApprove.getObjectId()); + } + + highApproveMapper.insert(highApprove); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java new file mode 100644 index 00000000..f0a387b4 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java @@ -0,0 +1,27 @@ +package com.hai.service.impl; + +import com.hai.dao.HighCouponCodeMapper; +import com.hai.entity.HighCoupon; +import com.hai.entity.HighCouponCode; +import com.hai.model.HighCouponModel; +import com.hai.service.HighCouponCodeService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/14 17:45 + */ +@Service("highCouponCodeService") +public class HighCouponCodeServiceImpl implements HighCouponCodeService { + + @Resource + private HighCouponCodeMapper highCouponCodeMapper; + + @Override + public void insertCouponCode(HighCouponCode highCouponCode) { + highCouponCodeMapper.insert(highCouponCode); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 6b7712a2..3cecb208 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -1,13 +1,22 @@ package com.hai.service.impl; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; import com.hai.dao.HighCouponHandselMapper; import com.hai.dao.HighCouponMapper; import com.hai.entity.HighCoupon; +import com.hai.entity.HighCouponCode; import com.hai.entity.HighCouponHandsel; +import com.hai.entity.HighGoodsPriceRefer; import com.hai.model.HighCouponHandselModel; import com.hai.model.HighCouponModel; +import com.hai.service.HighCouponCodeService; import com.hai.service.HighCouponService; +import com.hai.service.HighGoodsPriceReferService; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; @@ -28,10 +37,14 @@ public class HighCouponServiceImpl implements HighCouponService { @Resource private HighCouponHandselMapper highCouponHandselMapper; + @Resource + private HighGoodsPriceReferService highGoodsPriceReferService; + @Resource + private HighCouponCodeService highCouponCodeService; @Override - @Transactional + @Transactional(propagation= Propagation.REQUIRES_NEW) public void insertCoupon(HighCouponModel highCouponModel) { highCouponMapper.insert(highCouponModel); @@ -42,10 +55,23 @@ public class HighCouponServiceImpl implements HighCouponService { highCouponHandselMapper.insert(handsel); } } + + HighGoodsPriceRefer goodsPriceRefer = new HighGoodsPriceRefer(); + goodsPriceRefer.setObjectType(1); + goodsPriceRefer.setObjectId(highCouponModel.getId()); + goodsPriceRefer.setNewSalePrice(highCouponModel.getSalesPrice()); + goodsPriceRefer.setPromptlyType(true); + goodsPriceRefer.setEffectiveTime(new Date()); + goodsPriceRefer.setRemark("【创建产品】初始销售价格"); + goodsPriceRefer.setStatus(1); // 状态: 0:删除 1:待编辑 2:未生效 3:已生效 4:已失效 101.审批中 102.审批驳回 + goodsPriceRefer.setCreateTime(new Date()); + goodsPriceRefer.setOperatorId(highCouponModel.getOperatorId()); + goodsPriceRefer.setOperatorName(highCouponModel.getOperatorName()); + highGoodsPriceReferService.insertPriceRefer(goodsPriceRefer); } @Override - @Transactional + @Transactional(propagation= Propagation.REQUIRES_NEW) public void updateCoupon(HighCouponModel highCouponModel) { highCouponMapper.updateByPrimaryKey(highCouponModel); @@ -63,5 +89,77 @@ public class HighCouponServiceImpl implements HighCouponService { } } } + + // 查询卡卷 如果卡卷销售价格进行了修改 + HighCouponModel coupon = getCouponById(highCouponModel.getId()); + if (!coupon.getCouponPrice().equals(highCouponModel.getCouponPrice())) { + // 所有价格失效 + highGoodsPriceReferService.couponAllPriceInvalid(highCouponModel.getId()); + + // 增加新价格 + HighGoodsPriceRefer goodsPriceRefer = new HighGoodsPriceRefer(); + goodsPriceRefer.setObjectType(1); + goodsPriceRefer.setObjectId(highCouponModel.getId()); + goodsPriceRefer.setNewSalePrice(highCouponModel.getSalesPrice()); + goodsPriceRefer.setPromptlyType(true); + goodsPriceRefer.setEffectiveTime(new Date()); + goodsPriceRefer.setRemark("【修改卡卷】修改销售价格"); + goodsPriceRefer.setStatus(1); // 状态: 0:删除 1:待编辑 2:未生效 3:已生效 4:已失效 101.审批中 102.审批驳回 + goodsPriceRefer.setCreateTime(new Date()); + goodsPriceRefer.setOperatorId(highCouponModel.getOperatorId()); + goodsPriceRefer.setOperatorName(highCouponModel.getOperatorName()); + highGoodsPriceReferService.insertPriceRefer(goodsPriceRefer); + } + + } + + @Override + public void update(HighCoupon highCoupon) { + highCouponMapper.updateByPrimaryKey(highCoupon); + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW) + public void upShelfApprove(Long id) { + // 查询卡卷 + HighCouponModel coupon = getCouponById(id); + if (coupon == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, ""); + } + coupon.setStatus(101); // 状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回 + coupon.setUpdateTime(new Date()); + update(coupon); + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW) + public void ofShelfApprove(Long id) { + HighCouponModel coupon = getCouponById(id); + if (coupon == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, ""); + } + //状态:0.删除 1.编辑中 2.已上架 3.已下架 101.上架审批中 102.上架审批驳回 + if (coupon.getStatus() != 2) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_UNABLE_UP_SHELF, ""); + } + coupon.setStatus(3); + highCouponMapper.updateByPrimaryKey(coupon); + + // 卡卷价格全部失效。但保留当前生效的价格 + highGoodsPriceReferService.couponAllInvalidKeepCurrent(coupon.getId()); + + } + + @Override + public HighCouponModel getCouponById(Long id) { + HighCoupon highCoupon = highCouponMapper.selectByPrimaryKey(id); + if (highCoupon == null) { + return null; + } + HighCouponModel model = new HighCouponModel(); + BeanUtils.copyProperties(highCoupon, model); + + + return model; } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java new file mode 100644 index 00000000..d9141137 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java @@ -0,0 +1,71 @@ +package com.hai.service.impl; + +import com.hai.dao.HighGoodsPriceReferMapper; +import com.hai.entity.HighGoodsPriceRefer; +import com.hai.entity.HighGoodsPriceReferExample; +import com.hai.entity.HighMerchant; +import com.hai.service.HighGoodsPriceReferService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @Auther: 胡锐 + * @Description: 产品销售价格配置 + * @Date: 2021/3/14 16:26 + */ +@Service("highGoodsPriceReferService") +public class HighGoodsPriceReferServiceImpl implements HighGoodsPriceReferService { + + @Resource + private HighGoodsPriceReferMapper highGoodsPriceReferMapper; + + @Override + public void insertPriceRefer(HighGoodsPriceRefer highGoodsPriceRefer) { + highGoodsPriceReferMapper.insert(highGoodsPriceRefer); + } + + @Override + public void couponAllPriceInvalid(Long couponId) { + List statusList = new ArrayList<>(); + statusList.add(1); + statusList.add(2); + statusList.add(3); + statusList.add(101); + HighGoodsPriceReferExample example = new HighGoodsPriceReferExample(); + example.createCriteria().andObjectIdEqualTo(couponId).andStatusIn(statusList); + + List referList = highGoodsPriceReferMapper.selectByExample(example); + if (referList != null && referList.size() > 0) { + for (HighGoodsPriceRefer refer : referList) { + refer.setStatus(4); + highGoodsPriceReferMapper.updateByPrimaryKey(refer); + } + } + } + + @Override + public void couponAllInvalidKeepCurrent(Long couponId) { + List statusList = new ArrayList<>(); + statusList.add(1); + statusList.add(2); + statusList.add(101); + + HighGoodsPriceReferExample example = new HighGoodsPriceReferExample(); + example.createCriteria().andObjectIdEqualTo(couponId).andStatusIn(statusList); + + List referList = highGoodsPriceReferMapper.selectByExample(example); + if (referList != null && referList.size() > 0) { + for (HighGoodsPriceRefer refer : referList) { + refer.setStatus(4); + highGoodsPriceReferMapper.updateByPrimaryKey(refer); + } + } + } + + +}