From fe51cf5bdb6bb6f4772781007c5137c8c34a789f Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Tue, 12 Jul 2022 11:50:19 +0800 Subject: [PATCH] 1 --- .../com/hai/dao/ApiMemberProductMapper.java | 27 +++++---- .../hai/dao/ApiMemberProductSqlProvider.java | 14 +++++ .../java/com/hai/entity/ApiMemberProduct.java | 16 +++++ .../hai/entity/ApiMemberProductExample.java | 60 +++++++++++++++++++ 4 files changed, 105 insertions(+), 12 deletions(-) diff --git a/hai-service/src/main/java/com/hai/dao/ApiMemberProductMapper.java b/hai-service/src/main/java/com/hai/dao/ApiMemberProductMapper.java index 3d837f5b..f66d53ca 100644 --- a/hai-service/src/main/java/com/hai/dao/ApiMemberProductMapper.java +++ b/hai-service/src/main/java/com/hai/dao/ApiMemberProductMapper.java @@ -41,18 +41,18 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt { @Insert({ "insert into api_member_product (`name`, type_id, ", "brand_id, price, ", - "product_id, sort, ", - "operator_id, operator_name, ", - "create_time, update_time, ", - "`status`, ext_1, ext_2, ", - "ext_3)", + "cost_price, product_id, ", + "sort, operator_id, ", + "operator_name, create_time, ", + "update_time, `status`, ", + "ext_1, ext_2, ext_3)", "values (#{name,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER}, ", "#{brandId,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, ", - "#{productId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, ", - "#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", - "#{ext3,jdbcType=VARCHAR})" + "#{costPrice,jdbcType=DECIMAL}, #{productId,jdbcType=VARCHAR}, ", + "#{sort,jdbcType=INTEGER}, #{operatorId,jdbcType=BIGINT}, ", + "#{operatorName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(ApiMemberProduct record); @@ -68,6 +68,7 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt { @Result(column="type_id", property="typeId", jdbcType=JdbcType.INTEGER), @Result(column="brand_id", property="brandId", jdbcType=JdbcType.INTEGER), @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="cost_price", property="costPrice", jdbcType=JdbcType.DECIMAL), @Result(column="product_id", property="productId", jdbcType=JdbcType.VARCHAR), @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), @@ -83,8 +84,8 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt { @Select({ "select", - "id, `name`, type_id, brand_id, price, product_id, sort, operator_id, operator_name, ", - "create_time, update_time, `status`, ext_1, ext_2, ext_3", + "id, `name`, type_id, brand_id, price, cost_price, product_id, sort, operator_id, ", + "operator_name, create_time, update_time, `status`, ext_1, ext_2, ext_3", "from api_member_product", "where id = #{id,jdbcType=BIGINT}" }) @@ -94,6 +95,7 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt { @Result(column="type_id", property="typeId", jdbcType=JdbcType.INTEGER), @Result(column="brand_id", property="brandId", jdbcType=JdbcType.INTEGER), @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="cost_price", property="costPrice", jdbcType=JdbcType.DECIMAL), @Result(column="product_id", property="productId", jdbcType=JdbcType.VARCHAR), @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), @@ -122,6 +124,7 @@ public interface ApiMemberProductMapper extends ApiMemberProductMapperExt { "type_id = #{typeId,jdbcType=INTEGER},", "brand_id = #{brandId,jdbcType=INTEGER},", "price = #{price,jdbcType=DECIMAL},", + "cost_price = #{costPrice,jdbcType=DECIMAL},", "product_id = #{productId,jdbcType=VARCHAR},", "sort = #{sort,jdbcType=INTEGER},", "operator_id = #{operatorId,jdbcType=BIGINT},", diff --git a/hai-service/src/main/java/com/hai/dao/ApiMemberProductSqlProvider.java b/hai-service/src/main/java/com/hai/dao/ApiMemberProductSqlProvider.java index 9a4ab3ea..87473130 100644 --- a/hai-service/src/main/java/com/hai/dao/ApiMemberProductSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/ApiMemberProductSqlProvider.java @@ -44,6 +44,10 @@ public class ApiMemberProductSqlProvider { sql.VALUES("price", "#{price,jdbcType=DECIMAL}"); } + if (record.getCostPrice() != null) { + sql.VALUES("cost_price", "#{costPrice,jdbcType=DECIMAL}"); + } + if (record.getProductId() != null) { sql.VALUES("product_id", "#{productId,jdbcType=VARCHAR}"); } @@ -98,6 +102,7 @@ public class ApiMemberProductSqlProvider { sql.SELECT("type_id"); sql.SELECT("brand_id"); sql.SELECT("price"); + sql.SELECT("cost_price"); sql.SELECT("product_id"); sql.SELECT("sort"); sql.SELECT("operator_id"); @@ -145,6 +150,10 @@ public class ApiMemberProductSqlProvider { sql.SET("price = #{record.price,jdbcType=DECIMAL}"); } + if (record.getCostPrice() != null) { + sql.SET("cost_price = #{record.costPrice,jdbcType=DECIMAL}"); + } + if (record.getProductId() != null) { sql.SET("product_id = #{record.productId,jdbcType=VARCHAR}"); } @@ -198,6 +207,7 @@ public class ApiMemberProductSqlProvider { sql.SET("type_id = #{record.typeId,jdbcType=INTEGER}"); sql.SET("brand_id = #{record.brandId,jdbcType=INTEGER}"); sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + sql.SET("cost_price = #{record.costPrice,jdbcType=DECIMAL}"); sql.SET("product_id = #{record.productId,jdbcType=VARCHAR}"); sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); @@ -234,6 +244,10 @@ public class ApiMemberProductSqlProvider { sql.SET("price = #{price,jdbcType=DECIMAL}"); } + if (record.getCostPrice() != null) { + sql.SET("cost_price = #{costPrice,jdbcType=DECIMAL}"); + } + if (record.getProductId() != null) { sql.SET("product_id = #{productId,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/entity/ApiMemberProduct.java b/hai-service/src/main/java/com/hai/entity/ApiMemberProduct.java index 08be3ec4..a1ac1f9a 100644 --- a/hai-service/src/main/java/com/hai/entity/ApiMemberProduct.java +++ b/hai-service/src/main/java/com/hai/entity/ApiMemberProduct.java @@ -39,6 +39,11 @@ public class ApiMemberProduct implements Serializable { */ private BigDecimal price; + /** + * 成本价 + */ + private BigDecimal costPrice; + /** * 产品id */ @@ -131,6 +136,14 @@ public class ApiMemberProduct implements Serializable { this.price = price; } + public BigDecimal getCostPrice() { + return costPrice; + } + + public void setCostPrice(BigDecimal costPrice) { + this.costPrice = costPrice; + } + public String getProductId() { return productId; } @@ -228,6 +241,7 @@ public class ApiMemberProduct implements Serializable { && (this.getTypeId() == null ? other.getTypeId() == null : this.getTypeId().equals(other.getTypeId())) && (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId())) && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) + && (this.getCostPrice() == null ? other.getCostPrice() == null : this.getCostPrice().equals(other.getCostPrice())) && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId())) && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort())) && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId())) @@ -249,6 +263,7 @@ public class ApiMemberProduct implements Serializable { result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode()); result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode()); result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); + result = prime * result + ((getCostPrice() == null) ? 0 : getCostPrice().hashCode()); result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode()); result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode()); result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode()); @@ -273,6 +288,7 @@ public class ApiMemberProduct implements Serializable { sb.append(", typeId=").append(typeId); sb.append(", brandId=").append(brandId); sb.append(", price=").append(price); + sb.append(", costPrice=").append(costPrice); sb.append(", productId=").append(productId); sb.append(", sort=").append(sort); sb.append(", operatorId=").append(operatorId); diff --git a/hai-service/src/main/java/com/hai/entity/ApiMemberProductExample.java b/hai-service/src/main/java/com/hai/entity/ApiMemberProductExample.java index 5a8cab87..2c951811 100644 --- a/hai-service/src/main/java/com/hai/entity/ApiMemberProductExample.java +++ b/hai-service/src/main/java/com/hai/entity/ApiMemberProductExample.java @@ -436,6 +436,66 @@ public class ApiMemberProductExample { return (Criteria) this; } + public Criteria andCostPriceIsNull() { + addCriterion("cost_price is null"); + return (Criteria) this; + } + + public Criteria andCostPriceIsNotNull() { + addCriterion("cost_price is not null"); + return (Criteria) this; + } + + public Criteria andCostPriceEqualTo(BigDecimal value) { + addCriterion("cost_price =", value, "costPrice"); + return (Criteria) this; + } + + public Criteria andCostPriceNotEqualTo(BigDecimal value) { + addCriterion("cost_price <>", value, "costPrice"); + return (Criteria) this; + } + + public Criteria andCostPriceGreaterThan(BigDecimal value) { + addCriterion("cost_price >", value, "costPrice"); + return (Criteria) this; + } + + public Criteria andCostPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("cost_price >=", value, "costPrice"); + return (Criteria) this; + } + + public Criteria andCostPriceLessThan(BigDecimal value) { + addCriterion("cost_price <", value, "costPrice"); + return (Criteria) this; + } + + public Criteria andCostPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("cost_price <=", value, "costPrice"); + return (Criteria) this; + } + + public Criteria andCostPriceIn(List values) { + addCriterion("cost_price in", values, "costPrice"); + return (Criteria) this; + } + + public Criteria andCostPriceNotIn(List values) { + addCriterion("cost_price not in", values, "costPrice"); + return (Criteria) this; + } + + public Criteria andCostPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("cost_price between", value1, value2, "costPrice"); + return (Criteria) this; + } + + public Criteria andCostPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("cost_price not between", value1, value2, "costPrice"); + return (Criteria) this; + } + public Criteria andProductIdIsNull() { addCriterion("product_id is null"); return (Criteria) this;