diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java index e3467158..2fbd7056 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java @@ -62,6 +62,9 @@ public class HighDiscountPackageController { @Resource private HighDiscountPackageService highDiscountPackageService; + @Resource + private HighDiscountPackageDeliverService discountPackageDeliverService; + @Resource private HighDiscountPackageDetailsService highDiscountPackageDetailsService; @@ -684,6 +687,23 @@ public class HighDiscountPackageController { } } + @RequestMapping(value = "/getHandleByPackageId", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "查询进行中的赠送任务") + public ResponseData getHandleByPackageId(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("packageId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + return ResponseMsgUtil.success(discountPackageDeliverService.getHandleByPackageId(body.getLong("packageId"))); + + } catch (Exception e) { + log.error("HighDiscountPackageController --> getHandleByPackageId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/giveAway", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "赠送") diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverMapper.java new file mode 100644 index 00000000..c81a387c --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverMapper.java @@ -0,0 +1,122 @@ +package com.hai.dao; + +import com.hai.entity.HighDiscountPackageDeliver; +import com.hai.entity.HighDiscountPackageDeliverExample; +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 HighDiscountPackageDeliverMapper extends HighDiscountPackageDeliverMapperExt { + @SelectProvider(type=HighDiscountPackageDeliverSqlProvider.class, method="countByExample") + long countByExample(HighDiscountPackageDeliverExample example); + + @DeleteProvider(type=HighDiscountPackageDeliverSqlProvider.class, method="deleteByExample") + int deleteByExample(HighDiscountPackageDeliverExample example); + + @Delete({ + "delete from high_discount_package_deliver", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_discount_package_deliver (serial_number, package_id, ", + "package_name, create_time, ", + "`status`, op_user_id, ", + "op_user_name, ext_1, ", + "ext_2, ext_3)", + "values (#{serialNumber,jdbcType=VARCHAR}, #{packageId,jdbcType=BIGINT}, ", + "#{packageName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{status,jdbcType=INTEGER}, #{opUserId,jdbcType=BIGINT}, ", + "#{opUserName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighDiscountPackageDeliver record); + + @InsertProvider(type=HighDiscountPackageDeliverSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighDiscountPackageDeliver record); + + @SelectProvider(type=HighDiscountPackageDeliverSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="serial_number", property="serialNumber", jdbcType=JdbcType.VARCHAR), + @Result(column="package_id", property="packageId", jdbcType=JdbcType.BIGINT), + @Result(column="package_name", property="packageName", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", 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(HighDiscountPackageDeliverExample example); + + @Select({ + "select", + "id, serial_number, package_id, package_name, create_time, `status`, op_user_id, ", + "op_user_name, ext_1, ext_2, ext_3", + "from high_discount_package_deliver", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="serial_number", property="serialNumber", jdbcType=JdbcType.VARCHAR), + @Result(column="package_id", property="packageId", jdbcType=JdbcType.BIGINT), + @Result(column="package_name", property="packageName", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", 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) + }) + HighDiscountPackageDeliver selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighDiscountPackageDeliverSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighDiscountPackageDeliver record, @Param("example") HighDiscountPackageDeliverExample example); + + @UpdateProvider(type=HighDiscountPackageDeliverSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighDiscountPackageDeliver record, @Param("example") HighDiscountPackageDeliverExample example); + + @UpdateProvider(type=HighDiscountPackageDeliverSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighDiscountPackageDeliver record); + + @Update({ + "update high_discount_package_deliver", + "set serial_number = #{serialNumber,jdbcType=VARCHAR},", + "package_id = #{packageId,jdbcType=BIGINT},", + "package_name = #{packageName,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "op_user_id = #{opUserId,jdbcType=BIGINT},", + "op_user_name = #{opUserName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighDiscountPackageDeliver record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverMapperExt.java new file mode 100644 index 00000000..4f273af1 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighDiscountPackageDeliverMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverSqlProvider.java new file mode 100644 index 00000000..a37a703e --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverSqlProvider.java @@ -0,0 +1,318 @@ +package com.hai.dao; + +import com.hai.entity.HighDiscountPackageDeliver; +import com.hai.entity.HighDiscountPackageDeliverExample.Criteria; +import com.hai.entity.HighDiscountPackageDeliverExample.Criterion; +import com.hai.entity.HighDiscountPackageDeliverExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighDiscountPackageDeliverSqlProvider { + + public String countByExample(HighDiscountPackageDeliverExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_discount_package_deliver"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighDiscountPackageDeliverExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_discount_package_deliver"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighDiscountPackageDeliver record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_discount_package_deliver"); + + if (record.getSerialNumber() != null) { + sql.VALUES("serial_number", "#{serialNumber,jdbcType=VARCHAR}"); + } + + if (record.getPackageId() != null) { + sql.VALUES("package_id", "#{packageId,jdbcType=BIGINT}"); + } + + if (record.getPackageName() != null) { + sql.VALUES("package_name", "#{packageName,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getOpUserId() != null) { + sql.VALUES("op_user_id", "#{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.VALUES("op_user_name", "#{opUserName,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(HighDiscountPackageDeliverExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("serial_number"); + sql.SELECT("package_id"); + sql.SELECT("package_name"); + sql.SELECT("create_time"); + sql.SELECT("`status`"); + sql.SELECT("op_user_id"); + sql.SELECT("op_user_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_discount_package_deliver"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighDiscountPackageDeliver record = (HighDiscountPackageDeliver) parameter.get("record"); + HighDiscountPackageDeliverExample example = (HighDiscountPackageDeliverExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_discount_package_deliver"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getSerialNumber() != null) { + sql.SET("serial_number = #{record.serialNumber,jdbcType=VARCHAR}"); + } + + if (record.getPackageId() != null) { + sql.SET("package_id = #{record.packageId,jdbcType=BIGINT}"); + } + + if (record.getPackageName() != null) { + sql.SET("package_name = #{record.packageName,jdbcType=VARCHAR}"); + } + + 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.getOpUserId() != null) { + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{record.opUserName,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_package_deliver"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("serial_number = #{record.serialNumber,jdbcType=VARCHAR}"); + sql.SET("package_id = #{record.packageId,jdbcType=BIGINT}"); + sql.SET("package_name = #{record.packageName,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + sql.SET("op_user_name = #{record.opUserName,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}"); + + HighDiscountPackageDeliverExample example = (HighDiscountPackageDeliverExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighDiscountPackageDeliver record) { + SQL sql = new SQL(); + sql.UPDATE("high_discount_package_deliver"); + + if (record.getSerialNumber() != null) { + sql.SET("serial_number = #{serialNumber,jdbcType=VARCHAR}"); + } + + if (record.getPackageId() != null) { + sql.SET("package_id = #{packageId,jdbcType=BIGINT}"); + } + + if (record.getPackageName() != null) { + sql.SET("package_name = #{packageName,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getOpUserId() != null) { + sql.SET("op_user_id = #{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{opUserName,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, HighDiscountPackageDeliverExample 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/HighDiscountPackageDeliverUserMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverUserMapper.java new file mode 100644 index 00000000..55efb96f --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverUserMapper.java @@ -0,0 +1,139 @@ +package com.hai.dao; + +import com.hai.entity.HighDiscountPackageDeliverUser; +import com.hai.entity.HighDiscountPackageDeliverUserExample; +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 HighDiscountPackageDeliverUserMapper extends HighDiscountPackageDeliverUserMapperExt { + @SelectProvider(type=HighDiscountPackageDeliverUserSqlProvider.class, method="countByExample") + long countByExample(HighDiscountPackageDeliverUserExample example); + + @DeleteProvider(type=HighDiscountPackageDeliverUserSqlProvider.class, method="deleteByExample") + int deleteByExample(HighDiscountPackageDeliverUserExample example); + + @Delete({ + "delete from high_discount_package_deliver_user", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_discount_package_deliver_user (package_deliver_id, serial_number, ", + "package_id, package_name, ", + "package_actual_id, user_id, ", + "user_phone, `status`, ", + "create_time, op_user_id, ", + "op_user_name, ext_1, ", + "ext_2, ext_3)", + "values (#{packageDeliverId,jdbcType=BIGINT}, #{serialNumber,jdbcType=VARCHAR}, ", + "#{packageId,jdbcType=BIGINT}, #{packageName,jdbcType=VARCHAR}, ", + "#{packageActualId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ", + "#{userPhone,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{opUserId,jdbcType=BIGINT}, ", + "#{opUserName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighDiscountPackageDeliverUser record); + + @InsertProvider(type=HighDiscountPackageDeliverUserSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighDiscountPackageDeliverUser record); + + @SelectProvider(type=HighDiscountPackageDeliverUserSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="package_deliver_id", property="packageDeliverId", jdbcType=JdbcType.BIGINT), + @Result(column="serial_number", property="serialNumber", jdbcType=JdbcType.VARCHAR), + @Result(column="package_id", property="packageId", jdbcType=JdbcType.BIGINT), + @Result(column="package_name", property="packageName", jdbcType=JdbcType.VARCHAR), + @Result(column="package_actual_id", property="packageActualId", jdbcType=JdbcType.BIGINT), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", 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(HighDiscountPackageDeliverUserExample example); + + @Select({ + "select", + "id, package_deliver_id, serial_number, package_id, package_name, package_actual_id, ", + "user_id, user_phone, `status`, create_time, op_user_id, op_user_name, ext_1, ", + "ext_2, ext_3", + "from high_discount_package_deliver_user", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="package_deliver_id", property="packageDeliverId", jdbcType=JdbcType.BIGINT), + @Result(column="serial_number", property="serialNumber", jdbcType=JdbcType.VARCHAR), + @Result(column="package_id", property="packageId", jdbcType=JdbcType.BIGINT), + @Result(column="package_name", property="packageName", jdbcType=JdbcType.VARCHAR), + @Result(column="package_actual_id", property="packageActualId", jdbcType=JdbcType.BIGINT), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", 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) + }) + HighDiscountPackageDeliverUser selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighDiscountPackageDeliverUserSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighDiscountPackageDeliverUser record, @Param("example") HighDiscountPackageDeliverUserExample example); + + @UpdateProvider(type=HighDiscountPackageDeliverUserSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighDiscountPackageDeliverUser record, @Param("example") HighDiscountPackageDeliverUserExample example); + + @UpdateProvider(type=HighDiscountPackageDeliverUserSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighDiscountPackageDeliverUser record); + + @Update({ + "update high_discount_package_deliver_user", + "set package_deliver_id = #{packageDeliverId,jdbcType=BIGINT},", + "serial_number = #{serialNumber,jdbcType=VARCHAR},", + "package_id = #{packageId,jdbcType=BIGINT},", + "package_name = #{packageName,jdbcType=VARCHAR},", + "package_actual_id = #{packageActualId,jdbcType=BIGINT},", + "user_id = #{userId,jdbcType=BIGINT},", + "user_phone = #{userPhone,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "op_user_id = #{opUserId,jdbcType=BIGINT},", + "op_user_name = #{opUserName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighDiscountPackageDeliverUser record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverUserMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverUserMapperExt.java new file mode 100644 index 00000000..55dc7eea --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverUserMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighDiscountPackageDeliverUserMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverUserSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverUserSqlProvider.java new file mode 100644 index 00000000..8f576a5b --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageDeliverUserSqlProvider.java @@ -0,0 +1,374 @@ +package com.hai.dao; + +import com.hai.entity.HighDiscountPackageDeliverUser; +import com.hai.entity.HighDiscountPackageDeliverUserExample.Criteria; +import com.hai.entity.HighDiscountPackageDeliverUserExample.Criterion; +import com.hai.entity.HighDiscountPackageDeliverUserExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighDiscountPackageDeliverUserSqlProvider { + + public String countByExample(HighDiscountPackageDeliverUserExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_discount_package_deliver_user"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighDiscountPackageDeliverUserExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_discount_package_deliver_user"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighDiscountPackageDeliverUser record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_discount_package_deliver_user"); + + if (record.getPackageDeliverId() != null) { + sql.VALUES("package_deliver_id", "#{packageDeliverId,jdbcType=BIGINT}"); + } + + if (record.getSerialNumber() != null) { + sql.VALUES("serial_number", "#{serialNumber,jdbcType=VARCHAR}"); + } + + if (record.getPackageId() != null) { + sql.VALUES("package_id", "#{packageId,jdbcType=BIGINT}"); + } + + if (record.getPackageName() != null) { + sql.VALUES("package_name", "#{packageName,jdbcType=VARCHAR}"); + } + + if (record.getPackageActualId() != null) { + sql.VALUES("package_actual_id", "#{packageActualId,jdbcType=BIGINT}"); + } + + if (record.getUserId() != null) { + sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOpUserId() != null) { + sql.VALUES("op_user_id", "#{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.VALUES("op_user_name", "#{opUserName,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(HighDiscountPackageDeliverUserExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("package_deliver_id"); + sql.SELECT("serial_number"); + sql.SELECT("package_id"); + sql.SELECT("package_name"); + sql.SELECT("package_actual_id"); + sql.SELECT("user_id"); + sql.SELECT("user_phone"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("op_user_id"); + sql.SELECT("op_user_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_discount_package_deliver_user"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighDiscountPackageDeliverUser record = (HighDiscountPackageDeliverUser) parameter.get("record"); + HighDiscountPackageDeliverUserExample example = (HighDiscountPackageDeliverUserExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_discount_package_deliver_user"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getPackageDeliverId() != null) { + sql.SET("package_deliver_id = #{record.packageDeliverId,jdbcType=BIGINT}"); + } + + if (record.getSerialNumber() != null) { + sql.SET("serial_number = #{record.serialNumber,jdbcType=VARCHAR}"); + } + + if (record.getPackageId() != null) { + sql.SET("package_id = #{record.packageId,jdbcType=BIGINT}"); + } + + if (record.getPackageName() != null) { + sql.SET("package_name = #{record.packageName,jdbcType=VARCHAR}"); + } + + if (record.getPackageActualId() != null) { + sql.SET("package_actual_id = #{record.packageActualId,jdbcType=BIGINT}"); + } + + if (record.getUserId() != null) { + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOpUserId() != null) { + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{record.opUserName,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_package_deliver_user"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("package_deliver_id = #{record.packageDeliverId,jdbcType=BIGINT}"); + sql.SET("serial_number = #{record.serialNumber,jdbcType=VARCHAR}"); + sql.SET("package_id = #{record.packageId,jdbcType=BIGINT}"); + sql.SET("package_name = #{record.packageName,jdbcType=VARCHAR}"); + sql.SET("package_actual_id = #{record.packageActualId,jdbcType=BIGINT}"); + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + sql.SET("op_user_name = #{record.opUserName,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}"); + + HighDiscountPackageDeliverUserExample example = (HighDiscountPackageDeliverUserExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighDiscountPackageDeliverUser record) { + SQL sql = new SQL(); + sql.UPDATE("high_discount_package_deliver_user"); + + if (record.getPackageDeliverId() != null) { + sql.SET("package_deliver_id = #{packageDeliverId,jdbcType=BIGINT}"); + } + + if (record.getSerialNumber() != null) { + sql.SET("serial_number = #{serialNumber,jdbcType=VARCHAR}"); + } + + if (record.getPackageId() != null) { + sql.SET("package_id = #{packageId,jdbcType=BIGINT}"); + } + + if (record.getPackageName() != null) { + sql.SET("package_name = #{packageName,jdbcType=VARCHAR}"); + } + + if (record.getPackageActualId() != null) { + sql.SET("package_actual_id = #{packageActualId,jdbcType=BIGINT}"); + } + + if (record.getUserId() != null) { + sql.SET("user_id = #{userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOpUserId() != null) { + sql.SET("op_user_id = #{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{opUserName,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, HighDiscountPackageDeliverUserExample 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/entity/HighDiscountPackageDeliver.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageDeliver.java new file mode 100644 index 00000000..4b22c169 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageDeliver.java @@ -0,0 +1,216 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_discount_package_deliver + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighDiscountPackageDeliver implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 记录序号 + */ + private String serialNumber; + + /** + * 卷包id + */ + private Long packageId; + + /** + * 卷包名称 + */ + private String packageName; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 状态 1:进行中 2:已完成 + */ + private Integer status; + + /** + * 操作人id + */ + private Long opUserId; + + /** + * 操作人名称 + */ + private String opUserName; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public Long getPackageId() { + return packageId; + } + + public void setPackageId(Long packageId) { + this.packageId = packageId; + } + + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + 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 Long getOpUserId() { + return opUserId; + } + + public void setOpUserId(Long opUserId) { + this.opUserId = opUserId; + } + + public String getOpUserName() { + return opUserName; + } + + public void setOpUserName(String opUserName) { + this.opUserName = opUserName; + } + + 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; + } + HighDiscountPackageDeliver other = (HighDiscountPackageDeliver) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getSerialNumber() == null ? other.getSerialNumber() == null : this.getSerialNumber().equals(other.getSerialNumber())) + && (this.getPackageId() == null ? other.getPackageId() == null : this.getPackageId().equals(other.getPackageId())) + && (this.getPackageName() == null ? other.getPackageName() == null : this.getPackageName().equals(other.getPackageName())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) + && (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) + && (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 + ((getSerialNumber() == null) ? 0 : getSerialNumber().hashCode()); + result = prime * result + ((getPackageId() == null) ? 0 : getPackageId().hashCode()); + result = prime * result + ((getPackageName() == null) ? 0 : getPackageName().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); + result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().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(", serialNumber=").append(serialNumber); + sb.append(", packageId=").append(packageId); + sb.append(", packageName=").append(packageName); + sb.append(", createTime=").append(createTime); + sb.append(", status=").append(status); + sb.append(", opUserId=").append(opUserId); + sb.append(", opUserName=").append(opUserName); + 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/HighDiscountPackageDeliverExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageDeliverExample.java new file mode 100644 index 00000000..730ebe8d --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageDeliverExample.java @@ -0,0 +1,943 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighDiscountPackageDeliverExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighDiscountPackageDeliverExample() { + 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 andSerialNumberIsNull() { + addCriterion("serial_number is null"); + return (Criteria) this; + } + + public Criteria andSerialNumberIsNotNull() { + addCriterion("serial_number is not null"); + return (Criteria) this; + } + + public Criteria andSerialNumberEqualTo(String value) { + addCriterion("serial_number =", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotEqualTo(String value) { + addCriterion("serial_number <>", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThan(String value) { + addCriterion("serial_number >", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThanOrEqualTo(String value) { + addCriterion("serial_number >=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThan(String value) { + addCriterion("serial_number <", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThanOrEqualTo(String value) { + addCriterion("serial_number <=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLike(String value) { + addCriterion("serial_number like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotLike(String value) { + addCriterion("serial_number not like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberIn(List values) { + addCriterion("serial_number in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotIn(List values) { + addCriterion("serial_number not in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberBetween(String value1, String value2) { + addCriterion("serial_number between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotBetween(String value1, String value2) { + addCriterion("serial_number not between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andPackageIdIsNull() { + addCriterion("package_id is null"); + return (Criteria) this; + } + + public Criteria andPackageIdIsNotNull() { + addCriterion("package_id is not null"); + return (Criteria) this; + } + + public Criteria andPackageIdEqualTo(Long value) { + addCriterion("package_id =", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdNotEqualTo(Long value) { + addCriterion("package_id <>", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdGreaterThan(Long value) { + addCriterion("package_id >", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdGreaterThanOrEqualTo(Long value) { + addCriterion("package_id >=", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdLessThan(Long value) { + addCriterion("package_id <", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdLessThanOrEqualTo(Long value) { + addCriterion("package_id <=", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdIn(List values) { + addCriterion("package_id in", values, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdNotIn(List values) { + addCriterion("package_id not in", values, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdBetween(Long value1, Long value2) { + addCriterion("package_id between", value1, value2, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdNotBetween(Long value1, Long value2) { + addCriterion("package_id not between", value1, value2, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageNameIsNull() { + addCriterion("package_name is null"); + return (Criteria) this; + } + + public Criteria andPackageNameIsNotNull() { + addCriterion("package_name is not null"); + return (Criteria) this; + } + + public Criteria andPackageNameEqualTo(String value) { + addCriterion("package_name =", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameNotEqualTo(String value) { + addCriterion("package_name <>", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameGreaterThan(String value) { + addCriterion("package_name >", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameGreaterThanOrEqualTo(String value) { + addCriterion("package_name >=", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameLessThan(String value) { + addCriterion("package_name <", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameLessThanOrEqualTo(String value) { + addCriterion("package_name <=", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameLike(String value) { + addCriterion("package_name like", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameNotLike(String value) { + addCriterion("package_name not like", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameIn(List values) { + addCriterion("package_name in", values, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameNotIn(List values) { + addCriterion("package_name not in", values, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameBetween(String value1, String value2) { + addCriterion("package_name between", value1, value2, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameNotBetween(String value1, String value2) { + addCriterion("package_name not between", value1, value2, "packageName"); + 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 andOpUserIdIsNull() { + addCriterion("op_user_id is null"); + return (Criteria) this; + } + + public Criteria andOpUserIdIsNotNull() { + addCriterion("op_user_id is not null"); + return (Criteria) this; + } + + public Criteria andOpUserIdEqualTo(Long value) { + addCriterion("op_user_id =", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotEqualTo(Long value) { + addCriterion("op_user_id <>", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThan(Long value) { + addCriterion("op_user_id >", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_user_id >=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThan(Long value) { + addCriterion("op_user_id <", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThanOrEqualTo(Long value) { + addCriterion("op_user_id <=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdIn(List values) { + addCriterion("op_user_id in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotIn(List values) { + addCriterion("op_user_id not in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdBetween(Long value1, Long value2) { + addCriterion("op_user_id between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotBetween(Long value1, Long value2) { + addCriterion("op_user_id not between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNull() { + addCriterion("op_user_name is null"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNotNull() { + addCriterion("op_user_name is not null"); + return (Criteria) this; + } + + public Criteria andOpUserNameEqualTo(String value) { + addCriterion("op_user_name =", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotEqualTo(String value) { + addCriterion("op_user_name <>", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThan(String value) { + addCriterion("op_user_name >", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThanOrEqualTo(String value) { + addCriterion("op_user_name >=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThan(String value) { + addCriterion("op_user_name <", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThanOrEqualTo(String value) { + addCriterion("op_user_name <=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLike(String value) { + addCriterion("op_user_name like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotLike(String value) { + addCriterion("op_user_name not like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameIn(List values) { + addCriterion("op_user_name in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotIn(List values) { + addCriterion("op_user_name not in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameBetween(String value1, String value2) { + addCriterion("op_user_name between", value1, value2, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotBetween(String value1, String value2) { + addCriterion("op_user_name not between", value1, value2, "opUserName"); + 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/HighDiscountPackageDeliverUser.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageDeliverUser.java new file mode 100644 index 00000000..f7202590 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageDeliverUser.java @@ -0,0 +1,280 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_discount_package_deliver_user + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighDiscountPackageDeliverUser implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 赠送记录id + */ + private Long packageDeliverId; + + /** + * 赠送序号 + */ + private String serialNumber; + + /** + * 卷包id + */ + private Long packageId; + + /** + * 卷包名称 + */ + private String packageName; + + /** + * 卷包实际库存id + */ + private Long packageActualId; + + /** + * 用户id + */ + private Long userId; + + /** + * 用户手机号 + */ + private String userPhone; + + /** + * 状态 1:待领取 2:已领取 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 操作人id + */ + private Long opUserId; + + /** + * 操作人名称 + */ + private String opUserName; + + 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 getPackageDeliverId() { + return packageDeliverId; + } + + public void setPackageDeliverId(Long packageDeliverId) { + this.packageDeliverId = packageDeliverId; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public Long getPackageId() { + return packageId; + } + + public void setPackageId(Long packageId) { + this.packageId = packageId; + } + + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + public Long getPackageActualId() { + return packageActualId; + } + + public void setPackageActualId(Long packageActualId) { + this.packageActualId = packageActualId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUserPhone() { + return userPhone; + } + + public void setUserPhone(String userPhone) { + this.userPhone = userPhone; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getOpUserId() { + return opUserId; + } + + public void setOpUserId(Long opUserId) { + this.opUserId = opUserId; + } + + public String getOpUserName() { + return opUserName; + } + + public void setOpUserName(String opUserName) { + this.opUserName = opUserName; + } + + 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; + } + HighDiscountPackageDeliverUser other = (HighDiscountPackageDeliverUser) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getPackageDeliverId() == null ? other.getPackageDeliverId() == null : this.getPackageDeliverId().equals(other.getPackageDeliverId())) + && (this.getSerialNumber() == null ? other.getSerialNumber() == null : this.getSerialNumber().equals(other.getSerialNumber())) + && (this.getPackageId() == null ? other.getPackageId() == null : this.getPackageId().equals(other.getPackageId())) + && (this.getPackageName() == null ? other.getPackageName() == null : this.getPackageName().equals(other.getPackageName())) + && (this.getPackageActualId() == null ? other.getPackageActualId() == null : this.getPackageActualId().equals(other.getPackageActualId())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) + && (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) + && (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 + ((getPackageDeliverId() == null) ? 0 : getPackageDeliverId().hashCode()); + result = prime * result + ((getSerialNumber() == null) ? 0 : getSerialNumber().hashCode()); + result = prime * result + ((getPackageId() == null) ? 0 : getPackageId().hashCode()); + result = prime * result + ((getPackageName() == null) ? 0 : getPackageName().hashCode()); + result = prime * result + ((getPackageActualId() == null) ? 0 : getPackageActualId().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); + result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().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(", packageDeliverId=").append(packageDeliverId); + sb.append(", serialNumber=").append(serialNumber); + sb.append(", packageId=").append(packageId); + sb.append(", packageName=").append(packageName); + sb.append(", packageActualId=").append(packageActualId); + sb.append(", userId=").append(userId); + sb.append(", userPhone=").append(userPhone); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", opUserId=").append(opUserId); + sb.append(", opUserName=").append(opUserName); + 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/HighDiscountPackageDeliverUserExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageDeliverUserExample.java new file mode 100644 index 00000000..68bf8123 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageDeliverUserExample.java @@ -0,0 +1,1193 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighDiscountPackageDeliverUserExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighDiscountPackageDeliverUserExample() { + 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 andPackageDeliverIdIsNull() { + addCriterion("package_deliver_id is null"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdIsNotNull() { + addCriterion("package_deliver_id is not null"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdEqualTo(Long value) { + addCriterion("package_deliver_id =", value, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdNotEqualTo(Long value) { + addCriterion("package_deliver_id <>", value, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdGreaterThan(Long value) { + addCriterion("package_deliver_id >", value, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdGreaterThanOrEqualTo(Long value) { + addCriterion("package_deliver_id >=", value, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdLessThan(Long value) { + addCriterion("package_deliver_id <", value, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdLessThanOrEqualTo(Long value) { + addCriterion("package_deliver_id <=", value, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdIn(List values) { + addCriterion("package_deliver_id in", values, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdNotIn(List values) { + addCriterion("package_deliver_id not in", values, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdBetween(Long value1, Long value2) { + addCriterion("package_deliver_id between", value1, value2, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andPackageDeliverIdNotBetween(Long value1, Long value2) { + addCriterion("package_deliver_id not between", value1, value2, "packageDeliverId"); + return (Criteria) this; + } + + public Criteria andSerialNumberIsNull() { + addCriterion("serial_number is null"); + return (Criteria) this; + } + + public Criteria andSerialNumberIsNotNull() { + addCriterion("serial_number is not null"); + return (Criteria) this; + } + + public Criteria andSerialNumberEqualTo(String value) { + addCriterion("serial_number =", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotEqualTo(String value) { + addCriterion("serial_number <>", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThan(String value) { + addCriterion("serial_number >", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThanOrEqualTo(String value) { + addCriterion("serial_number >=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThan(String value) { + addCriterion("serial_number <", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThanOrEqualTo(String value) { + addCriterion("serial_number <=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLike(String value) { + addCriterion("serial_number like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotLike(String value) { + addCriterion("serial_number not like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberIn(List values) { + addCriterion("serial_number in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotIn(List values) { + addCriterion("serial_number not in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberBetween(String value1, String value2) { + addCriterion("serial_number between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotBetween(String value1, String value2) { + addCriterion("serial_number not between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andPackageIdIsNull() { + addCriterion("package_id is null"); + return (Criteria) this; + } + + public Criteria andPackageIdIsNotNull() { + addCriterion("package_id is not null"); + return (Criteria) this; + } + + public Criteria andPackageIdEqualTo(Long value) { + addCriterion("package_id =", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdNotEqualTo(Long value) { + addCriterion("package_id <>", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdGreaterThan(Long value) { + addCriterion("package_id >", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdGreaterThanOrEqualTo(Long value) { + addCriterion("package_id >=", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdLessThan(Long value) { + addCriterion("package_id <", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdLessThanOrEqualTo(Long value) { + addCriterion("package_id <=", value, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdIn(List values) { + addCriterion("package_id in", values, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdNotIn(List values) { + addCriterion("package_id not in", values, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdBetween(Long value1, Long value2) { + addCriterion("package_id between", value1, value2, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageIdNotBetween(Long value1, Long value2) { + addCriterion("package_id not between", value1, value2, "packageId"); + return (Criteria) this; + } + + public Criteria andPackageNameIsNull() { + addCriterion("package_name is null"); + return (Criteria) this; + } + + public Criteria andPackageNameIsNotNull() { + addCriterion("package_name is not null"); + return (Criteria) this; + } + + public Criteria andPackageNameEqualTo(String value) { + addCriterion("package_name =", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameNotEqualTo(String value) { + addCriterion("package_name <>", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameGreaterThan(String value) { + addCriterion("package_name >", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameGreaterThanOrEqualTo(String value) { + addCriterion("package_name >=", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameLessThan(String value) { + addCriterion("package_name <", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameLessThanOrEqualTo(String value) { + addCriterion("package_name <=", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameLike(String value) { + addCriterion("package_name like", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameNotLike(String value) { + addCriterion("package_name not like", value, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameIn(List values) { + addCriterion("package_name in", values, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameNotIn(List values) { + addCriterion("package_name not in", values, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameBetween(String value1, String value2) { + addCriterion("package_name between", value1, value2, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageNameNotBetween(String value1, String value2) { + addCriterion("package_name not between", value1, value2, "packageName"); + return (Criteria) this; + } + + public Criteria andPackageActualIdIsNull() { + addCriterion("package_actual_id is null"); + return (Criteria) this; + } + + public Criteria andPackageActualIdIsNotNull() { + addCriterion("package_actual_id is not null"); + return (Criteria) this; + } + + public Criteria andPackageActualIdEqualTo(Long value) { + addCriterion("package_actual_id =", value, "packageActualId"); + return (Criteria) this; + } + + public Criteria andPackageActualIdNotEqualTo(Long value) { + addCriterion("package_actual_id <>", value, "packageActualId"); + return (Criteria) this; + } + + public Criteria andPackageActualIdGreaterThan(Long value) { + addCriterion("package_actual_id >", value, "packageActualId"); + return (Criteria) this; + } + + public Criteria andPackageActualIdGreaterThanOrEqualTo(Long value) { + addCriterion("package_actual_id >=", value, "packageActualId"); + return (Criteria) this; + } + + public Criteria andPackageActualIdLessThan(Long value) { + addCriterion("package_actual_id <", value, "packageActualId"); + return (Criteria) this; + } + + public Criteria andPackageActualIdLessThanOrEqualTo(Long value) { + addCriterion("package_actual_id <=", value, "packageActualId"); + return (Criteria) this; + } + + public Criteria andPackageActualIdIn(List values) { + addCriterion("package_actual_id in", values, "packageActualId"); + return (Criteria) this; + } + + public Criteria andPackageActualIdNotIn(List values) { + addCriterion("package_actual_id not in", values, "packageActualId"); + return (Criteria) this; + } + + public Criteria andPackageActualIdBetween(Long value1, Long value2) { + addCriterion("package_actual_id between", value1, value2, "packageActualId"); + return (Criteria) this; + } + + public Criteria andPackageActualIdNotBetween(Long value1, Long value2) { + addCriterion("package_actual_id not between", value1, value2, "packageActualId"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNull() { + addCriterion("user_phone is null"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNotNull() { + addCriterion("user_phone is not null"); + return (Criteria) this; + } + + public Criteria andUserPhoneEqualTo(String value) { + addCriterion("user_phone =", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotEqualTo(String value) { + addCriterion("user_phone <>", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThan(String value) { + addCriterion("user_phone >", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThanOrEqualTo(String value) { + addCriterion("user_phone >=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThan(String value) { + addCriterion("user_phone <", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThanOrEqualTo(String value) { + addCriterion("user_phone <=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLike(String value) { + addCriterion("user_phone like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotLike(String value) { + addCriterion("user_phone not like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneIn(List values) { + addCriterion("user_phone in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotIn(List values) { + addCriterion("user_phone not in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneBetween(String value1, String value2) { + addCriterion("user_phone between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotBetween(String value1, String value2) { + addCriterion("user_phone not between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria 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 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 andOpUserIdIsNull() { + addCriterion("op_user_id is null"); + return (Criteria) this; + } + + public Criteria andOpUserIdIsNotNull() { + addCriterion("op_user_id is not null"); + return (Criteria) this; + } + + public Criteria andOpUserIdEqualTo(Long value) { + addCriterion("op_user_id =", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotEqualTo(Long value) { + addCriterion("op_user_id <>", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThan(Long value) { + addCriterion("op_user_id >", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_user_id >=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThan(Long value) { + addCriterion("op_user_id <", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThanOrEqualTo(Long value) { + addCriterion("op_user_id <=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdIn(List values) { + addCriterion("op_user_id in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotIn(List values) { + addCriterion("op_user_id not in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdBetween(Long value1, Long value2) { + addCriterion("op_user_id between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotBetween(Long value1, Long value2) { + addCriterion("op_user_id not between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNull() { + addCriterion("op_user_name is null"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNotNull() { + addCriterion("op_user_name is not null"); + return (Criteria) this; + } + + public Criteria andOpUserNameEqualTo(String value) { + addCriterion("op_user_name =", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotEqualTo(String value) { + addCriterion("op_user_name <>", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThan(String value) { + addCriterion("op_user_name >", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThanOrEqualTo(String value) { + addCriterion("op_user_name >=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThan(String value) { + addCriterion("op_user_name <", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThanOrEqualTo(String value) { + addCriterion("op_user_name <=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLike(String value) { + addCriterion("op_user_name like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotLike(String value) { + addCriterion("op_user_name not like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameIn(List values) { + addCriterion("op_user_name in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotIn(List values) { + addCriterion("op_user_name not in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameBetween(String value1, String value2) { + addCriterion("op_user_name between", value1, value2, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotBetween(String value1, String value2) { + addCriterion("op_user_name not between", value1, value2, "opUserName"); + 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/service/HighDiscountPackageDeliverService.java b/hai-service/src/main/java/com/hai/service/HighDiscountPackageDeliverService.java new file mode 100644 index 00000000..06c38348 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighDiscountPackageDeliverService.java @@ -0,0 +1,36 @@ +package com.hai.service; + +import com.hai.entity.HighDiscountPackageDeliver; +import com.hai.entity.HighDiscountPackageDeliverUser; + +/** + * 卷包服务赠送任务记录 + */ +public interface HighDiscountPackageDeliverService { + + /** + * 插入赠送任务记录 + * @param discountPackageDeliver + */ + void insertDeliver(HighDiscountPackageDeliver discountPackageDeliver); + + /** + * 修改赠送任务记录 + * @param discountPackageDeliver + */ + void updateDeliver(HighDiscountPackageDeliver discountPackageDeliver); + + /** + * 根据包id查询处理中的任务 + * @param packageId + * @return + */ + HighDiscountPackageDeliver getHandleByPackageId(Long packageId); + + /** + * 插入赠送用户记录 + * @param discountPackageDeliverUser + */ + void insertDeliverUser(HighDiscountPackageDeliverUser discountPackageDeliverUser); + +} diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java b/hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java index a68c8d07..130b749a 100644 --- a/hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java +++ b/hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java @@ -2,6 +2,7 @@ package com.hai.service; import com.hai.entity.HighDiscount; import com.hai.entity.HighDiscountPackage; +import com.hai.entity.HighDiscountPackageActual; import com.hai.entity.HighDiscountPackageRecord; import com.hai.model.UserInfoModel; import io.swagger.models.auth.In; @@ -97,7 +98,7 @@ public interface HighDiscountPackageService { * @Param [java.lang.Long] * @return void */ - void freeUserDiscountPackage(Map map) throws Exception; + HighDiscountPackageActual freeUserDiscountPackage(Map map) throws Exception; /** * 赠送优惠券包 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageDeliverServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageDeliverServiceImpl.java new file mode 100644 index 00000000..1e16bdbd --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageDeliverServiceImpl.java @@ -0,0 +1,52 @@ +package com.hai.service.impl; + +import com.hai.dao.HighDiscountPackageDeliverMapper; +import com.hai.dao.HighDiscountPackageDeliverUserMapper; +import com.hai.entity.HighDiscountPackageDeliver; +import com.hai.entity.HighDiscountPackageDeliverExample; +import com.hai.entity.HighDiscountPackageDeliverUser; +import com.hai.service.HighDiscountPackageDeliverService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +@Service("discountPackageDeliverService") +public class HighDiscountPackageDeliverServiceImpl implements HighDiscountPackageDeliverService { + + @Resource + HighDiscountPackageDeliverMapper discountPackageDeliverMapper; + + @Resource + HighDiscountPackageDeliverUserMapper discountPackageDeliverUserMapper; + + @Override + public void insertDeliver(HighDiscountPackageDeliver discountPackageDeliver) { + discountPackageDeliver.setCreateTime(new Date()); + discountPackageDeliver.setStatus(1); + discountPackageDeliverMapper.insert(discountPackageDeliver); + } + + @Override + public void updateDeliver(HighDiscountPackageDeliver discountPackageDeliver) { + discountPackageDeliverMapper.updateByPrimaryKey(discountPackageDeliver); + } + + @Override + public HighDiscountPackageDeliver getHandleByPackageId(Long packageId) { + HighDiscountPackageDeliverExample example = new HighDiscountPackageDeliverExample(); + example.createCriteria().andPackageIdEqualTo(packageId).andStatusEqualTo(1); + List list = discountPackageDeliverMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + + @Override + public void insertDeliverUser(HighDiscountPackageDeliverUser discountPackageDeliverUser) { + discountPackageDeliverUser.setCreateTime(new Date()); + discountPackageDeliverUserMapper.insert(discountPackageDeliverUser); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java index f1b3286a..fce999e5 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java @@ -4,6 +4,7 @@ import com.google.common.base.Stopwatch; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; +import com.hai.common.security.UserCenter; import com.hai.common.utils.DateUtil; import com.hai.common.utils.IDGenerator; import com.hai.common.utils.RedisUtil; @@ -58,6 +59,9 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic @Resource private HighDiscountPackageDiscountActualMapper discountPackageDiscountActualMapper; + @Resource + private HighDiscountPackageDeliverService discountPackageDeliverService; + @Resource private HighDiscountInventoryRecordMapper discountInventoryRecordMapper; @@ -67,7 +71,6 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic @Resource private HighDiscountPackageService highDiscountPackageService; - @Resource private HighDiscountUserRelMapper highDiscountUserRelMapper; @@ -80,6 +83,9 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic @Resource private HighDiscountPackageDiscountActualService discountPackageDiscountActualService; + @Resource + private UserCenter userCenter; + @Autowired private RedisUtil redisUtil; @@ -262,7 +268,7 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic @Override @Transactional(propagation= Propagation.REQUIRES_NEW) - public void freeUserDiscountPackage(Map map) throws Exception { + public HighDiscountPackageActual freeUserDiscountPackage(Map map) throws Exception { HighDiscountPackage highDiscountPackage = highDiscountPackageService.findDiscountPackageById(MapUtils.getInteger(map , "discountPackageId")); @@ -328,11 +334,15 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic discountPackageRecord.setExt1(MapUtils.getString(map , "userPhone")); discountPackageRecord.setCreatedTime(new Date()); highDiscountPackageRecordMapper.insert(discountPackageRecord); + + return discountPackageActual; } @Override @Transactional(propagation= Propagation.REQUIRES_NEW) public String giveAway(Long packageId, List phoneList) throws Exception { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + // 查询优惠券包 HighDiscountPackage discountPackage = findDiscountPackageById(packageId.intValue()); if (discountPackage == null) { @@ -346,13 +356,23 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic if (phoneList.size() > stockCount.intValue()) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "卷包库存不足"); } + + // 赠送记录流水 + String serialNum = System.currentTimeMillis()+""; + + HighDiscountPackageDeliver discountPackageDeliver = new HighDiscountPackageDeliver(); + discountPackageDeliver.setPackageId(packageId); + discountPackageDeliver.setPackageName(discountPackage.getTitle()); + discountPackageDeliver.setSerialNumber(serialNum); + discountPackageDeliver.setOpUserId(userInfoModel.getSecUser().getId()); + discountPackageDeliver.setOpUserName(userInfoModel.getSecUser().getUserName()); + discountPackageDeliverService.insertDeliver(discountPackageDeliver); + // 查询出来系统中的用户 Map userMap = new HashMap<>(); userMap.put("status", "1"); List listUser = highUserService.getListUser(userMap); - String serialNum = System.currentTimeMillis()+""; - new Thread(() -> { int alreadyProcessedNum = 0; for (String phone : phoneList) { @@ -364,7 +384,20 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic freeMap.put("discountPackageId", packageId); freeMap.put("userId", userList.get(0).getId()); freeMap.put("userPhone", userList.get(0).getPhone()); - freeUserDiscountPackage(freeMap); + HighDiscountPackageActual packageActual = freeUserDiscountPackage(freeMap); + + HighDiscountPackageDeliverUser deliverUser = new HighDiscountPackageDeliverUser(); + deliverUser.setPackageDeliverId(discountPackageDeliver.getId()); + deliverUser.setSerialNumber(System.currentTimeMillis()+""); + deliverUser.setPackageId(packageId); + deliverUser.setPackageName(discountPackage.getTitle()); + deliverUser.setPackageActualId(packageActual.getId().longValue()); + deliverUser.setUserId(userList.get(0).getId()); + deliverUser.setUserPhone(userList.get(0).getPhone()); + deliverUser.setStatus(2); + deliverUser.setOpUserId(userInfoModel.getSecUser().getId()); + deliverUser.setOpUserName(userInfoModel.getSecUser().getUserName()); + discountPackageDeliverService.insertDeliverUser(deliverUser); } else { // 注册用户信息 HighUser user = new HighUser(); @@ -381,7 +414,18 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic freeMap.put("discountPackageId", packageId); freeMap.put("userId", user.getId()); freeMap.put("userPhone", user.getPhone()); - freeUserDiscountPackage(freeMap); + HighDiscountPackageActual packageActual = freeUserDiscountPackage(freeMap); + + HighDiscountPackageDeliverUser deliverUser = new HighDiscountPackageDeliverUser(); + deliverUser.setPackageDeliverId(discountPackageDeliver.getId()); + deliverUser.setSerialNumber(System.currentTimeMillis()+""); + deliverUser.setPackageId(packageId); + deliverUser.setPackageName(discountPackage.getTitle()); + deliverUser.setPackageActualId(packageActual.getId().longValue()); + deliverUser.setUserId(userList.get(0).getId()); + deliverUser.setUserPhone(userList.get(0).getPhone()); + deliverUser.setStatus(2); + discountPackageDeliverService.insertDeliverUser(deliverUser); } } catch (Exception e) { e.printStackTrace(); @@ -390,6 +434,8 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic redisUtil.set(serialNum, alreadyProcessedNum); } } + discountPackageDeliver.setStatus(2); + discountPackageDeliverService.updateDeliver(discountPackageDeliver); redisUtil.del(serialNum); }).start(); return serialNum;