From 198b89db40bd0142a6cd059b8588568363084ada Mon Sep 17 00:00:00 2001 From: YuanYe <418471657@qq.com> Date: Wed, 17 Jul 2024 14:43:18 +0800 Subject: [PATCH] 1 --- .../com/hfkj/dao/CouponDiscountMapper.java | 35 ++++++----- .../hfkj/dao/CouponDiscountSqlProvider.java | 14 +++++ .../java/com/hfkj/entity/CouponDiscount.java | 16 +++++ .../hfkj/entity/CouponDiscountExample.java | 60 +++++++++++++++++++ 4 files changed, 110 insertions(+), 15 deletions(-) diff --git a/service/src/main/java/com/hfkj/dao/CouponDiscountMapper.java b/service/src/main/java/com/hfkj/dao/CouponDiscountMapper.java index b6800a3..77fadcd 100644 --- a/service/src/main/java/com/hfkj/dao/CouponDiscountMapper.java +++ b/service/src/main/java/com/hfkj/dao/CouponDiscountMapper.java @@ -40,20 +40,22 @@ public interface CouponDiscountMapper extends CouponDiscountMapperExt { @Insert({ "insert into coupon_discount (`name`, img, ", - "`type`, `condition`, ", - "price, percentage, ", - "limit_num, effective_day, ", - "effective_num, sales_end_time, ", - "create_time, update_time, ", - "op_id, op_name, `status`, ", + "`type`, platform, ", + "`condition`, price, ", + "percentage, limit_num, ", + "effective_day, effective_num, ", + "sales_end_time, create_time, ", + "update_time, op_id, ", + "op_name, `status`, ", "ext_1, ext_2, ext_3)", "values (#{name,jdbcType=VARCHAR}, #{img,jdbcType=VARCHAR}, ", - "#{type,jdbcType=INTEGER}, #{condition,jdbcType=DECIMAL}, ", - "#{price,jdbcType=DECIMAL}, #{percentage,jdbcType=DECIMAL}, ", - "#{limitNum,jdbcType=INTEGER}, #{effectiveDay,jdbcType=INTEGER}, ", - "#{effectiveNum,jdbcType=INTEGER}, #{salesEndTime,jdbcType=TIMESTAMP}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{type,jdbcType=INTEGER}, #{platform,jdbcType=INTEGER}, ", + "#{condition,jdbcType=DECIMAL}, #{price,jdbcType=DECIMAL}, ", + "#{percentage,jdbcType=DECIMAL}, #{limitNum,jdbcType=INTEGER}, ", + "#{effectiveDay,jdbcType=INTEGER}, #{effectiveNum,jdbcType=INTEGER}, ", + "#{salesEndTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{opId,jdbcType=BIGINT}, ", + "#{opName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") @@ -69,6 +71,7 @@ public interface CouponDiscountMapper extends CouponDiscountMapperExt { @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="platform", property="platform", jdbcType=JdbcType.INTEGER), @Result(column="condition", property="condition", jdbcType=JdbcType.DECIMAL), @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), @Result(column="percentage", property="percentage", jdbcType=JdbcType.DECIMAL), @@ -89,9 +92,9 @@ public interface CouponDiscountMapper extends CouponDiscountMapperExt { @Select({ "select", - "id, `name`, img, `type`, `condition`, price, percentage, limit_num, effective_day, ", - "effective_num, sales_end_time, create_time, update_time, op_id, op_name, `status`, ", - "ext_1, ext_2, ext_3", + "id, `name`, img, `type`, platform, `condition`, price, percentage, limit_num, ", + "effective_day, effective_num, sales_end_time, create_time, update_time, op_id, ", + "op_name, `status`, ext_1, ext_2, ext_3", "from coupon_discount", "where id = #{id,jdbcType=BIGINT}" }) @@ -100,6 +103,7 @@ public interface CouponDiscountMapper extends CouponDiscountMapperExt { @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="platform", property="platform", jdbcType=JdbcType.INTEGER), @Result(column="condition", property="condition", jdbcType=JdbcType.DECIMAL), @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), @Result(column="percentage", property="percentage", jdbcType=JdbcType.DECIMAL), @@ -132,6 +136,7 @@ public interface CouponDiscountMapper extends CouponDiscountMapperExt { "set `name` = #{name,jdbcType=VARCHAR},", "img = #{img,jdbcType=VARCHAR},", "`type` = #{type,jdbcType=INTEGER},", + "platform = #{platform,jdbcType=INTEGER},", "`condition` = #{condition,jdbcType=DECIMAL},", "price = #{price,jdbcType=DECIMAL},", "percentage = #{percentage,jdbcType=DECIMAL},", diff --git a/service/src/main/java/com/hfkj/dao/CouponDiscountSqlProvider.java b/service/src/main/java/com/hfkj/dao/CouponDiscountSqlProvider.java index 6568e1b..9097b6a 100644 --- a/service/src/main/java/com/hfkj/dao/CouponDiscountSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/CouponDiscountSqlProvider.java @@ -40,6 +40,10 @@ public class CouponDiscountSqlProvider { sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); } + if (record.getPlatform() != null) { + sql.VALUES("platform", "#{platform,jdbcType=INTEGER}"); + } + if (record.getCondition() != null) { sql.VALUES("`condition`", "#{condition,jdbcType=DECIMAL}"); } @@ -113,6 +117,7 @@ public class CouponDiscountSqlProvider { sql.SELECT("`name`"); sql.SELECT("img"); sql.SELECT("`type`"); + sql.SELECT("platform"); sql.SELECT("`condition`"); sql.SELECT("price"); sql.SELECT("percentage"); @@ -161,6 +166,10 @@ public class CouponDiscountSqlProvider { sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); } + if (record.getPlatform() != null) { + sql.SET("platform = #{record.platform,jdbcType=INTEGER}"); + } + if (record.getCondition() != null) { sql.SET("`condition` = #{record.condition,jdbcType=DECIMAL}"); } @@ -233,6 +242,7 @@ public class CouponDiscountSqlProvider { sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); sql.SET("img = #{record.img,jdbcType=VARCHAR}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("platform = #{record.platform,jdbcType=INTEGER}"); sql.SET("`condition` = #{record.condition,jdbcType=DECIMAL}"); sql.SET("price = #{record.price,jdbcType=DECIMAL}"); sql.SET("percentage = #{record.percentage,jdbcType=DECIMAL}"); @@ -270,6 +280,10 @@ public class CouponDiscountSqlProvider { sql.SET("`type` = #{type,jdbcType=INTEGER}"); } + if (record.getPlatform() != null) { + sql.SET("platform = #{platform,jdbcType=INTEGER}"); + } + if (record.getCondition() != null) { sql.SET("`condition` = #{condition,jdbcType=DECIMAL}"); } diff --git a/service/src/main/java/com/hfkj/entity/CouponDiscount.java b/service/src/main/java/com/hfkj/entity/CouponDiscount.java index b3de17f..8e5305b 100644 --- a/service/src/main/java/com/hfkj/entity/CouponDiscount.java +++ b/service/src/main/java/com/hfkj/entity/CouponDiscount.java @@ -34,6 +34,11 @@ public class CouponDiscount implements Serializable { */ private Integer type; + /** + * 1:普惠GO 2:v家园 3:省直机关 + */ + private Integer platform; + /** * 优惠券条件(满减价格) */ @@ -134,6 +139,14 @@ public class CouponDiscount implements Serializable { this.type = type; } + public Integer getPlatform() { + return platform; + } + + public void setPlatform(Integer platform) { + this.platform = platform; + } + public BigDecimal getCondition() { return condition; } @@ -270,6 +283,7 @@ public class CouponDiscount implements Serializable { && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getPlatform() == null ? other.getPlatform() == null : this.getPlatform().equals(other.getPlatform())) && (this.getCondition() == null ? other.getCondition() == null : this.getCondition().equals(other.getCondition())) && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) && (this.getPercentage() == null ? other.getPercentage() == null : this.getPercentage().equals(other.getPercentage())) @@ -295,6 +309,7 @@ public class CouponDiscount implements Serializable { result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); result = prime * result + ((getCondition() == null) ? 0 : getCondition().hashCode()); result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); result = prime * result + ((getPercentage() == null) ? 0 : getPercentage().hashCode()); @@ -323,6 +338,7 @@ public class CouponDiscount implements Serializable { sb.append(", name=").append(name); sb.append(", img=").append(img); sb.append(", type=").append(type); + sb.append(", platform=").append(platform); sb.append(", condition=").append(condition); sb.append(", price=").append(price); sb.append(", percentage=").append(percentage); diff --git a/service/src/main/java/com/hfkj/entity/CouponDiscountExample.java b/service/src/main/java/com/hfkj/entity/CouponDiscountExample.java index f30c4b8..a99b2f1 100644 --- a/service/src/main/java/com/hfkj/entity/CouponDiscountExample.java +++ b/service/src/main/java/com/hfkj/entity/CouponDiscountExample.java @@ -386,6 +386,66 @@ public class CouponDiscountExample { return (Criteria) this; } + public Criteria andPlatformIsNull() { + addCriterion("platform is null"); + return (Criteria) this; + } + + public Criteria andPlatformIsNotNull() { + addCriterion("platform is not null"); + return (Criteria) this; + } + + public Criteria andPlatformEqualTo(Integer value) { + addCriterion("platform =", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformNotEqualTo(Integer value) { + addCriterion("platform <>", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformGreaterThan(Integer value) { + addCriterion("platform >", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformGreaterThanOrEqualTo(Integer value) { + addCriterion("platform >=", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformLessThan(Integer value) { + addCriterion("platform <", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformLessThanOrEqualTo(Integer value) { + addCriterion("platform <=", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformIn(List values) { + addCriterion("platform in", values, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformNotIn(List values) { + addCriterion("platform not in", values, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformBetween(Integer value1, Integer value2) { + addCriterion("platform between", value1, value2, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformNotBetween(Integer value1, Integer value2) { + addCriterion("platform not between", value1, value2, "platform"); + return (Criteria) this; + } + public Criteria andConditionIsNull() { addCriterion("`condition` is null"); return (Criteria) this;