From 5b5560d32c890be4e45ec0dd8de56254521646c0 Mon Sep 17 00:00:00 2001 From: YuanYe <418471657@qq.com> Date: Mon, 15 Jul 2024 17:46:51 +0800 Subject: [PATCH] 1 --- .../java/com/hfkj/dao/GoodsTypeMapper.java | 15 +++-- .../com/hfkj/dao/GoodsTypeSqlProvider.java | 14 +++++ .../main/java/com/hfkj/entity/GoodsType.java | 16 +++++ .../com/hfkj/entity/GoodsTypeExample.java | 60 +++++++++++++++++++ 4 files changed, 100 insertions(+), 5 deletions(-) diff --git a/service/src/main/java/com/hfkj/dao/GoodsTypeMapper.java b/service/src/main/java/com/hfkj/dao/GoodsTypeMapper.java index a471a91..d2e9289 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsTypeMapper.java +++ b/service/src/main/java/com/hfkj/dao/GoodsTypeMapper.java @@ -42,13 +42,15 @@ public interface GoodsTypeMapper extends GoodsTypeMapperExt { "insert into goods_type (parent_id, title, ", "business_type, img_url, ", "create_time, update_time, ", - "`status`, op_id, op_name, ", - "ext_1, ext_2, ext_3)", + "`status`, sort, op_id, ", + "op_name, ext_1, ext_2, ", + "ext_3)", "values (#{parentId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, ", "#{businessType,jdbcType=INTEGER}, #{imgUrl,jdbcType=VARCHAR}, ", "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{status,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{status,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, ", + "#{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", + "#{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(GoodsType record); @@ -67,6 +69,7 @@ public interface GoodsTypeMapper extends GoodsTypeMapperExt { @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -78,7 +81,7 @@ public interface GoodsTypeMapper extends GoodsTypeMapperExt { @Select({ "select", "id, parent_id, title, business_type, img_url, create_time, update_time, `status`, ", - "op_id, op_name, ext_1, ext_2, ext_3", + "sort, op_id, op_name, ext_1, ext_2, ext_3", "from goods_type", "where id = #{id,jdbcType=BIGINT}" }) @@ -91,6 +94,7 @@ public interface GoodsTypeMapper extends GoodsTypeMapperExt { @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -117,6 +121,7 @@ public interface GoodsTypeMapper extends GoodsTypeMapperExt { "create_time = #{createTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", "`status` = #{status,jdbcType=INTEGER},", + "sort = #{sort,jdbcType=INTEGER},", "op_id = #{opId,jdbcType=BIGINT},", "op_name = #{opName,jdbcType=VARCHAR},", "ext_1 = #{ext1,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/GoodsTypeSqlProvider.java b/service/src/main/java/com/hfkj/dao/GoodsTypeSqlProvider.java index 6ea8fac..6e7a65c 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsTypeSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/GoodsTypeSqlProvider.java @@ -56,6 +56,10 @@ public class GoodsTypeSqlProvider { sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); } + if (record.getSort() != null) { + sql.VALUES("sort", "#{sort,jdbcType=INTEGER}"); + } + if (record.getOpId() != null) { sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}"); } @@ -93,6 +97,7 @@ public class GoodsTypeSqlProvider { sql.SELECT("create_time"); sql.SELECT("update_time"); sql.SELECT("`status`"); + sql.SELECT("sort"); sql.SELECT("op_id"); sql.SELECT("op_name"); sql.SELECT("ext_1"); @@ -147,6 +152,10 @@ public class GoodsTypeSqlProvider { sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); } + if (record.getSort() != null) { + sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); + } + if (record.getOpId() != null) { sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); } @@ -183,6 +192,7 @@ public class GoodsTypeSqlProvider { sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); @@ -226,6 +236,10 @@ public class GoodsTypeSqlProvider { sql.SET("`status` = #{status,jdbcType=INTEGER}"); } + if (record.getSort() != null) { + sql.SET("sort = #{sort,jdbcType=INTEGER}"); + } + if (record.getOpId() != null) { sql.SET("op_id = #{opId,jdbcType=BIGINT}"); } diff --git a/service/src/main/java/com/hfkj/entity/GoodsType.java b/service/src/main/java/com/hfkj/entity/GoodsType.java index 745600e..f2b8644 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsType.java +++ b/service/src/main/java/com/hfkj/entity/GoodsType.java @@ -53,6 +53,11 @@ public class GoodsType implements Serializable { */ private Integer status; + /** + * 排序 + */ + private Integer sort; + /** * 操作人 */ @@ -144,6 +149,14 @@ public class GoodsType implements Serializable { this.status = status; } + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + public Long getOpId() { return opId; } @@ -204,6 +217,7 @@ public class GoodsType implements Serializable { && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort())) && (this.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId())) && (this.getOpName() == null ? other.getOpName() == null : this.getOpName().equals(other.getOpName())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) @@ -223,6 +237,7 @@ public class GoodsType implements Serializable { result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode()); result = prime * result + ((getOpId() == null) ? 0 : getOpId().hashCode()); result = prime * result + ((getOpName() == null) ? 0 : getOpName().hashCode()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); @@ -245,6 +260,7 @@ public class GoodsType implements Serializable { sb.append(", createTime=").append(createTime); sb.append(", updateTime=").append(updateTime); sb.append(", status=").append(status); + sb.append(", sort=").append(sort); sb.append(", opId=").append(opId); sb.append(", opName=").append(opName); sb.append(", ext1=").append(ext1); diff --git a/service/src/main/java/com/hfkj/entity/GoodsTypeExample.java b/service/src/main/java/com/hfkj/entity/GoodsTypeExample.java index 3a84281..65efde9 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsTypeExample.java +++ b/service/src/main/java/com/hfkj/entity/GoodsTypeExample.java @@ -625,6 +625,66 @@ public class GoodsTypeExample { return (Criteria) this; } + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(Integer value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(Integer value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(Integer value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(Integer value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(Integer value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(Integer value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(Integer value1, Integer value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(Integer value1, Integer value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + public Criteria andOpIdIsNull() { addCriterion("op_id is null"); return (Criteria) this;