From 25d02c1fddb4e40555adba2492d897d5a3c1b6cd Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 27 Apr 2023 13:52:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hai/dao/GoodsPresentRecordMapper.java | 21 +++--- .../dao/GoodsPresentRecordSqlProvider.java | 14 ++++ .../com/hai/entity/GoodsPresentRecord.java | 16 +++++ .../hai/entity/GoodsPresentRecordExample.java | 70 +++++++++++++++++++ 4 files changed, 113 insertions(+), 8 deletions(-) diff --git a/hai-service/src/main/java/com/hai/dao/GoodsPresentRecordMapper.java b/hai-service/src/main/java/com/hai/dao/GoodsPresentRecordMapper.java index 9506f316..d705e264 100644 --- a/hai-service/src/main/java/com/hai/dao/GoodsPresentRecordMapper.java +++ b/hai-service/src/main/java/com/hai/dao/GoodsPresentRecordMapper.java @@ -41,15 +41,17 @@ public interface GoodsPresentRecordMapper extends GoodsPresentRecordMapperExt { @Insert({ "insert into goods_present_record (present_id, order_no, ", "order_id, child_order_id, ", - "`type`, source_id, num, ", - "create_time, update_time, ", - "op_id, op_name, `status`, ", + "`type`, source_id, source_name, ", + "num, create_time, ", + "update_time, op_id, ", + "op_name, `status`, ", "ext_1, ext_2, ext_3)", "values (#{presentId,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, ", "#{orderId,jdbcType=BIGINT}, #{childOrderId,jdbcType=BIGINT}, ", - "#{type,jdbcType=INTEGER}, #{sourceId,jdbcType=BIGINT}, #{num,jdbcType=INTEGER}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, ", + "#{type,jdbcType=INTEGER}, #{sourceId,jdbcType=BIGINT}, #{sourceName,jdbcType=VARCHAR}, ", + "#{num,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{opId,jdbcType=BIGINT}, ", + "#{opName,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, ", "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") @@ -68,6 +70,7 @@ public interface GoodsPresentRecordMapper extends GoodsPresentRecordMapperExt { @Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_name", property="sourceName", jdbcType=JdbcType.VARCHAR), @Result(column="num", property="num", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @@ -82,8 +85,8 @@ public interface GoodsPresentRecordMapper extends GoodsPresentRecordMapperExt { @Select({ "select", - "id, present_id, order_no, order_id, child_order_id, `type`, source_id, num, ", - "create_time, update_time, op_id, op_name, `status`, ext_1, ext_2, ext_3", + "id, present_id, order_no, order_id, child_order_id, `type`, source_id, source_name, ", + "num, create_time, update_time, op_id, op_name, `status`, ext_1, ext_2, ext_3", "from goods_present_record", "where id = #{id,jdbcType=BIGINT}" }) @@ -95,6 +98,7 @@ public interface GoodsPresentRecordMapper extends GoodsPresentRecordMapperExt { @Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_name", property="sourceName", jdbcType=JdbcType.VARCHAR), @Result(column="num", property="num", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @@ -124,6 +128,7 @@ public interface GoodsPresentRecordMapper extends GoodsPresentRecordMapperExt { "child_order_id = #{childOrderId,jdbcType=BIGINT},", "`type` = #{type,jdbcType=INTEGER},", "source_id = #{sourceId,jdbcType=BIGINT},", + "source_name = #{sourceName,jdbcType=VARCHAR},", "num = #{num,jdbcType=INTEGER},", "create_time = #{createTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", diff --git a/hai-service/src/main/java/com/hai/dao/GoodsPresentRecordSqlProvider.java b/hai-service/src/main/java/com/hai/dao/GoodsPresentRecordSqlProvider.java index b25c706c..8ef5ef3f 100644 --- a/hai-service/src/main/java/com/hai/dao/GoodsPresentRecordSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/GoodsPresentRecordSqlProvider.java @@ -52,6 +52,10 @@ public class GoodsPresentRecordSqlProvider { sql.VALUES("source_id", "#{sourceId,jdbcType=BIGINT}"); } + if (record.getSourceName() != null) { + sql.VALUES("source_name", "#{sourceName,jdbcType=VARCHAR}"); + } + if (record.getNum() != null) { sql.VALUES("num", "#{num,jdbcType=INTEGER}"); } @@ -104,6 +108,7 @@ public class GoodsPresentRecordSqlProvider { sql.SELECT("child_order_id"); sql.SELECT("`type`"); sql.SELECT("source_id"); + sql.SELECT("source_name"); sql.SELECT("num"); sql.SELECT("create_time"); sql.SELECT("update_time"); @@ -158,6 +163,10 @@ public class GoodsPresentRecordSqlProvider { sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); } + if (record.getSourceName() != null) { + sql.SET("source_name = #{record.sourceName,jdbcType=VARCHAR}"); + } + if (record.getNum() != null) { sql.SET("num = #{record.num,jdbcType=INTEGER}"); } @@ -209,6 +218,7 @@ public class GoodsPresentRecordSqlProvider { sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); + sql.SET("source_name = #{record.sourceName,jdbcType=VARCHAR}"); sql.SET("num = #{record.num,jdbcType=INTEGER}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); @@ -252,6 +262,10 @@ public class GoodsPresentRecordSqlProvider { sql.SET("source_id = #{sourceId,jdbcType=BIGINT}"); } + if (record.getSourceName() != null) { + sql.SET("source_name = #{sourceName,jdbcType=VARCHAR}"); + } + if (record.getNum() != null) { sql.SET("num = #{num,jdbcType=INTEGER}"); } diff --git a/hai-service/src/main/java/com/hai/entity/GoodsPresentRecord.java b/hai-service/src/main/java/com/hai/entity/GoodsPresentRecord.java index d293843f..444c5b71 100644 --- a/hai-service/src/main/java/com/hai/entity/GoodsPresentRecord.java +++ b/hai-service/src/main/java/com/hai/entity/GoodsPresentRecord.java @@ -48,6 +48,11 @@ public class GoodsPresentRecord implements Serializable { */ private Long sourceId; + /** + * 来源名称 + */ + private String sourceName; + /** * 赠送数量 */ @@ -151,6 +156,14 @@ public class GoodsPresentRecord implements Serializable { this.sourceId = sourceId; } + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + public Integer getNum() { return num; } @@ -242,6 +255,7 @@ public class GoodsPresentRecord implements Serializable { && (this.getChildOrderId() == null ? other.getChildOrderId() == null : this.getChildOrderId().equals(other.getChildOrderId())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getSourceId() == null ? other.getSourceId() == null : this.getSourceId().equals(other.getSourceId())) + && (this.getSourceName() == null ? other.getSourceName() == null : this.getSourceName().equals(other.getSourceName())) && (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) @@ -264,6 +278,7 @@ public class GoodsPresentRecord implements Serializable { result = prime * result + ((getChildOrderId() == null) ? 0 : getChildOrderId().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getSourceId() == null) ? 0 : getSourceId().hashCode()); + result = prime * result + ((getSourceName() == null) ? 0 : getSourceName().hashCode()); result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); @@ -289,6 +304,7 @@ public class GoodsPresentRecord implements Serializable { sb.append(", childOrderId=").append(childOrderId); sb.append(", type=").append(type); sb.append(", sourceId=").append(sourceId); + sb.append(", sourceName=").append(sourceName); sb.append(", num=").append(num); sb.append(", createTime=").append(createTime); sb.append(", updateTime=").append(updateTime); diff --git a/hai-service/src/main/java/com/hai/entity/GoodsPresentRecordExample.java b/hai-service/src/main/java/com/hai/entity/GoodsPresentRecordExample.java index 535eec05..2f5d3811 100644 --- a/hai-service/src/main/java/com/hai/entity/GoodsPresentRecordExample.java +++ b/hai-service/src/main/java/com/hai/entity/GoodsPresentRecordExample.java @@ -555,6 +555,76 @@ public class GoodsPresentRecordExample { return (Criteria) this; } + public Criteria andSourceNameIsNull() { + addCriterion("source_name is null"); + return (Criteria) this; + } + + public Criteria andSourceNameIsNotNull() { + addCriterion("source_name is not null"); + return (Criteria) this; + } + + public Criteria andSourceNameEqualTo(String value) { + addCriterion("source_name =", value, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameNotEqualTo(String value) { + addCriterion("source_name <>", value, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameGreaterThan(String value) { + addCriterion("source_name >", value, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameGreaterThanOrEqualTo(String value) { + addCriterion("source_name >=", value, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameLessThan(String value) { + addCriterion("source_name <", value, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameLessThanOrEqualTo(String value) { + addCriterion("source_name <=", value, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameLike(String value) { + addCriterion("source_name like", value, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameNotLike(String value) { + addCriterion("source_name not like", value, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameIn(List values) { + addCriterion("source_name in", values, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameNotIn(List values) { + addCriterion("source_name not in", values, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameBetween(String value1, String value2) { + addCriterion("source_name between", value1, value2, "sourceName"); + return (Criteria) this; + } + + public Criteria andSourceNameNotBetween(String value1, String value2) { + addCriterion("source_name not between", value1, value2, "sourceName"); + return (Criteria) this; + } + public Criteria andNumIsNull() { addCriterion("num is null"); return (Criteria) this;