From 8310ec1af542273f2a957f5938289a87e96bcc34 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Thu, 9 Jun 2022 10:33:33 +0800 Subject: [PATCH] 1 --- .../com/hai/dao/ApiProductConfigMapper.java | 25 ++++---- .../hai/dao/ApiProductConfigSqlProvider.java | 14 +++++ .../java/com/hai/entity/ApiProductConfig.java | 16 +++++ .../hai/entity/ApiProductConfigExample.java | 60 +++++++++++++++++++ 4 files changed, 105 insertions(+), 10 deletions(-) diff --git a/hai-service/src/main/java/com/hai/dao/ApiProductConfigMapper.java b/hai-service/src/main/java/com/hai/dao/ApiProductConfigMapper.java index 41f3006a..23ec4cca 100644 --- a/hai-service/src/main/java/com/hai/dao/ApiProductConfigMapper.java +++ b/hai-service/src/main/java/com/hai/dao/ApiProductConfigMapper.java @@ -40,15 +40,17 @@ public interface ApiProductConfigMapper extends ApiProductConfigMapperExt { @Insert({ "insert into api_product_config (product_id, merchants_id, ", - "discount, operator_id, ", - "operator_name, create_time, ", - "update_time, `status`, ", - "ext_1, ext_2, ext_3)", + "discount, discount_price, ", + "operator_id, operator_name, ", + "create_time, update_time, ", + "`status`, ext_1, ext_2, ", + "ext_3)", "values (#{productId,jdbcType=BIGINT}, #{merchantsId,jdbcType=BIGINT}, ", - "#{discount,jdbcType=DECIMAL}, #{operatorId,jdbcType=BIGINT}, ", - "#{operatorName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{discount,jdbcType=DECIMAL}, #{discountPrice,jdbcType=DECIMAL}, ", + "#{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(ApiProductConfig record); @@ -63,6 +65,7 @@ public interface ApiProductConfigMapper extends ApiProductConfigMapperExt { @Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT), @Result(column="merchants_id", property="merchantsId", jdbcType=JdbcType.BIGINT), @Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL), + @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @@ -76,8 +79,8 @@ public interface ApiProductConfigMapper extends ApiProductConfigMapperExt { @Select({ "select", - "id, product_id, merchants_id, discount, operator_id, operator_name, create_time, ", - "update_time, `status`, ext_1, ext_2, ext_3", + "id, product_id, merchants_id, discount, discount_price, operator_id, operator_name, ", + "create_time, update_time, `status`, ext_1, ext_2, ext_3", "from api_product_config", "where id = #{id,jdbcType=BIGINT}" }) @@ -86,6 +89,7 @@ public interface ApiProductConfigMapper extends ApiProductConfigMapperExt { @Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT), @Result(column="merchants_id", property="merchantsId", jdbcType=JdbcType.BIGINT), @Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL), + @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @@ -111,6 +115,7 @@ public interface ApiProductConfigMapper extends ApiProductConfigMapperExt { "set product_id = #{productId,jdbcType=BIGINT},", "merchants_id = #{merchantsId,jdbcType=BIGINT},", "discount = #{discount,jdbcType=DECIMAL},", + "discount_price = #{discountPrice,jdbcType=DECIMAL},", "operator_id = #{operatorId,jdbcType=BIGINT},", "operator_name = #{operatorName,jdbcType=VARCHAR},", "create_time = #{createTime,jdbcType=TIMESTAMP},", diff --git a/hai-service/src/main/java/com/hai/dao/ApiProductConfigSqlProvider.java b/hai-service/src/main/java/com/hai/dao/ApiProductConfigSqlProvider.java index 32742d50..40a2b0fc 100644 --- a/hai-service/src/main/java/com/hai/dao/ApiProductConfigSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/ApiProductConfigSqlProvider.java @@ -40,6 +40,10 @@ public class ApiProductConfigSqlProvider { sql.VALUES("discount", "#{discount,jdbcType=DECIMAL}"); } + if (record.getDiscountPrice() != null) { + sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}"); + } + if (record.getOperatorId() != null) { sql.VALUES("operator_id", "#{operatorId,jdbcType=BIGINT}"); } @@ -85,6 +89,7 @@ public class ApiProductConfigSqlProvider { sql.SELECT("product_id"); sql.SELECT("merchants_id"); sql.SELECT("discount"); + sql.SELECT("discount_price"); sql.SELECT("operator_id"); sql.SELECT("operator_name"); sql.SELECT("create_time"); @@ -126,6 +131,10 @@ public class ApiProductConfigSqlProvider { sql.SET("discount = #{record.discount,jdbcType=DECIMAL}"); } + if (record.getDiscountPrice() != null) { + sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); + } + if (record.getOperatorId() != null) { sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); } @@ -170,6 +179,7 @@ public class ApiProductConfigSqlProvider { sql.SET("product_id = #{record.productId,jdbcType=BIGINT}"); sql.SET("merchants_id = #{record.merchantsId,jdbcType=BIGINT}"); sql.SET("discount = #{record.discount,jdbcType=DECIMAL}"); + sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); sql.SET("operator_id = #{record.operatorId,jdbcType=BIGINT}"); sql.SET("operator_name = #{record.operatorName,jdbcType=VARCHAR}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); @@ -200,6 +210,10 @@ public class ApiProductConfigSqlProvider { sql.SET("discount = #{discount,jdbcType=DECIMAL}"); } + if (record.getDiscountPrice() != null) { + sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}"); + } + if (record.getOperatorId() != null) { sql.SET("operator_id = #{operatorId,jdbcType=BIGINT}"); } diff --git a/hai-service/src/main/java/com/hai/entity/ApiProductConfig.java b/hai-service/src/main/java/com/hai/entity/ApiProductConfig.java index 7be2e261..a755859c 100644 --- a/hai-service/src/main/java/com/hai/entity/ApiProductConfig.java +++ b/hai-service/src/main/java/com/hai/entity/ApiProductConfig.java @@ -34,6 +34,11 @@ public class ApiProductConfig implements Serializable { */ private BigDecimal discount; + /** + * 折扣价格 + */ + private BigDecimal discountPrice; + /** * 操作人员id */ @@ -108,6 +113,14 @@ public class ApiProductConfig implements Serializable { this.discount = discount; } + public BigDecimal getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(BigDecimal discountPrice) { + this.discountPrice = discountPrice; + } + public Long getOperatorId() { return operatorId; } @@ -188,6 +201,7 @@ public class ApiProductConfig implements Serializable { && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId())) && (this.getMerchantsId() == null ? other.getMerchantsId() == null : this.getMerchantsId().equals(other.getMerchantsId())) && (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount())) + && (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice())) && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId())) && (this.getOperatorName() == null ? other.getOperatorName() == null : this.getOperatorName().equals(other.getOperatorName())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) @@ -206,6 +220,7 @@ public class ApiProductConfig implements Serializable { result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode()); result = prime * result + ((getMerchantsId() == null) ? 0 : getMerchantsId().hashCode()); result = prime * result + ((getDiscount() == null) ? 0 : getDiscount().hashCode()); + result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode()); result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode()); result = prime * result + ((getOperatorName() == null) ? 0 : getOperatorName().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); @@ -227,6 +242,7 @@ public class ApiProductConfig implements Serializable { sb.append(", productId=").append(productId); sb.append(", merchantsId=").append(merchantsId); sb.append(", discount=").append(discount); + sb.append(", discountPrice=").append(discountPrice); sb.append(", operatorId=").append(operatorId); sb.append(", operatorName=").append(operatorName); sb.append(", createTime=").append(createTime); diff --git a/hai-service/src/main/java/com/hai/entity/ApiProductConfigExample.java b/hai-service/src/main/java/com/hai/entity/ApiProductConfigExample.java index dbecda14..d7c222cb 100644 --- a/hai-service/src/main/java/com/hai/entity/ApiProductConfigExample.java +++ b/hai-service/src/main/java/com/hai/entity/ApiProductConfigExample.java @@ -366,6 +366,66 @@ public class ApiProductConfigExample { return (Criteria) this; } + public Criteria andDiscountPriceIsNull() { + addCriterion("discount_price is null"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIsNotNull() { + addCriterion("discount_price is not null"); + return (Criteria) this; + } + + public Criteria andDiscountPriceEqualTo(BigDecimal value) { + addCriterion("discount_price =", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotEqualTo(BigDecimal value) { + addCriterion("discount_price <>", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceGreaterThan(BigDecimal value) { + addCriterion("discount_price >", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_price >=", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceLessThan(BigDecimal value) { + addCriterion("discount_price <", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_price <=", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIn(List values) { + addCriterion("discount_price in", values, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotIn(List values) { + addCriterion("discount_price not in", values, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_price between", value1, value2, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_price not between", value1, value2, "discountPrice"); + return (Criteria) this; + } + public Criteria andOperatorIdIsNull() { addCriterion("operator_id is null"); return (Criteria) this;