From c3470001a5a7a41a815a8a1f251894d8440b07f7 Mon Sep 17 00:00:00 2001 From: YuanYe <418471657@qq.com> Date: Sat, 23 Nov 2024 15:26:56 +0800 Subject: [PATCH] 1 --- .../java/com/hfkj/dao/GoodsSpecsMapper.java | 27 +++--- .../com/hfkj/dao/GoodsSpecsSqlProvider.java | 14 +++ .../main/java/com/hfkj/entity/GoodsSpecs.java | 93 +++---------------- .../com/hfkj/entity/GoodsSpecsExample.java | 60 ++++++++++++ 4 files changed, 103 insertions(+), 91 deletions(-) diff --git a/service/src/main/java/com/hfkj/dao/GoodsSpecsMapper.java b/service/src/main/java/com/hfkj/dao/GoodsSpecsMapper.java index ac30263..0126122 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsSpecsMapper.java +++ b/service/src/main/java/com/hfkj/dao/GoodsSpecsMapper.java @@ -42,17 +42,19 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { "insert into goods_specs (goods_id, third_id, ", "`name`, pur_limit, ", "sale_price, original_price, ", - "stock, show_img, ", - "sales_end_time, `status`, ", - "create_time, update_time, ", - "ext_1, ext_2, ext_3)", + "third_price, stock, ", + "show_img, sales_end_time, ", + "`status`, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", "values (#{goodsId,jdbcType=BIGINT}, #{thirdId,jdbcType=VARCHAR}, ", "#{name,jdbcType=VARCHAR}, #{purLimit,jdbcType=INTEGER}, ", "#{salePrice,jdbcType=DECIMAL}, #{originalPrice,jdbcType=DECIMAL}, ", - "#{stock,jdbcType=INTEGER}, #{showImg,jdbcType=VARCHAR}, ", - "#{salesEndTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{thirdPrice,jdbcType=DECIMAL}, #{stock,jdbcType=INTEGER}, ", + "#{showImg,jdbcType=VARCHAR}, #{salesEndTime,jdbcType=TIMESTAMP}, ", + "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(GoodsSpecs record); @@ -70,6 +72,7 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { @Result(column="pur_limit", property="purLimit", jdbcType=JdbcType.INTEGER), @Result(column="sale_price", property="salePrice", jdbcType=JdbcType.DECIMAL), @Result(column="original_price", property="originalPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="third_price", property="thirdPrice", jdbcType=JdbcType.DECIMAL), @Result(column="stock", property="stock", jdbcType=JdbcType.INTEGER), @Result(column="show_img", property="showImg", jdbcType=JdbcType.VARCHAR), @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), @@ -84,9 +87,9 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { @Select({ "select", - "id, goods_id, third_id, `name`, pur_limit, sale_price, original_price, stock, ", - "show_img, sales_end_time, `status`, create_time, update_time, ext_1, ext_2, ", - "ext_3", + "id, goods_id, third_id, `name`, pur_limit, sale_price, original_price, third_price, ", + "stock, show_img, sales_end_time, `status`, create_time, update_time, ext_1, ", + "ext_2, ext_3", "from goods_specs", "where id = #{id,jdbcType=BIGINT}" }) @@ -98,6 +101,7 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { @Result(column="pur_limit", property="purLimit", jdbcType=JdbcType.INTEGER), @Result(column="sale_price", property="salePrice", jdbcType=JdbcType.DECIMAL), @Result(column="original_price", property="originalPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="third_price", property="thirdPrice", jdbcType=JdbcType.DECIMAL), @Result(column="stock", property="stock", jdbcType=JdbcType.INTEGER), @Result(column="show_img", property="showImg", jdbcType=JdbcType.VARCHAR), @Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP), @@ -127,6 +131,7 @@ public interface GoodsSpecsMapper extends GoodsSpecsMapperExt { "pur_limit = #{purLimit,jdbcType=INTEGER},", "sale_price = #{salePrice,jdbcType=DECIMAL},", "original_price = #{originalPrice,jdbcType=DECIMAL},", + "third_price = #{thirdPrice,jdbcType=DECIMAL},", "stock = #{stock,jdbcType=INTEGER},", "show_img = #{showImg,jdbcType=VARCHAR},", "sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},", diff --git a/service/src/main/java/com/hfkj/dao/GoodsSpecsSqlProvider.java b/service/src/main/java/com/hfkj/dao/GoodsSpecsSqlProvider.java index 4b71112..aa0ee0a 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsSpecsSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/GoodsSpecsSqlProvider.java @@ -52,6 +52,10 @@ public class GoodsSpecsSqlProvider { sql.VALUES("original_price", "#{originalPrice,jdbcType=DECIMAL}"); } + if (record.getThirdPrice() != null) { + sql.VALUES("third_price", "#{thirdPrice,jdbcType=DECIMAL}"); + } + if (record.getStock() != null) { sql.VALUES("stock", "#{stock,jdbcType=INTEGER}"); } @@ -104,6 +108,7 @@ public class GoodsSpecsSqlProvider { sql.SELECT("pur_limit"); sql.SELECT("sale_price"); sql.SELECT("original_price"); + sql.SELECT("third_price"); sql.SELECT("stock"); sql.SELECT("show_img"); sql.SELECT("sales_end_time"); @@ -158,6 +163,10 @@ public class GoodsSpecsSqlProvider { sql.SET("original_price = #{record.originalPrice,jdbcType=DECIMAL}"); } + if (record.getThirdPrice() != null) { + sql.SET("third_price = #{record.thirdPrice,jdbcType=DECIMAL}"); + } + if (record.getStock() != null) { sql.SET("stock = #{record.stock,jdbcType=INTEGER}"); } @@ -209,6 +218,7 @@ public class GoodsSpecsSqlProvider { sql.SET("pur_limit = #{record.purLimit,jdbcType=INTEGER}"); sql.SET("sale_price = #{record.salePrice,jdbcType=DECIMAL}"); sql.SET("original_price = #{record.originalPrice,jdbcType=DECIMAL}"); + sql.SET("third_price = #{record.thirdPrice,jdbcType=DECIMAL}"); sql.SET("stock = #{record.stock,jdbcType=INTEGER}"); sql.SET("show_img = #{record.showImg,jdbcType=VARCHAR}"); sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}"); @@ -252,6 +262,10 @@ public class GoodsSpecsSqlProvider { sql.SET("original_price = #{originalPrice,jdbcType=DECIMAL}"); } + if (record.getThirdPrice() != null) { + sql.SET("third_price = #{thirdPrice,jdbcType=DECIMAL}"); + } + if (record.getStock() != null) { sql.SET("stock = #{stock,jdbcType=INTEGER}"); } diff --git a/service/src/main/java/com/hfkj/entity/GoodsSpecs.java b/service/src/main/java/com/hfkj/entity/GoodsSpecs.java index b2ac918..501dc4d 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsSpecs.java +++ b/service/src/main/java/com/hfkj/entity/GoodsSpecs.java @@ -49,6 +49,11 @@ public class GoodsSpecs implements Serializable { */ private BigDecimal originalPrice; + /** + * 三方价格 + */ + private BigDecimal thirdPrice; + /** * 库存 */ @@ -152,6 +157,14 @@ public class GoodsSpecs implements Serializable { this.originalPrice = originalPrice; } + public BigDecimal getThirdPrice() { + return thirdPrice; + } + + public void setThirdPrice(BigDecimal thirdPrice) { + this.thirdPrice = thirdPrice; + } + public Integer getStock() { return stock; } @@ -223,84 +236,4 @@ public class GoodsSpecs implements Serializable { 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; - } - GoodsSpecs other = (GoodsSpecs) that; - return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) - && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId())) - && (this.getThirdId() == null ? other.getThirdId() == null : this.getThirdId().equals(other.getThirdId())) - && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) - && (this.getPurLimit() == null ? other.getPurLimit() == null : this.getPurLimit().equals(other.getPurLimit())) - && (this.getSalePrice() == null ? other.getSalePrice() == null : this.getSalePrice().equals(other.getSalePrice())) - && (this.getOriginalPrice() == null ? other.getOriginalPrice() == null : this.getOriginalPrice().equals(other.getOriginalPrice())) - && (this.getStock() == null ? other.getStock() == null : this.getStock().equals(other.getStock())) - && (this.getShowImg() == null ? other.getShowImg() == null : this.getShowImg().equals(other.getShowImg())) - && (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime())) - && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) - && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) - && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) - && (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 + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode()); - result = prime * result + ((getThirdId() == null) ? 0 : getThirdId().hashCode()); - result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); - result = prime * result + ((getPurLimit() == null) ? 0 : getPurLimit().hashCode()); - result = prime * result + ((getSalePrice() == null) ? 0 : getSalePrice().hashCode()); - result = prime * result + ((getOriginalPrice() == null) ? 0 : getOriginalPrice().hashCode()); - result = prime * result + ((getStock() == null) ? 0 : getStock().hashCode()); - result = prime * result + ((getShowImg() == null) ? 0 : getShowImg().hashCode()); - result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode()); - result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); - result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); - result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().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(", goodsId=").append(goodsId); - sb.append(", thirdId=").append(thirdId); - sb.append(", name=").append(name); - sb.append(", purLimit=").append(purLimit); - sb.append(", salePrice=").append(salePrice); - sb.append(", originalPrice=").append(originalPrice); - sb.append(", stock=").append(stock); - sb.append(", showImg=").append(showImg); - sb.append(", salesEndTime=").append(salesEndTime); - sb.append(", status=").append(status); - sb.append(", createTime=").append(createTime); - sb.append(", updateTime=").append(updateTime); - 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/service/src/main/java/com/hfkj/entity/GoodsSpecsExample.java b/service/src/main/java/com/hfkj/entity/GoodsSpecsExample.java index 002b4e0..fef25f8 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsSpecsExample.java +++ b/service/src/main/java/com/hfkj/entity/GoodsSpecsExample.java @@ -566,6 +566,66 @@ public class GoodsSpecsExample { return (Criteria) this; } + public Criteria andThirdPriceIsNull() { + addCriterion("third_price is null"); + return (Criteria) this; + } + + public Criteria andThirdPriceIsNotNull() { + addCriterion("third_price is not null"); + return (Criteria) this; + } + + public Criteria andThirdPriceEqualTo(BigDecimal value) { + addCriterion("third_price =", value, "thirdPrice"); + return (Criteria) this; + } + + public Criteria andThirdPriceNotEqualTo(BigDecimal value) { + addCriterion("third_price <>", value, "thirdPrice"); + return (Criteria) this; + } + + public Criteria andThirdPriceGreaterThan(BigDecimal value) { + addCriterion("third_price >", value, "thirdPrice"); + return (Criteria) this; + } + + public Criteria andThirdPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("third_price >=", value, "thirdPrice"); + return (Criteria) this; + } + + public Criteria andThirdPriceLessThan(BigDecimal value) { + addCriterion("third_price <", value, "thirdPrice"); + return (Criteria) this; + } + + public Criteria andThirdPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("third_price <=", value, "thirdPrice"); + return (Criteria) this; + } + + public Criteria andThirdPriceIn(List values) { + addCriterion("third_price in", values, "thirdPrice"); + return (Criteria) this; + } + + public Criteria andThirdPriceNotIn(List values) { + addCriterion("third_price not in", values, "thirdPrice"); + return (Criteria) this; + } + + public Criteria andThirdPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("third_price between", value1, value2, "thirdPrice"); + return (Criteria) this; + } + + public Criteria andThirdPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("third_price not between", value1, value2, "thirdPrice"); + return (Criteria) this; + } + public Criteria andStockIsNull() { addCriterion("stock is null"); return (Criteria) this;