From 5cf564c0ef4080e03c2c96c84f0761f7290b2dea Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 7 Dec 2021 16:35:54 +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 --- .../hai/dao/HighDiscountPackageMapper.java | 19 ++- .../dao/HighDiscountPackageSqlProvider.java | 28 ++++ .../com/hai/entity/HighDiscountPackage.java | 34 ++++- .../entity/HighDiscountPackageExample.java | 120 ++++++++++++++++++ 4 files changed, 195 insertions(+), 6 deletions(-) diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageMapper.java index 4ee5962a..894b79a3 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageMapper.java @@ -46,8 +46,9 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt "banner_img, details_img, ", "created_user_id, created_time, ", "updated_user_id, updated_time, ", - "`status`, ext_1, ext_2, ", - "ext_3)", + "`status`, total_stock, ", + "surplus_stock, ext_1, ", + "ext_2, ext_3)", "values (#{companyId,jdbcType=INTEGER}, #{usingAttribution,jdbcType=INTEGER}, ", "#{title,jdbcType=VARCHAR}, #{salesType,jdbcType=INTEGER}, ", "#{effectiveTiem,jdbcType=TIMESTAMP}, #{price,jdbcType=DECIMAL}, ", @@ -55,8 +56,9 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt "#{bannerImg,jdbcType=VARCHAR}, #{detailsImg,jdbcType=VARCHAR}, ", "#{createdUserId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, ", "#{updatedUserId,jdbcType=INTEGER}, #{updatedTime,jdbcType=TIMESTAMP}, ", - "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", - "#{ext3,jdbcType=VARCHAR})" + "#{status,jdbcType=INTEGER}, #{totalStock,jdbcType=INTEGER}, ", + "#{surplusStock,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighDiscountPackage record); @@ -83,6 +85,8 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt @Result(column="updated_user_id", property="updatedUserId", jdbcType=JdbcType.INTEGER), @Result(column="updated_time", property="updatedTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="total_stock", property="totalStock", jdbcType=JdbcType.INTEGER), + @Result(column="surplus_stock", property="surplusStock", jdbcType=JdbcType.INTEGER), @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) @@ -93,7 +97,8 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt "select", "id, company_id, using_attribution, title, sales_type, effective_tiem, price, ", "purchase_num, list_img, banner_img, details_img, created_user_id, created_time, ", - "updated_user_id, updated_time, `status`, ext_1, ext_2, ext_3", + "updated_user_id, updated_time, `status`, total_stock, surplus_stock, ext_1, ", + "ext_2, ext_3", "from high_discount_package", "where id = #{id,jdbcType=INTEGER}" }) @@ -114,6 +119,8 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt @Result(column="updated_user_id", property="updatedUserId", jdbcType=JdbcType.INTEGER), @Result(column="updated_time", property="updatedTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="total_stock", property="totalStock", jdbcType=JdbcType.INTEGER), + @Result(column="surplus_stock", property="surplusStock", jdbcType=JdbcType.INTEGER), @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) @@ -146,6 +153,8 @@ public interface HighDiscountPackageMapper extends HighDiscountPackageMapperExt "updated_user_id = #{updatedUserId,jdbcType=INTEGER},", "updated_time = #{updatedTime,jdbcType=TIMESTAMP},", "`status` = #{status,jdbcType=INTEGER},", + "total_stock = #{totalStock,jdbcType=INTEGER},", + "surplus_stock = #{surplusStock,jdbcType=INTEGER},", "ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_2 = #{ext2,jdbcType=VARCHAR},", "ext_3 = #{ext3,jdbcType=VARCHAR}", diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageSqlProvider.java index fc173fa1..b303f25e 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountPackageSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountPackageSqlProvider.java @@ -88,6 +88,14 @@ public class HighDiscountPackageSqlProvider { sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); } + if (record.getTotalStock() != null) { + sql.VALUES("total_stock", "#{totalStock,jdbcType=INTEGER}"); + } + + if (record.getSurplusStock() != null) { + sql.VALUES("surplus_stock", "#{surplusStock,jdbcType=INTEGER}"); + } + if (record.getExt1() != null) { sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); } @@ -125,6 +133,8 @@ public class HighDiscountPackageSqlProvider { sql.SELECT("updated_user_id"); sql.SELECT("updated_time"); sql.SELECT("`status`"); + sql.SELECT("total_stock"); + sql.SELECT("surplus_stock"); sql.SELECT("ext_1"); sql.SELECT("ext_2"); sql.SELECT("ext_3"); @@ -209,6 +219,14 @@ public class HighDiscountPackageSqlProvider { sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); } + if (record.getTotalStock() != null) { + sql.SET("total_stock = #{record.totalStock,jdbcType=INTEGER}"); + } + + if (record.getSurplusStock() != null) { + sql.SET("surplus_stock = #{record.surplusStock,jdbcType=INTEGER}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); } @@ -245,6 +263,8 @@ public class HighDiscountPackageSqlProvider { sql.SET("updated_user_id = #{record.updatedUserId,jdbcType=INTEGER}"); sql.SET("updated_time = #{record.updatedTime,jdbcType=TIMESTAMP}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("total_stock = #{record.totalStock,jdbcType=INTEGER}"); + sql.SET("surplus_stock = #{record.surplusStock,jdbcType=INTEGER}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); @@ -318,6 +338,14 @@ public class HighDiscountPackageSqlProvider { sql.SET("`status` = #{status,jdbcType=INTEGER}"); } + if (record.getTotalStock() != null) { + sql.SET("total_stock = #{totalStock,jdbcType=INTEGER}"); + } + + if (record.getSurplusStock() != null) { + sql.SET("surplus_stock = #{surplusStock,jdbcType=INTEGER}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java index 2841f2fb..41715a32 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackage.java @@ -77,7 +77,7 @@ public class HighDiscountPackage implements Serializable { /** * 创建时间 */ - private Date createdTime; + private Date createdTime; /** * 更新人 @@ -94,6 +94,16 @@ public class HighDiscountPackage implements Serializable { */ private Integer status; + /** + * 总库存 + */ + private Integer totalStock; + + /** + * 剩余库存 + */ + private Integer surplusStock; + /** * 扩展字段 */ @@ -239,6 +249,22 @@ public class HighDiscountPackage implements Serializable { this.status = status; } + public Integer getTotalStock() { + return totalStock; + } + + public void setTotalStock(Integer totalStock) { + this.totalStock = totalStock; + } + + public Integer getSurplusStock() { + return surplusStock; + } + + public void setSurplusStock(Integer surplusStock) { + this.surplusStock = surplusStock; + } + public String getExt1() { return ext1; } @@ -291,6 +317,8 @@ public class HighDiscountPackage implements Serializable { && (this.getUpdatedUserId() == null ? other.getUpdatedUserId() == null : this.getUpdatedUserId().equals(other.getUpdatedUserId())) && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getTotalStock() == null ? other.getTotalStock() == null : this.getTotalStock().equals(other.getTotalStock())) + && (this.getSurplusStock() == null ? other.getSurplusStock() == null : this.getSurplusStock().equals(other.getSurplusStock())) && (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())); @@ -316,6 +344,8 @@ public class HighDiscountPackage implements Serializable { result = prime * result + ((getUpdatedUserId() == null) ? 0 : getUpdatedUserId().hashCode()); result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getTotalStock() == null) ? 0 : getTotalStock().hashCode()); + result = prime * result + ((getSurplusStock() == null) ? 0 : getSurplusStock().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()); @@ -344,6 +374,8 @@ public class HighDiscountPackage implements Serializable { sb.append(", updatedUserId=").append(updatedUserId); sb.append(", updatedTime=").append(updatedTime); sb.append(", status=").append(status); + sb.append(", totalStock=").append(totalStock); + sb.append(", surplusStock=").append(surplusStock); sb.append(", ext1=").append(ext1); sb.append(", ext2=").append(ext2); sb.append(", ext3=").append(ext3); diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageExample.java index 5cc6b3f9..b8014001 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountPackageExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountPackageExample.java @@ -1126,6 +1126,126 @@ public class HighDiscountPackageExample { return (Criteria) this; } + public Criteria andTotalStockIsNull() { + addCriterion("total_stock is null"); + return (Criteria) this; + } + + public Criteria andTotalStockIsNotNull() { + addCriterion("total_stock is not null"); + return (Criteria) this; + } + + public Criteria andTotalStockEqualTo(Integer value) { + addCriterion("total_stock =", value, "totalStock"); + return (Criteria) this; + } + + public Criteria andTotalStockNotEqualTo(Integer value) { + addCriterion("total_stock <>", value, "totalStock"); + return (Criteria) this; + } + + public Criteria andTotalStockGreaterThan(Integer value) { + addCriterion("total_stock >", value, "totalStock"); + return (Criteria) this; + } + + public Criteria andTotalStockGreaterThanOrEqualTo(Integer value) { + addCriterion("total_stock >=", value, "totalStock"); + return (Criteria) this; + } + + public Criteria andTotalStockLessThan(Integer value) { + addCriterion("total_stock <", value, "totalStock"); + return (Criteria) this; + } + + public Criteria andTotalStockLessThanOrEqualTo(Integer value) { + addCriterion("total_stock <=", value, "totalStock"); + return (Criteria) this; + } + + public Criteria andTotalStockIn(List values) { + addCriterion("total_stock in", values, "totalStock"); + return (Criteria) this; + } + + public Criteria andTotalStockNotIn(List values) { + addCriterion("total_stock not in", values, "totalStock"); + return (Criteria) this; + } + + public Criteria andTotalStockBetween(Integer value1, Integer value2) { + addCriterion("total_stock between", value1, value2, "totalStock"); + return (Criteria) this; + } + + public Criteria andTotalStockNotBetween(Integer value1, Integer value2) { + addCriterion("total_stock not between", value1, value2, "totalStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockIsNull() { + addCriterion("surplus_stock is null"); + return (Criteria) this; + } + + public Criteria andSurplusStockIsNotNull() { + addCriterion("surplus_stock is not null"); + return (Criteria) this; + } + + public Criteria andSurplusStockEqualTo(Integer value) { + addCriterion("surplus_stock =", value, "surplusStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockNotEqualTo(Integer value) { + addCriterion("surplus_stock <>", value, "surplusStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockGreaterThan(Integer value) { + addCriterion("surplus_stock >", value, "surplusStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockGreaterThanOrEqualTo(Integer value) { + addCriterion("surplus_stock >=", value, "surplusStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockLessThan(Integer value) { + addCriterion("surplus_stock <", value, "surplusStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockLessThanOrEqualTo(Integer value) { + addCriterion("surplus_stock <=", value, "surplusStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockIn(List values) { + addCriterion("surplus_stock in", values, "surplusStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockNotIn(List values) { + addCriterion("surplus_stock not in", values, "surplusStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockBetween(Integer value1, Integer value2) { + addCriterion("surplus_stock between", value1, value2, "surplusStock"); + return (Criteria) this; + } + + public Criteria andSurplusStockNotBetween(Integer value1, Integer value2) { + addCriterion("surplus_stock not between", value1, value2, "surplusStock"); + return (Criteria) this; + } + public Criteria andExt1IsNull() { addCriterion("ext_1 is null"); return (Criteria) this;