From 25916061ec634ee034a3513ac21d65789d815dee Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 22 Aug 2023 10:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HighDiscountAgentBatchController.java | 100 ++ .../HighDiscountAgentRelController.java | 46 + .../controller/HighDiscountController.java | 15 +- .../hai/dao/HighDiscountAgentBatchMapper.java | 155 ++ .../dao/HighDiscountAgentBatchMapperExt.java | 53 + .../HighDiscountAgentBatchSqlProvider.java | 430 +++++ .../hai/dao/HighDiscountAgentCodeMapper.java | 20 +- .../dao/HighDiscountAgentCodeSqlProvider.java | 14 + .../hai/entity/HighDiscountAgentBatch.java | 345 ++++ .../entity/HighDiscountAgentBatchExample.java | 1444 +++++++++++++++++ .../com/hai/entity/HighDiscountAgentCode.java | 20 +- .../entity/HighDiscountAgentCodeExample.java | 60 + .../HighDiscountAgentBatchService.java | 40 + .../service/HighDiscountAgentRelService.java | 7 + .../com/hai/service/HighDiscountService.java | 3 +- .../HighDiscountAgentBatchServiceImpl.java | 55 + .../impl/HighDiscountAgentRelServiceImpl.java | 39 +- .../service/impl/HighDiscountServiceImpl.java | 15 + 18 files changed, 2846 insertions(+), 15 deletions(-) create mode 100644 hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentBatchController.java create mode 100644 hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapper.java create mode 100644 hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapperExt.java create mode 100644 hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchSqlProvider.java create mode 100644 hai-service/src/main/java/com/hai/entity/HighDiscountAgentBatch.java create mode 100644 hai-service/src/main/java/com/hai/entity/HighDiscountAgentBatchExample.java create mode 100644 hai-service/src/main/java/com/hai/service/HighDiscountAgentBatchService.java create mode 100644 hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentBatchServiceImpl.java diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentBatchController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentBatchController.java new file mode 100644 index 00000000..53c55c0a --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentBatchController.java @@ -0,0 +1,100 @@ +package com.bweb.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.fastjson.JSONObject; +import com.bweb.config.SysConst; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.security.AESEncodeUtil; +import com.hai.common.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.CommonSysConst; +import com.hai.entity.*; +import com.hai.model.DiscountUseConditionModel; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/4/4 00:19 + */ +@Controller +@RequestMapping(value = "/discountAgentBatch") +@Api(value = "优惠券和代理商接口") +public class HighDiscountAgentBatchController { + + private static Logger log = LoggerFactory.getLogger(HighDiscountAgentBatchController.class); + @Resource + private HighDiscountAgentBatchService highDiscountAgentBatchService; + + @RequestMapping(value="/replenish",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "批次补充") + public ResponseData replenish(@RequestBody JSONObject jsonObject) { + try { + + String batchIdentifier = jsonObject.getString("batchIdentifier"); + Long mailTime = jsonObject.getLong("mailTime"); + Integer batchNum = jsonObject.getInteger("batchNum"); + + if (StringUtils.isBlank(batchIdentifier)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询数据 + HighDiscountAgentBatch batch = highDiscountAgentBatchService.getBatchByIdentifier(batchIdentifier); + if (batch == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "批次不存在"); + } + if (mailTime != null) { + batch.setMailTime(new Date(mailTime)); + } + if (batchNum != null) { + batch.setBatchNum(batch.getBatchNum().intValue() + batchNum); + } + highDiscountAgentBatchService.editData(batch); + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighDiscountAgentBatchController -> replenish() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getBatchDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询批次详情") + public ResponseData getBatchDetail(@RequestParam(name = "batchIdentifier", required = true) String batchIdentifier) { + try { + + return ResponseMsgUtil.success(highDiscountAgentBatchService.getBatchByIdentifier(batchIdentifier)); + + } catch (Exception e) { + log.error("HighDiscountController -> getBatchDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java index 35e088fa..60888e09 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java @@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.io.File; +import java.math.BigDecimal; import java.net.URLEncoder; import java.util.Date; import java.util.HashMap; @@ -75,6 +76,9 @@ public class HighDiscountAgentRelController { @Resource private HighOrderService highOrderService; + @Resource + private HighDiscountAgentBatchService highDiscountAgentBatchService; + @RequestMapping(value="/insertDiscountAgent",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "分配优惠券给代理商") @@ -110,9 +114,11 @@ public class HighDiscountAgentRelController { HighDiscountAgentRel discountAgent = highDiscountAgentRelService.getRelByDiscountAgent(highDiscountAgentRel.getDiscountId(), highDiscountAgentRel.getAgentId()); // 是否已分配 if (discountAgent != null) { + discountAgent.setHighDiscount(discount); discountAgent.setStockCount(discountAgent.getStockCount() + highDiscountAgentRel.getStockCount()); highDiscountAgentRelService.insertDiscountAgentRel(discountAgent,highDiscountAgentRel.getStockCount()); } else { + highDiscountAgentRel.setHighDiscount(discount); highDiscountAgentRel.setCreateTime(new Date()); highDiscountAgentRel.setStatus(1); highDiscountAgentRelService.insertDiscountAgentRel(highDiscountAgentRel,highDiscountAgentRel.getStockCount()); @@ -380,4 +386,44 @@ public class HighDiscountAgentRelController { } } + + @RequestMapping(value="/getBatchUseCount",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询优惠券使用统计") + public ResponseData getBatchUseCount(@RequestParam(name = "usingRange", required = false) Integer usingRange, + @RequestParam(name = "price", required = false) BigDecimal price, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("usingRange", usingRange); + param.put("price", price); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highDiscountAgentBatchService.getUsageCount(param))); + + } catch (Exception e) { + log.error("HighDiscountController -> getBatchUseCount() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getCount",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询统计") + public ResponseData getCount(@RequestParam(name = "usingRange", required = false) Integer usingRange, + @RequestParam(name = "price", required = false) BigDecimal price) { + try { + Map param = new HashMap<>(); + param.put("usingRange", usingRange); + param.put("price", price); + + return ResponseMsgUtil.success(highDiscountAgentBatchService.getCount(param)); + + } catch (Exception e) { + log.error("HighDiscountController -> getCount() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java index 888d5206..ffcd1c9d 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java @@ -190,7 +190,6 @@ public class HighDiscountController { @RequestMapping(value="/getDiscountList",method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "查询优惠券列表") public ResponseData getDiscountList(@RequestParam(name = "discountKey", required = false) String discountKey, @RequestParam(name = "discountName", required = false) String discountName, @@ -221,4 +220,18 @@ public class HighDiscountController { } } + @RequestMapping(value="/getDiscountPrice",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询优惠券金额") + public ResponseData getDiscountPrice(@RequestParam(name = "usingRange", required = true) Integer usingRange) { + try { + + return ResponseMsgUtil.success(highDiscountService.getDiscountPrice(usingRange)); + + } catch (Exception e) { + log.error("HighDiscountController -> getDiscountPrice() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapper.java new file mode 100644 index 00000000..24e2f268 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapper.java @@ -0,0 +1,155 @@ +package com.hai.dao; + +import com.hai.entity.HighDiscountAgentBatch; +import com.hai.entity.HighDiscountAgentBatchExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface HighDiscountAgentBatchMapper extends HighDiscountAgentBatchMapperExt { + @SelectProvider(type=HighDiscountAgentBatchSqlProvider.class, method="countByExample") + long countByExample(HighDiscountAgentBatchExample example); + + @DeleteProvider(type=HighDiscountAgentBatchSqlProvider.class, method="deleteByExample") + int deleteByExample(HighDiscountAgentBatchExample example); + + @Delete({ + "delete from high_discount_agent_batch", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_discount_agent_batch (discount_agent_id, discount_id, ", + "discount_name, discount_price, ", + "using_range, use_scope, ", + "agent_id, batch_identifier, ", + "batch_num, code_start, ", + "code_end, mail_time, ", + "create_time, `status`, ", + "qr_code, ext_1, ext_2, ", + "ext_3)", + "values (#{discountAgentId,jdbcType=BIGINT}, #{discountId,jdbcType=BIGINT}, ", + "#{discountName,jdbcType=VARCHAR}, #{discountPrice,jdbcType=DECIMAL}, ", + "#{usingRange,jdbcType=INTEGER}, #{useScope,jdbcType=INTEGER}, ", + "#{agentId,jdbcType=BIGINT}, #{batchIdentifier,jdbcType=VARCHAR}, ", + "#{batchNum,jdbcType=INTEGER}, #{codeStart,jdbcType=VARCHAR}, ", + "#{codeEnd,jdbcType=VARCHAR}, #{mailTime,jdbcType=TIMESTAMP}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{qrCode,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", + "#{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighDiscountAgentBatch record); + + @InsertProvider(type=HighDiscountAgentBatchSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighDiscountAgentBatch record); + + @SelectProvider(type=HighDiscountAgentBatchSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_agent_id", property="discountAgentId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="using_range", property="usingRange", jdbcType=JdbcType.INTEGER), + @Result(column="use_scope", property="useScope", jdbcType=JdbcType.INTEGER), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="batch_identifier", property="batchIdentifier", jdbcType=JdbcType.VARCHAR), + @Result(column="batch_num", property="batchNum", jdbcType=JdbcType.INTEGER), + @Result(column="code_start", property="codeStart", jdbcType=JdbcType.VARCHAR), + @Result(column="code_end", property="codeEnd", jdbcType=JdbcType.VARCHAR), + @Result(column="mail_time", property="mailTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(HighDiscountAgentBatchExample example); + + @Select({ + "select", + "id, discount_agent_id, discount_id, discount_name, discount_price, using_range, ", + "use_scope, agent_id, batch_identifier, batch_num, code_start, code_end, mail_time, ", + "create_time, `status`, qr_code, ext_1, ext_2, ext_3", + "from high_discount_agent_batch", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_agent_id", property="discountAgentId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="using_range", property="usingRange", jdbcType=JdbcType.INTEGER), + @Result(column="use_scope", property="useScope", jdbcType=JdbcType.INTEGER), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="batch_identifier", property="batchIdentifier", jdbcType=JdbcType.VARCHAR), + @Result(column="batch_num", property="batchNum", jdbcType=JdbcType.INTEGER), + @Result(column="code_start", property="codeStart", jdbcType=JdbcType.VARCHAR), + @Result(column="code_end", property="codeEnd", jdbcType=JdbcType.VARCHAR), + @Result(column="mail_time", property="mailTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + HighDiscountAgentBatch selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighDiscountAgentBatchSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighDiscountAgentBatch record, @Param("example") HighDiscountAgentBatchExample example); + + @UpdateProvider(type=HighDiscountAgentBatchSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighDiscountAgentBatch record, @Param("example") HighDiscountAgentBatchExample example); + + @UpdateProvider(type=HighDiscountAgentBatchSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighDiscountAgentBatch record); + + @Update({ + "update high_discount_agent_batch", + "set discount_agent_id = #{discountAgentId,jdbcType=BIGINT},", + "discount_id = #{discountId,jdbcType=BIGINT},", + "discount_name = #{discountName,jdbcType=VARCHAR},", + "discount_price = #{discountPrice,jdbcType=DECIMAL},", + "using_range = #{usingRange,jdbcType=INTEGER},", + "use_scope = #{useScope,jdbcType=INTEGER},", + "agent_id = #{agentId,jdbcType=BIGINT},", + "batch_identifier = #{batchIdentifier,jdbcType=VARCHAR},", + "batch_num = #{batchNum,jdbcType=INTEGER},", + "code_start = #{codeStart,jdbcType=VARCHAR},", + "code_end = #{codeEnd,jdbcType=VARCHAR},", + "mail_time = #{mailTime,jdbcType=TIMESTAMP},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "qr_code = #{qrCode,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighDiscountAgentBatch record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapperExt.java new file mode 100644 index 00000000..0391fad2 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapperExt.java @@ -0,0 +1,53 @@ +package com.hai.dao; + + +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +/** + * mapper扩展类 + */ +public interface HighDiscountAgentBatchMapperExt { + + @Select("") + List> queryUsageCount(@Param("param") Map param); + + @Select("") + Map queryCount(@Param("param") Map param); +} diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchSqlProvider.java new file mode 100644 index 00000000..da1fba58 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchSqlProvider.java @@ -0,0 +1,430 @@ +package com.hai.dao; + +import com.hai.entity.HighDiscountAgentBatch; +import com.hai.entity.HighDiscountAgentBatchExample.Criteria; +import com.hai.entity.HighDiscountAgentBatchExample.Criterion; +import com.hai.entity.HighDiscountAgentBatchExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighDiscountAgentBatchSqlProvider { + + public String countByExample(HighDiscountAgentBatchExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_discount_agent_batch"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighDiscountAgentBatchExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_discount_agent_batch"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighDiscountAgentBatch record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_discount_agent_batch"); + + if (record.getDiscountAgentId() != null) { + sql.VALUES("discount_agent_id", "#{discountAgentId,jdbcType=BIGINT}"); + } + + if (record.getDiscountId() != null) { + sql.VALUES("discount_id", "#{discountId,jdbcType=BIGINT}"); + } + + if (record.getDiscountName() != null) { + sql.VALUES("discount_name", "#{discountName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountPrice() != null) { + sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}"); + } + + if (record.getUsingRange() != null) { + sql.VALUES("using_range", "#{usingRange,jdbcType=INTEGER}"); + } + + if (record.getUseScope() != null) { + sql.VALUES("use_scope", "#{useScope,jdbcType=INTEGER}"); + } + + if (record.getAgentId() != null) { + sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}"); + } + + if (record.getBatchIdentifier() != null) { + sql.VALUES("batch_identifier", "#{batchIdentifier,jdbcType=VARCHAR}"); + } + + if (record.getBatchNum() != null) { + sql.VALUES("batch_num", "#{batchNum,jdbcType=INTEGER}"); + } + + if (record.getCodeStart() != null) { + sql.VALUES("code_start", "#{codeStart,jdbcType=VARCHAR}"); + } + + if (record.getCodeEnd() != null) { + sql.VALUES("code_end", "#{codeEnd,jdbcType=VARCHAR}"); + } + + if (record.getMailTime() != null) { + sql.VALUES("mail_time", "#{mailTime,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.getQrCode() != null) { + sql.VALUES("qr_code", "#{qrCode,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(HighDiscountAgentBatchExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("discount_agent_id"); + sql.SELECT("discount_id"); + sql.SELECT("discount_name"); + sql.SELECT("discount_price"); + sql.SELECT("using_range"); + sql.SELECT("use_scope"); + sql.SELECT("agent_id"); + sql.SELECT("batch_identifier"); + sql.SELECT("batch_num"); + sql.SELECT("code_start"); + sql.SELECT("code_end"); + sql.SELECT("mail_time"); + sql.SELECT("create_time"); + sql.SELECT("`status`"); + sql.SELECT("qr_code"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_discount_agent_batch"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighDiscountAgentBatch record = (HighDiscountAgentBatch) parameter.get("record"); + HighDiscountAgentBatchExample example = (HighDiscountAgentBatchExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_discount_agent_batch"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getDiscountAgentId() != null) { + sql.SET("discount_agent_id = #{record.discountAgentId,jdbcType=BIGINT}"); + } + + if (record.getDiscountId() != null) { + sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); + } + + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountPrice() != null) { + sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); + } + + if (record.getUsingRange() != null) { + sql.SET("using_range = #{record.usingRange,jdbcType=INTEGER}"); + } + + if (record.getUseScope() != null) { + sql.SET("use_scope = #{record.useScope,jdbcType=INTEGER}"); + } + + if (record.getAgentId() != null) { + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); + } + + if (record.getBatchIdentifier() != null) { + sql.SET("batch_identifier = #{record.batchIdentifier,jdbcType=VARCHAR}"); + } + + if (record.getBatchNum() != null) { + sql.SET("batch_num = #{record.batchNum,jdbcType=INTEGER}"); + } + + if (record.getCodeStart() != null) { + sql.SET("code_start = #{record.codeStart,jdbcType=VARCHAR}"); + } + + if (record.getCodeEnd() != null) { + sql.SET("code_end = #{record.codeEnd,jdbcType=VARCHAR}"); + } + + if (record.getMailTime() != null) { + sql.SET("mail_time = #{record.mailTime,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.getQrCode() != null) { + sql.SET("qr_code = #{record.qrCode,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("high_discount_agent_batch"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("discount_agent_id = #{record.discountAgentId,jdbcType=BIGINT}"); + sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); + sql.SET("using_range = #{record.usingRange,jdbcType=INTEGER}"); + sql.SET("use_scope = #{record.useScope,jdbcType=INTEGER}"); + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); + sql.SET("batch_identifier = #{record.batchIdentifier,jdbcType=VARCHAR}"); + sql.SET("batch_num = #{record.batchNum,jdbcType=INTEGER}"); + sql.SET("code_start = #{record.codeStart,jdbcType=VARCHAR}"); + sql.SET("code_end = #{record.codeEnd,jdbcType=VARCHAR}"); + sql.SET("mail_time = #{record.mailTime,jdbcType=TIMESTAMP}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("qr_code = #{record.qrCode,jdbcType=VARCHAR}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + HighDiscountAgentBatchExample example = (HighDiscountAgentBatchExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighDiscountAgentBatch record) { + SQL sql = new SQL(); + sql.UPDATE("high_discount_agent_batch"); + + if (record.getDiscountAgentId() != null) { + sql.SET("discount_agent_id = #{discountAgentId,jdbcType=BIGINT}"); + } + + if (record.getDiscountId() != null) { + sql.SET("discount_id = #{discountId,jdbcType=BIGINT}"); + } + + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{discountName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountPrice() != null) { + sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}"); + } + + if (record.getUsingRange() != null) { + sql.SET("using_range = #{usingRange,jdbcType=INTEGER}"); + } + + if (record.getUseScope() != null) { + sql.SET("use_scope = #{useScope,jdbcType=INTEGER}"); + } + + if (record.getAgentId() != null) { + sql.SET("agent_id = #{agentId,jdbcType=BIGINT}"); + } + + if (record.getBatchIdentifier() != null) { + sql.SET("batch_identifier = #{batchIdentifier,jdbcType=VARCHAR}"); + } + + if (record.getBatchNum() != null) { + sql.SET("batch_num = #{batchNum,jdbcType=INTEGER}"); + } + + if (record.getCodeStart() != null) { + sql.SET("code_start = #{codeStart,jdbcType=VARCHAR}"); + } + + if (record.getCodeEnd() != null) { + sql.SET("code_end = #{codeEnd,jdbcType=VARCHAR}"); + } + + if (record.getMailTime() != null) { + sql.SET("mail_time = #{mailTime,jdbcType=TIMESTAMP}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getQrCode() != null) { + sql.SET("qr_code = #{qrCode,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, HighDiscountAgentBatchExample 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/HighDiscountAgentCodeMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeMapper.java index 782a367a..5ca87ce6 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeMapper.java @@ -39,12 +39,14 @@ public interface HighDiscountAgentCodeMapper extends HighDiscountAgentCodeMapper int deleteByPrimaryKey(Long id); @Insert({ - "insert into high_discount_agent_code (discount_agent_id, qr_code, ", - "create_time, `status`, ", - "ext_1, ext_2, ext_3)", - "values (#{discountAgentId,jdbcType=BIGINT}, #{qrCode,jdbcType=VARCHAR}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "insert into high_discount_agent_code (discount_agent_id, discount_agent_batch_id, ", + "qr_code, create_time, ", + "`status`, ext_1, ext_2, ", + "ext_3)", + "values (#{discountAgentId,jdbcType=BIGINT}, #{discountAgentBatchId,jdbcType=BIGINT}, ", + "#{qrCode,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", + "#{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighDiscountAgentCode record); @@ -57,6 +59,7 @@ public interface HighDiscountAgentCodeMapper extends HighDiscountAgentCodeMapper @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="discount_agent_id", property="discountAgentId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_agent_batch_id", property="discountAgentBatchId", jdbcType=JdbcType.BIGINT), @Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -68,13 +71,15 @@ public interface HighDiscountAgentCodeMapper extends HighDiscountAgentCodeMapper @Select({ "select", - "id, discount_agent_id, qr_code, create_time, `status`, ext_1, ext_2, ext_3", + "id, discount_agent_id, discount_agent_batch_id, qr_code, create_time, `status`, ", + "ext_1, ext_2, ext_3", "from high_discount_agent_code", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="discount_agent_id", property="discountAgentId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_agent_batch_id", property="discountAgentBatchId", jdbcType=JdbcType.BIGINT), @Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -96,6 +101,7 @@ public interface HighDiscountAgentCodeMapper extends HighDiscountAgentCodeMapper @Update({ "update high_discount_agent_code", "set discount_agent_id = #{discountAgentId,jdbcType=BIGINT},", + "discount_agent_batch_id = #{discountAgentBatchId,jdbcType=BIGINT},", "qr_code = #{qrCode,jdbcType=VARCHAR},", "create_time = #{createTime,jdbcType=TIMESTAMP},", "`status` = #{status,jdbcType=INTEGER},", diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeSqlProvider.java index 98af898b..6e956284 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeSqlProvider.java @@ -32,6 +32,10 @@ public class HighDiscountAgentCodeSqlProvider { sql.VALUES("discount_agent_id", "#{discountAgentId,jdbcType=BIGINT}"); } + if (record.getDiscountAgentBatchId() != null) { + sql.VALUES("discount_agent_batch_id", "#{discountAgentBatchId,jdbcType=BIGINT}"); + } + if (record.getQrCode() != null) { sql.VALUES("qr_code", "#{qrCode,jdbcType=VARCHAR}"); } @@ -67,6 +71,7 @@ public class HighDiscountAgentCodeSqlProvider { sql.SELECT("id"); } sql.SELECT("discount_agent_id"); + sql.SELECT("discount_agent_batch_id"); sql.SELECT("qr_code"); sql.SELECT("create_time"); sql.SELECT("`status`"); @@ -98,6 +103,10 @@ public class HighDiscountAgentCodeSqlProvider { sql.SET("discount_agent_id = #{record.discountAgentId,jdbcType=BIGINT}"); } + if (record.getDiscountAgentBatchId() != null) { + sql.SET("discount_agent_batch_id = #{record.discountAgentBatchId,jdbcType=BIGINT}"); + } + if (record.getQrCode() != null) { sql.SET("qr_code = #{record.qrCode,jdbcType=VARCHAR}"); } @@ -132,6 +141,7 @@ public class HighDiscountAgentCodeSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("discount_agent_id = #{record.discountAgentId,jdbcType=BIGINT}"); + sql.SET("discount_agent_batch_id = #{record.discountAgentBatchId,jdbcType=BIGINT}"); sql.SET("qr_code = #{record.qrCode,jdbcType=VARCHAR}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); @@ -152,6 +162,10 @@ public class HighDiscountAgentCodeSqlProvider { sql.SET("discount_agent_id = #{discountAgentId,jdbcType=BIGINT}"); } + if (record.getDiscountAgentBatchId() != null) { + sql.SET("discount_agent_batch_id = #{discountAgentBatchId,jdbcType=BIGINT}"); + } + if (record.getQrCode() != null) { sql.SET("qr_code = #{qrCode,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountAgentBatch.java b/hai-service/src/main/java/com/hai/entity/HighDiscountAgentBatch.java new file mode 100644 index 00000000..8c7da5b5 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountAgentBatch.java @@ -0,0 +1,345 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * high_discount_agent_batch + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighDiscountAgentBatch implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 优惠券与代理商关系 + */ + private Long discountAgentId; + + /** + * 优惠券id + */ + private Long discountId; + + /** + * 优惠券名称 + */ + private String discountName; + + /** + * 优惠券金额 + */ + private BigDecimal discountPrice; + + /** + * 使用归属 + */ + private Integer usingRange; + + /** + * 使用范围 1. 全场 2.卡券 3.话费 + */ + private Integer useScope; + + /** + * 代理商id + */ + private Long agentId; + + /** + * 批次标识 + */ + private String batchIdentifier; + + /** + * 批次数量 + */ + private Integer batchNum; + + /** + * 编码区间 + */ + private String codeStart; + + /** + * 编码区间 + */ + private String codeEnd; + + /** + * 邮寄时间 + */ + private Date mailTime; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 二维码 + */ + private String qrCode; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getDiscountAgentId() { + return discountAgentId; + } + + public void setDiscountAgentId(Long discountAgentId) { + this.discountAgentId = discountAgentId; + } + + public Long getDiscountId() { + return discountId; + } + + public void setDiscountId(Long discountId) { + this.discountId = discountId; + } + + public String getDiscountName() { + return discountName; + } + + public void setDiscountName(String discountName) { + this.discountName = discountName; + } + + public BigDecimal getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(BigDecimal discountPrice) { + this.discountPrice = discountPrice; + } + + public Integer getUsingRange() { + return usingRange; + } + + public void setUsingRange(Integer usingRange) { + this.usingRange = usingRange; + } + + public Integer getUseScope() { + return useScope; + } + + public void setUseScope(Integer useScope) { + this.useScope = useScope; + } + + public Long getAgentId() { + return agentId; + } + + public void setAgentId(Long agentId) { + this.agentId = agentId; + } + + public String getBatchIdentifier() { + return batchIdentifier; + } + + public void setBatchIdentifier(String batchIdentifier) { + this.batchIdentifier = batchIdentifier; + } + + public Integer getBatchNum() { + return batchNum; + } + + public void setBatchNum(Integer batchNum) { + this.batchNum = batchNum; + } + + public String getCodeStart() { + return codeStart; + } + + public void setCodeStart(String codeStart) { + this.codeStart = codeStart; + } + + public String getCodeEnd() { + return codeEnd; + } + + public void setCodeEnd(String codeEnd) { + this.codeEnd = codeEnd; + } + + public Date getMailTime() { + return mailTime; + } + + public void setMailTime(Date mailTime) { + this.mailTime = mailTime; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getQrCode() { + return qrCode; + } + + public void setQrCode(String qrCode) { + this.qrCode = qrCode; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + HighDiscountAgentBatch other = (HighDiscountAgentBatch) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getDiscountAgentId() == null ? other.getDiscountAgentId() == null : this.getDiscountAgentId().equals(other.getDiscountAgentId())) + && (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId())) + && (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName())) + && (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice())) + && (this.getUsingRange() == null ? other.getUsingRange() == null : this.getUsingRange().equals(other.getUsingRange())) + && (this.getUseScope() == null ? other.getUseScope() == null : this.getUseScope().equals(other.getUseScope())) + && (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId())) + && (this.getBatchIdentifier() == null ? other.getBatchIdentifier() == null : this.getBatchIdentifier().equals(other.getBatchIdentifier())) + && (this.getBatchNum() == null ? other.getBatchNum() == null : this.getBatchNum().equals(other.getBatchNum())) + && (this.getCodeStart() == null ? other.getCodeStart() == null : this.getCodeStart().equals(other.getCodeStart())) + && (this.getCodeEnd() == null ? other.getCodeEnd() == null : this.getCodeEnd().equals(other.getCodeEnd())) + && (this.getMailTime() == null ? other.getMailTime() == null : this.getMailTime().equals(other.getMailTime())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getQrCode() == null ? other.getQrCode() == null : this.getQrCode().equals(other.getQrCode())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getDiscountAgentId() == null) ? 0 : getDiscountAgentId().hashCode()); + result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode()); + result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode()); + result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode()); + result = prime * result + ((getUsingRange() == null) ? 0 : getUsingRange().hashCode()); + result = prime * result + ((getUseScope() == null) ? 0 : getUseScope().hashCode()); + result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); + result = prime * result + ((getBatchIdentifier() == null) ? 0 : getBatchIdentifier().hashCode()); + result = prime * result + ((getBatchNum() == null) ? 0 : getBatchNum().hashCode()); + result = prime * result + ((getCodeStart() == null) ? 0 : getCodeStart().hashCode()); + result = prime * result + ((getCodeEnd() == null) ? 0 : getCodeEnd().hashCode()); + result = prime * result + ((getMailTime() == null) ? 0 : getMailTime().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getQrCode() == null) ? 0 : getQrCode().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", discountAgentId=").append(discountAgentId); + sb.append(", discountId=").append(discountId); + sb.append(", discountName=").append(discountName); + sb.append(", discountPrice=").append(discountPrice); + sb.append(", usingRange=").append(usingRange); + sb.append(", useScope=").append(useScope); + sb.append(", agentId=").append(agentId); + sb.append(", batchIdentifier=").append(batchIdentifier); + sb.append(", batchNum=").append(batchNum); + sb.append(", codeStart=").append(codeStart); + sb.append(", codeEnd=").append(codeEnd); + sb.append(", mailTime=").append(mailTime); + sb.append(", createTime=").append(createTime); + sb.append(", status=").append(status); + sb.append(", qrCode=").append(qrCode); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountAgentBatchExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountAgentBatchExample.java new file mode 100644 index 00000000..73428754 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountAgentBatchExample.java @@ -0,0 +1,1444 @@ +package com.hai.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighDiscountAgentBatchExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighDiscountAgentBatchExample() { + 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 andDiscountAgentIdIsNull() { + addCriterion("discount_agent_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdIsNotNull() { + addCriterion("discount_agent_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdEqualTo(Long value) { + addCriterion("discount_agent_id =", value, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdNotEqualTo(Long value) { + addCriterion("discount_agent_id <>", value, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdGreaterThan(Long value) { + addCriterion("discount_agent_id >", value, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_agent_id >=", value, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdLessThan(Long value) { + addCriterion("discount_agent_id <", value, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdLessThanOrEqualTo(Long value) { + addCriterion("discount_agent_id <=", value, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdIn(List values) { + addCriterion("discount_agent_id in", values, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdNotIn(List values) { + addCriterion("discount_agent_id not in", values, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdBetween(Long value1, Long value2) { + addCriterion("discount_agent_id between", value1, value2, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentIdNotBetween(Long value1, Long value2) { + addCriterion("discount_agent_id not between", value1, value2, "discountAgentId"); + return (Criteria) this; + } + + public Criteria andDiscountIdIsNull() { + addCriterion("discount_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountIdIsNotNull() { + addCriterion("discount_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountIdEqualTo(Long value) { + addCriterion("discount_id =", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotEqualTo(Long value) { + addCriterion("discount_id <>", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdGreaterThan(Long value) { + addCriterion("discount_id >", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_id >=", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdLessThan(Long value) { + addCriterion("discount_id <", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdLessThanOrEqualTo(Long value) { + addCriterion("discount_id <=", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdIn(List values) { + addCriterion("discount_id in", values, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotIn(List values) { + addCriterion("discount_id not in", values, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdBetween(Long value1, Long value2) { + addCriterion("discount_id between", value1, value2, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotBetween(Long value1, Long value2) { + addCriterion("discount_id not between", value1, value2, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountNameIsNull() { + addCriterion("discount_name is null"); + return (Criteria) this; + } + + public Criteria andDiscountNameIsNotNull() { + addCriterion("discount_name is not null"); + return (Criteria) this; + } + + public Criteria andDiscountNameEqualTo(String value) { + addCriterion("discount_name =", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotEqualTo(String value) { + addCriterion("discount_name <>", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThan(String value) { + addCriterion("discount_name >", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThanOrEqualTo(String value) { + addCriterion("discount_name >=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThan(String value) { + addCriterion("discount_name <", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThanOrEqualTo(String value) { + addCriterion("discount_name <=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLike(String value) { + addCriterion("discount_name like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotLike(String value) { + addCriterion("discount_name not like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameIn(List values) { + addCriterion("discount_name in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotIn(List values) { + addCriterion("discount_name not in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameBetween(String value1, String value2) { + addCriterion("discount_name between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotBetween(String value1, String value2) { + addCriterion("discount_name not between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIsNull() { + addCriterion("discount_price is null"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIsNotNull() { + addCriterion("discount_price is not null"); + return (Criteria) this; + } + + public Criteria andDiscountPriceEqualTo(BigDecimal value) { + addCriterion("discount_price =", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotEqualTo(BigDecimal value) { + addCriterion("discount_price <>", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceGreaterThan(BigDecimal value) { + addCriterion("discount_price >", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_price >=", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceLessThan(BigDecimal value) { + addCriterion("discount_price <", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_price <=", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIn(List values) { + addCriterion("discount_price in", values, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotIn(List values) { + addCriterion("discount_price not in", values, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_price between", value1, value2, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_price not between", value1, value2, "discountPrice"); + return (Criteria) this; + } + + public Criteria andUsingRangeIsNull() { + addCriterion("using_range is null"); + return (Criteria) this; + } + + public Criteria andUsingRangeIsNotNull() { + addCriterion("using_range is not null"); + return (Criteria) this; + } + + public Criteria andUsingRangeEqualTo(Integer value) { + addCriterion("using_range =", value, "usingRange"); + return (Criteria) this; + } + + public Criteria andUsingRangeNotEqualTo(Integer value) { + addCriterion("using_range <>", value, "usingRange"); + return (Criteria) this; + } + + public Criteria andUsingRangeGreaterThan(Integer value) { + addCriterion("using_range >", value, "usingRange"); + return (Criteria) this; + } + + public Criteria andUsingRangeGreaterThanOrEqualTo(Integer value) { + addCriterion("using_range >=", value, "usingRange"); + return (Criteria) this; + } + + public Criteria andUsingRangeLessThan(Integer value) { + addCriterion("using_range <", value, "usingRange"); + return (Criteria) this; + } + + public Criteria andUsingRangeLessThanOrEqualTo(Integer value) { + addCriterion("using_range <=", value, "usingRange"); + return (Criteria) this; + } + + public Criteria andUsingRangeIn(List values) { + addCriterion("using_range in", values, "usingRange"); + return (Criteria) this; + } + + public Criteria andUsingRangeNotIn(List values) { + addCriterion("using_range not in", values, "usingRange"); + return (Criteria) this; + } + + public Criteria andUsingRangeBetween(Integer value1, Integer value2) { + addCriterion("using_range between", value1, value2, "usingRange"); + return (Criteria) this; + } + + public Criteria andUsingRangeNotBetween(Integer value1, Integer value2) { + addCriterion("using_range not between", value1, value2, "usingRange"); + return (Criteria) this; + } + + public Criteria andUseScopeIsNull() { + addCriterion("use_scope is null"); + return (Criteria) this; + } + + public Criteria andUseScopeIsNotNull() { + addCriterion("use_scope is not null"); + return (Criteria) this; + } + + public Criteria andUseScopeEqualTo(Integer value) { + addCriterion("use_scope =", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeNotEqualTo(Integer value) { + addCriterion("use_scope <>", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeGreaterThan(Integer value) { + addCriterion("use_scope >", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeGreaterThanOrEqualTo(Integer value) { + addCriterion("use_scope >=", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeLessThan(Integer value) { + addCriterion("use_scope <", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeLessThanOrEqualTo(Integer value) { + addCriterion("use_scope <=", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeIn(List values) { + addCriterion("use_scope in", values, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeNotIn(List values) { + addCriterion("use_scope not in", values, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeBetween(Integer value1, Integer value2) { + addCriterion("use_scope between", value1, value2, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeNotBetween(Integer value1, Integer value2) { + addCriterion("use_scope not between", value1, value2, "useScope"); + return (Criteria) this; + } + + public Criteria andAgentIdIsNull() { + addCriterion("agent_id is null"); + return (Criteria) this; + } + + public Criteria andAgentIdIsNotNull() { + addCriterion("agent_id is not null"); + return (Criteria) this; + } + + public Criteria andAgentIdEqualTo(Long value) { + addCriterion("agent_id =", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotEqualTo(Long value) { + addCriterion("agent_id <>", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdGreaterThan(Long value) { + addCriterion("agent_id >", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdGreaterThanOrEqualTo(Long value) { + addCriterion("agent_id >=", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdLessThan(Long value) { + addCriterion("agent_id <", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdLessThanOrEqualTo(Long value) { + addCriterion("agent_id <=", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdIn(List values) { + addCriterion("agent_id in", values, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotIn(List values) { + addCriterion("agent_id not in", values, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdBetween(Long value1, Long value2) { + addCriterion("agent_id between", value1, value2, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotBetween(Long value1, Long value2) { + addCriterion("agent_id not between", value1, value2, "agentId"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierIsNull() { + addCriterion("batch_identifier is null"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierIsNotNull() { + addCriterion("batch_identifier is not null"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierEqualTo(String value) { + addCriterion("batch_identifier =", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierNotEqualTo(String value) { + addCriterion("batch_identifier <>", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierGreaterThan(String value) { + addCriterion("batch_identifier >", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("batch_identifier >=", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierLessThan(String value) { + addCriterion("batch_identifier <", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierLessThanOrEqualTo(String value) { + addCriterion("batch_identifier <=", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierLike(String value) { + addCriterion("batch_identifier like", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierNotLike(String value) { + addCriterion("batch_identifier not like", value, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierIn(List values) { + addCriterion("batch_identifier in", values, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierNotIn(List values) { + addCriterion("batch_identifier not in", values, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierBetween(String value1, String value2) { + addCriterion("batch_identifier between", value1, value2, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchIdentifierNotBetween(String value1, String value2) { + addCriterion("batch_identifier not between", value1, value2, "batchIdentifier"); + return (Criteria) this; + } + + public Criteria andBatchNumIsNull() { + addCriterion("batch_num is null"); + return (Criteria) this; + } + + public Criteria andBatchNumIsNotNull() { + addCriterion("batch_num is not null"); + return (Criteria) this; + } + + public Criteria andBatchNumEqualTo(Integer value) { + addCriterion("batch_num =", value, "batchNum"); + return (Criteria) this; + } + + public Criteria andBatchNumNotEqualTo(Integer value) { + addCriterion("batch_num <>", value, "batchNum"); + return (Criteria) this; + } + + public Criteria andBatchNumGreaterThan(Integer value) { + addCriterion("batch_num >", value, "batchNum"); + return (Criteria) this; + } + + public Criteria andBatchNumGreaterThanOrEqualTo(Integer value) { + addCriterion("batch_num >=", value, "batchNum"); + return (Criteria) this; + } + + public Criteria andBatchNumLessThan(Integer value) { + addCriterion("batch_num <", value, "batchNum"); + return (Criteria) this; + } + + public Criteria andBatchNumLessThanOrEqualTo(Integer value) { + addCriterion("batch_num <=", value, "batchNum"); + return (Criteria) this; + } + + public Criteria andBatchNumIn(List values) { + addCriterion("batch_num in", values, "batchNum"); + return (Criteria) this; + } + + public Criteria andBatchNumNotIn(List values) { + addCriterion("batch_num not in", values, "batchNum"); + return (Criteria) this; + } + + public Criteria andBatchNumBetween(Integer value1, Integer value2) { + addCriterion("batch_num between", value1, value2, "batchNum"); + return (Criteria) this; + } + + public Criteria andBatchNumNotBetween(Integer value1, Integer value2) { + addCriterion("batch_num not between", value1, value2, "batchNum"); + return (Criteria) this; + } + + public Criteria andCodeStartIsNull() { + addCriterion("code_start is null"); + return (Criteria) this; + } + + public Criteria andCodeStartIsNotNull() { + addCriterion("code_start is not null"); + return (Criteria) this; + } + + public Criteria andCodeStartEqualTo(String value) { + addCriterion("code_start =", value, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartNotEqualTo(String value) { + addCriterion("code_start <>", value, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartGreaterThan(String value) { + addCriterion("code_start >", value, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartGreaterThanOrEqualTo(String value) { + addCriterion("code_start >=", value, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartLessThan(String value) { + addCriterion("code_start <", value, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartLessThanOrEqualTo(String value) { + addCriterion("code_start <=", value, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartLike(String value) { + addCriterion("code_start like", value, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartNotLike(String value) { + addCriterion("code_start not like", value, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartIn(List values) { + addCriterion("code_start in", values, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartNotIn(List values) { + addCriterion("code_start not in", values, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartBetween(String value1, String value2) { + addCriterion("code_start between", value1, value2, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeStartNotBetween(String value1, String value2) { + addCriterion("code_start not between", value1, value2, "codeStart"); + return (Criteria) this; + } + + public Criteria andCodeEndIsNull() { + addCriterion("code_end is null"); + return (Criteria) this; + } + + public Criteria andCodeEndIsNotNull() { + addCriterion("code_end is not null"); + return (Criteria) this; + } + + public Criteria andCodeEndEqualTo(String value) { + addCriterion("code_end =", value, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndNotEqualTo(String value) { + addCriterion("code_end <>", value, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndGreaterThan(String value) { + addCriterion("code_end >", value, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndGreaterThanOrEqualTo(String value) { + addCriterion("code_end >=", value, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndLessThan(String value) { + addCriterion("code_end <", value, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndLessThanOrEqualTo(String value) { + addCriterion("code_end <=", value, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndLike(String value) { + addCriterion("code_end like", value, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndNotLike(String value) { + addCriterion("code_end not like", value, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndIn(List values) { + addCriterion("code_end in", values, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndNotIn(List values) { + addCriterion("code_end not in", values, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndBetween(String value1, String value2) { + addCriterion("code_end between", value1, value2, "codeEnd"); + return (Criteria) this; + } + + public Criteria andCodeEndNotBetween(String value1, String value2) { + addCriterion("code_end not between", value1, value2, "codeEnd"); + return (Criteria) this; + } + + public Criteria andMailTimeIsNull() { + addCriterion("mail_time is null"); + return (Criteria) this; + } + + public Criteria andMailTimeIsNotNull() { + addCriterion("mail_time is not null"); + return (Criteria) this; + } + + public Criteria andMailTimeEqualTo(Date value) { + addCriterion("mail_time =", value, "mailTime"); + return (Criteria) this; + } + + public Criteria andMailTimeNotEqualTo(Date value) { + addCriterion("mail_time <>", value, "mailTime"); + return (Criteria) this; + } + + public Criteria andMailTimeGreaterThan(Date value) { + addCriterion("mail_time >", value, "mailTime"); + return (Criteria) this; + } + + public Criteria andMailTimeGreaterThanOrEqualTo(Date value) { + addCriterion("mail_time >=", value, "mailTime"); + return (Criteria) this; + } + + public Criteria andMailTimeLessThan(Date value) { + addCriterion("mail_time <", value, "mailTime"); + return (Criteria) this; + } + + public Criteria andMailTimeLessThanOrEqualTo(Date value) { + addCriterion("mail_time <=", value, "mailTime"); + return (Criteria) this; + } + + public Criteria andMailTimeIn(List values) { + addCriterion("mail_time in", values, "mailTime"); + return (Criteria) this; + } + + public Criteria andMailTimeNotIn(List values) { + addCriterion("mail_time not in", values, "mailTime"); + return (Criteria) this; + } + + public Criteria andMailTimeBetween(Date value1, Date value2) { + addCriterion("mail_time between", value1, value2, "mailTime"); + return (Criteria) this; + } + + public Criteria andMailTimeNotBetween(Date value1, Date value2) { + addCriterion("mail_time not between", value1, value2, "mailTime"); + 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 andQrCodeIsNull() { + addCriterion("qr_code is null"); + return (Criteria) this; + } + + public Criteria andQrCodeIsNotNull() { + addCriterion("qr_code is not null"); + return (Criteria) this; + } + + public Criteria andQrCodeEqualTo(String value) { + addCriterion("qr_code =", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeNotEqualTo(String value) { + addCriterion("qr_code <>", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeGreaterThan(String value) { + addCriterion("qr_code >", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeGreaterThanOrEqualTo(String value) { + addCriterion("qr_code >=", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeLessThan(String value) { + addCriterion("qr_code <", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeLessThanOrEqualTo(String value) { + addCriterion("qr_code <=", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeLike(String value) { + addCriterion("qr_code like", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeNotLike(String value) { + addCriterion("qr_code not like", value, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeIn(List values) { + addCriterion("qr_code in", values, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeNotIn(List values) { + addCriterion("qr_code not in", values, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeBetween(String value1, String value2) { + addCriterion("qr_code between", value1, value2, "qrCode"); + return (Criteria) this; + } + + public Criteria andQrCodeNotBetween(String value1, String value2) { + addCriterion("qr_code not between", value1, value2, "qrCode"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountAgentCode.java b/hai-service/src/main/java/com/hai/entity/HighDiscountAgentCode.java index 0ca3bbf3..711b7cfb 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountAgentCode.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountAgentCode.java @@ -25,6 +25,11 @@ public class HighDiscountAgentCode extends HighDiscountAgentCodeModel implements */ private Long discountAgentId; + /** + * 批次id + */ + private Long discountAgentBatchId; + /** * 二维码 */ @@ -36,7 +41,7 @@ public class HighDiscountAgentCode extends HighDiscountAgentCodeModel implements private Date createTime; /** - * 状态 0:删除 1:待领取 2:待使用 3:已使用 4:已过期 + * 状态 0:删除 1:待领取 2:待使用 3:已使用 4:已过期 5:已分配 */ private Integer status; @@ -64,6 +69,14 @@ public class HighDiscountAgentCode extends HighDiscountAgentCodeModel implements this.discountAgentId = discountAgentId; } + public Long getDiscountAgentBatchId() { + return discountAgentBatchId; + } + + public void setDiscountAgentBatchId(Long discountAgentBatchId) { + this.discountAgentBatchId = discountAgentBatchId; + } + public String getQrCode() { return qrCode; } @@ -126,6 +139,7 @@ public class HighDiscountAgentCode extends HighDiscountAgentCodeModel implements HighDiscountAgentCode other = (HighDiscountAgentCode) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getDiscountAgentId() == null ? other.getDiscountAgentId() == null : this.getDiscountAgentId().equals(other.getDiscountAgentId())) + && (this.getDiscountAgentBatchId() == null ? other.getDiscountAgentBatchId() == null : this.getDiscountAgentBatchId().equals(other.getDiscountAgentBatchId())) && (this.getQrCode() == null ? other.getQrCode() == null : this.getQrCode().equals(other.getQrCode())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) @@ -140,6 +154,7 @@ public class HighDiscountAgentCode extends HighDiscountAgentCodeModel implements int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getDiscountAgentId() == null) ? 0 : getDiscountAgentId().hashCode()); + result = prime * result + ((getDiscountAgentBatchId() == null) ? 0 : getDiscountAgentBatchId().hashCode()); result = prime * result + ((getQrCode() == null) ? 0 : getQrCode().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); @@ -157,6 +172,7 @@ public class HighDiscountAgentCode extends HighDiscountAgentCodeModel implements sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", discountAgentId=").append(discountAgentId); + sb.append(", discountAgentBatchId=").append(discountAgentBatchId); sb.append(", qrCode=").append(qrCode); sb.append(", createTime=").append(createTime); sb.append(", status=").append(status); @@ -167,4 +183,4 @@ public class HighDiscountAgentCode extends HighDiscountAgentCodeModel implements sb.append("]"); return sb.toString(); } -} \ No newline at end of file +} diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountAgentCodeExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountAgentCodeExample.java index ea3b12f3..56d554a9 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountAgentCodeExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountAgentCodeExample.java @@ -245,6 +245,66 @@ public class HighDiscountAgentCodeExample { return (Criteria) this; } + public Criteria andDiscountAgentBatchIdIsNull() { + addCriterion("discount_agent_batch_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdIsNotNull() { + addCriterion("discount_agent_batch_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdEqualTo(Long value) { + addCriterion("discount_agent_batch_id =", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdNotEqualTo(Long value) { + addCriterion("discount_agent_batch_id <>", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdGreaterThan(Long value) { + addCriterion("discount_agent_batch_id >", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_agent_batch_id >=", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdLessThan(Long value) { + addCriterion("discount_agent_batch_id <", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdLessThanOrEqualTo(Long value) { + addCriterion("discount_agent_batch_id <=", value, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdIn(List values) { + addCriterion("discount_agent_batch_id in", values, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdNotIn(List values) { + addCriterion("discount_agent_batch_id not in", values, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdBetween(Long value1, Long value2) { + addCriterion("discount_agent_batch_id between", value1, value2, "discountAgentBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountAgentBatchIdNotBetween(Long value1, Long value2) { + addCriterion("discount_agent_batch_id not between", value1, value2, "discountAgentBatchId"); + return (Criteria) this; + } + public Criteria andQrCodeIsNull() { addCriterion("qr_code is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountAgentBatchService.java b/hai-service/src/main/java/com/hai/service/HighDiscountAgentBatchService.java new file mode 100644 index 00000000..21f1b2cf --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighDiscountAgentBatchService.java @@ -0,0 +1,40 @@ +package com.hai.service; + +import com.hai.entity.HighDiscountAgentBatch; + +import java.util.List; +import java.util.Map; + +/** + * @className: HighDiscountAgentBatchService + * @author: HuRui + * @date: 2023/8/16 + **/ +public interface HighDiscountAgentBatchService { + + /** + * 编辑数据 + * @param discountAgentBatch + */ + void editData(HighDiscountAgentBatch discountAgentBatch); + + /** + * 根据标识查询数据 + * @param identifier + * @return + */ + HighDiscountAgentBatch getBatchByIdentifier(String identifier); + + /** + * 获取使用统计 + * @param param + * @return + */List> getUsageCount(Map param); + + /** + * 获取统计 + * @param param + * @return + */ + Map getCount(Map param); +} diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountAgentRelService.java b/hai-service/src/main/java/com/hai/service/HighDiscountAgentRelService.java index 29178c69..8f3f70f1 100644 --- a/hai-service/src/main/java/com/hai/service/HighDiscountAgentRelService.java +++ b/hai-service/src/main/java/com/hai/service/HighDiscountAgentRelService.java @@ -60,4 +60,11 @@ public interface HighDiscountAgentRelService { * @Date 2021/4/4 0:32 **/ List getRelList(Map map); + + /** + * 查询列表 + * @param map + * @return + */ + List getDiscountUseCount(Map map); } diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountService.java b/hai-service/src/main/java/com/hai/service/HighDiscountService.java index e727f3b3..64682c57 100644 --- a/hai-service/src/main/java/com/hai/service/HighDiscountService.java +++ b/hai-service/src/main/java/com/hai/service/HighDiscountService.java @@ -2,6 +2,7 @@ package com.hai.service; import com.hai.entity.HighDiscount; +import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -47,5 +48,5 @@ public interface HighDiscountService { **/ List getDiscount(Map map); - + List getDiscountPrice(Integer usingRange); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentBatchServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentBatchServiceImpl.java new file mode 100644 index 00000000..dd2e1317 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentBatchServiceImpl.java @@ -0,0 +1,55 @@ +package com.hai.service.impl; + +import com.hai.dao.HighDiscountAgentBatchMapper; +import com.hai.entity.HighDiscountAgentBatch; +import com.hai.entity.HighDiscountAgentBatchExample; +import com.hai.service.HighDiscountAgentBatchService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @className: HighDiscountAgentBatchServiceImpl + * @author: HuRui + * @date: 2023/8/16 + **/ +@Service("discountAgentBatchService") +public class HighDiscountAgentBatchServiceImpl implements HighDiscountAgentBatchService { + + @Resource + private HighDiscountAgentBatchMapper discountAgentBatchMapper; + @Override + public void editData(HighDiscountAgentBatch discountAgentBatch) { + if (discountAgentBatch.getId() == null) { + discountAgentBatch.setCreateTime(new Date()); + discountAgentBatch.setStatus(1); + discountAgentBatchMapper.insert(discountAgentBatch); + } else { + discountAgentBatchMapper.updateByPrimaryKey(discountAgentBatch); + } + } + + @Override + public HighDiscountAgentBatch getBatchByIdentifier(String identifier) { + HighDiscountAgentBatchExample example = new HighDiscountAgentBatchExample(); + example.createCriteria().andBatchIdentifierEqualTo(identifier).andStatusNotEqualTo(0); + List list = discountAgentBatchMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + + @Override + public List> getUsageCount(Map param) { + return discountAgentBatchMapper.queryUsageCount(param); + } + + @Override + public Map getCount(Map param) { + return discountAgentBatchMapper.queryCount(param); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java index f32466ac..22e76810 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java @@ -11,10 +11,7 @@ import com.hai.config.WeChatQrcodeUtils; import com.hai.dao.HighDiscountAgentRelMapper; import com.hai.entity.*; import com.hai.enum_type.WxQrCodeTypeEnum; -import com.hai.service.HighAgentService; -import com.hai.service.HighDiscountAgentCodeService; -import com.hai.service.HighDiscountAgentRelService; -import com.hai.service.HighDiscountService; +import com.hai.service.*; import org.apache.commons.collections4.MapUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -45,6 +42,9 @@ public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelServ @Resource private HighDiscountAgentCodeService highDiscountAgentCodeService; + @Resource + private HighDiscountAgentBatchService discountAgentBatchService; + @Autowired private WeChatQrcodeUtils weChatQrcodeUtils; @@ -56,6 +56,19 @@ public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelServ } else { highDiscountAgentRelMapper.insert(highDiscountAgentRel); } + HighDiscountAgentBatch discountAgentBatch = new HighDiscountAgentBatch(); + discountAgentBatch.setDiscountAgentId(highDiscountAgentRel.getId()); + discountAgentBatch.setDiscountId(highDiscountAgentRel.getDiscountId()); + discountAgentBatch.setDiscountName(highDiscountAgentRel.getHighDiscount().getDiscountName()); + discountAgentBatch.setDiscountPrice(highDiscountAgentRel.getHighDiscount().getDiscountPrice()); + discountAgentBatch.setUseScope(highDiscountAgentRel.getHighDiscount().getUseScope()); + discountAgentBatch.setUsingRange(highDiscountAgentRel.getHighDiscount().getUsingRange()); + discountAgentBatch.setAgentId(highDiscountAgentRel.getAgentId()); + discountAgentBatch.setBatchNum(stockCount); + discountAgentBatchService.editData(discountAgentBatch); + + discountAgentBatch.setBatchIdentifier((10000 + discountAgentBatch.getId())+""); + discountAgentBatchService.editData(discountAgentBatch); HighDiscountAgentCode code; Map map = new HashMap<>(); @@ -63,6 +76,7 @@ public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelServ for (int i = 0;i < stockCount;i++) { code = new HighDiscountAgentCode(); code.setDiscountAgentId(highDiscountAgentRel.getId()); + code.setDiscountAgentBatchId(discountAgentBatch.getId()); code.setStatus(1); code.setCreateTime(new Date()); highDiscountAgentCodeService.insertCode(code); @@ -74,7 +88,14 @@ public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelServ code.setExt1(qrCodeUrl); // 生成二维码地址 highDiscountAgentCodeService.updateCode(code); + + if (i == 0) { + discountAgentBatch.setCodeStart(code.getId().toString()); + } else if ((i + 1) == stockCount) { + discountAgentBatch.setCodeEnd(code.getId().toString()); + } } + discountAgentBatchService.editData(discountAgentBatch); } @Override @@ -140,4 +161,14 @@ public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelServ } return list; } + + @Override + public List getDiscountUseCount(Map map) { + HighDiscountAgentRelExample example = new HighDiscountAgentRelExample(); + HighDiscountAgentRelExample.Criteria criteria = example.createCriteria().andStatusEqualTo(1); + + + example.setOrderByClause("create_time desc"); + return highDiscountAgentRelMapper.selectByExample(example); + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountServiceImpl.java index 949804e8..bf1f60e0 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountServiceImpl.java @@ -10,8 +10,11 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @Auther: 胡锐 @@ -75,4 +78,16 @@ public class HighDiscountServiceImpl implements HighDiscountService { example.setOrderByClause("update_time desc"); return highDiscountMapper.selectByExample(example); } + + @Override + public List getDiscountPrice(Integer usingRange) { + HighDiscountExample discountExample = new HighDiscountExample(); + discountExample.createCriteria().andUsingRangeEqualTo(usingRange); + List list = highDiscountMapper.selectByExample(discountExample); + List priceList = new ArrayList<>(); + for (HighDiscount discount : list) { + priceList.add(discount.getDiscountPrice()); + } + return priceList.stream().distinct().sorted().collect(Collectors.toList()); + } }