From 874cb4fbc47ba521f8bd5ecd1c6bb54a02d49b33 Mon Sep 17 00:00:00 2001 From: YuanYe <418471657@qq.com> Date: Fri, 27 Sep 2024 17:40:41 +0800 Subject: [PATCH] 1 --- .../com/hfkj/dao/GoodsShoppingCartMapper.java | 33 +++++----- .../dao/GoodsShoppingCartSqlProvider.java | 14 +++++ .../com/hfkj/entity/GoodsShoppingCart.java | 16 +++++ .../hfkj/entity/GoodsShoppingCartExample.java | 60 +++++++++++++++++++ 4 files changed, 108 insertions(+), 15 deletions(-) diff --git a/service/src/main/java/com/hfkj/dao/GoodsShoppingCartMapper.java b/service/src/main/java/com/hfkj/dao/GoodsShoppingCartMapper.java index 93fa7f8..22af4fe 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsShoppingCartMapper.java +++ b/service/src/main/java/com/hfkj/dao/GoodsShoppingCartMapper.java @@ -40,20 +40,20 @@ public interface GoodsShoppingCartMapper extends GoodsShoppingCartMapperExt { @Insert({ "insert into goods_shopping_cart (goods_id, goods_type, ", - "user_id, title, img, ", - "specs_name, specs_id, ", - "num, price, whether_check, ", - "lose_efficacy, create_time, ", - "update_time, mer_id, ", - "mer_name, `status`, ", + "`source`, user_id, title, ", + "img, specs_name, ", + "specs_id, num, price, ", + "whether_check, lose_efficacy, ", + "create_time, update_time, ", + "mer_id, mer_name, `status`, ", "ext_1, ext_2, ext_3)", "values (#{goodsId,jdbcType=BIGINT}, #{goodsType,jdbcType=INTEGER}, ", - "#{userId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, #{img,jdbcType=VARCHAR}, ", - "#{specsName,jdbcType=VARCHAR}, #{specsId,jdbcType=BIGINT}, ", - "#{num,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{whetherCheck,jdbcType=BIT}, ", - "#{loseEfficacy,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{merId,jdbcType=BIGINT}, ", - "#{merName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{source,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, ", + "#{img,jdbcType=VARCHAR}, #{specsName,jdbcType=VARCHAR}, ", + "#{specsId,jdbcType=BIGINT}, #{num,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, ", + "#{whetherCheck,jdbcType=BIT}, #{loseEfficacy,jdbcType=BIT}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") @@ -68,6 +68,7 @@ public interface GoodsShoppingCartMapper extends GoodsShoppingCartMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.INTEGER), + @Result(column="source", property="source", jdbcType=JdbcType.INTEGER), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR), @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), @@ -90,9 +91,9 @@ public interface GoodsShoppingCartMapper extends GoodsShoppingCartMapperExt { @Select({ "select", - "id, goods_id, goods_type, user_id, title, img, specs_name, specs_id, num, price, ", - "whether_check, lose_efficacy, create_time, update_time, mer_id, mer_name, `status`, ", - "ext_1, ext_2, ext_3", + "id, goods_id, goods_type, `source`, user_id, title, img, specs_name, specs_id, ", + "num, price, whether_check, lose_efficacy, create_time, update_time, mer_id, ", + "mer_name, `status`, ext_1, ext_2, ext_3", "from goods_shopping_cart", "where id = #{id,jdbcType=BIGINT}" }) @@ -100,6 +101,7 @@ public interface GoodsShoppingCartMapper extends GoodsShoppingCartMapperExt { @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), @Result(column="goods_type", property="goodsType", jdbcType=JdbcType.INTEGER), + @Result(column="source", property="source", jdbcType=JdbcType.INTEGER), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR), @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR), @@ -133,6 +135,7 @@ public interface GoodsShoppingCartMapper extends GoodsShoppingCartMapperExt { "update goods_shopping_cart", "set goods_id = #{goodsId,jdbcType=BIGINT},", "goods_type = #{goodsType,jdbcType=INTEGER},", + "`source` = #{source,jdbcType=INTEGER},", "user_id = #{userId,jdbcType=BIGINT},", "title = #{title,jdbcType=VARCHAR},", "img = #{img,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/GoodsShoppingCartSqlProvider.java b/service/src/main/java/com/hfkj/dao/GoodsShoppingCartSqlProvider.java index 4fb833d..e8569a1 100644 --- a/service/src/main/java/com/hfkj/dao/GoodsShoppingCartSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/GoodsShoppingCartSqlProvider.java @@ -36,6 +36,10 @@ public class GoodsShoppingCartSqlProvider { sql.VALUES("goods_type", "#{goodsType,jdbcType=INTEGER}"); } + if (record.getSource() != null) { + sql.VALUES("`source`", "#{source,jdbcType=INTEGER}"); + } + if (record.getUserId() != null) { sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); } @@ -116,6 +120,7 @@ public class GoodsShoppingCartSqlProvider { } sql.SELECT("goods_id"); sql.SELECT("goods_type"); + sql.SELECT("`source`"); sql.SELECT("user_id"); sql.SELECT("title"); sql.SELECT("img"); @@ -162,6 +167,10 @@ public class GoodsShoppingCartSqlProvider { sql.SET("goods_type = #{record.goodsType,jdbcType=INTEGER}"); } + if (record.getSource() != null) { + sql.SET("`source` = #{record.source,jdbcType=INTEGER}"); + } + if (record.getUserId() != null) { sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); } @@ -241,6 +250,7 @@ public class GoodsShoppingCartSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}"); sql.SET("goods_type = #{record.goodsType,jdbcType=INTEGER}"); + sql.SET("`source` = #{record.source,jdbcType=INTEGER}"); sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); sql.SET("title = #{record.title,jdbcType=VARCHAR}"); sql.SET("img = #{record.img,jdbcType=VARCHAR}"); @@ -276,6 +286,10 @@ public class GoodsShoppingCartSqlProvider { sql.SET("goods_type = #{goodsType,jdbcType=INTEGER}"); } + if (record.getSource() != null) { + sql.SET("`source` = #{source,jdbcType=INTEGER}"); + } + if (record.getUserId() != null) { sql.SET("user_id = #{userId,jdbcType=BIGINT}"); } diff --git a/service/src/main/java/com/hfkj/entity/GoodsShoppingCart.java b/service/src/main/java/com/hfkj/entity/GoodsShoppingCart.java index 0cf49c9..0b74669 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsShoppingCart.java +++ b/service/src/main/java/com/hfkj/entity/GoodsShoppingCart.java @@ -29,6 +29,11 @@ public class GoodsShoppingCart implements Serializable { */ private Integer goodsType; + /** + * 产品来源:1.内部虚拟商品 2: 娱尚会员充值 4.贵州中石化 5.重庆中石油 6.比邻星停车券 7.四川中石油 10.中油优途中石油 + */ + private Integer source; + /** * 用户编号 */ @@ -140,6 +145,14 @@ public class GoodsShoppingCart implements Serializable { this.goodsType = goodsType; } + public Integer getSource() { + return source; + } + + public void setSource(Integer source) { + this.source = source; + } + public Long getUserId() { return userId; } @@ -291,6 +304,7 @@ public class GoodsShoppingCart implements Serializable { return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId())) && (this.getGoodsType() == null ? other.getGoodsType() == null : this.getGoodsType().equals(other.getGoodsType())) + && (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource())) && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle())) && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg())) @@ -317,6 +331,7 @@ public class GoodsShoppingCart implements Serializable { result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode()); result = prime * result + ((getGoodsType() == null) ? 0 : getGoodsType().hashCode()); + result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode()); result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode()); result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode()); @@ -346,6 +361,7 @@ public class GoodsShoppingCart implements Serializable { sb.append(", id=").append(id); sb.append(", goodsId=").append(goodsId); sb.append(", goodsType=").append(goodsType); + sb.append(", source=").append(source); sb.append(", userId=").append(userId); sb.append(", title=").append(title); sb.append(", img=").append(img); diff --git a/service/src/main/java/com/hfkj/entity/GoodsShoppingCartExample.java b/service/src/main/java/com/hfkj/entity/GoodsShoppingCartExample.java index cb0fc61..f02defd 100644 --- a/service/src/main/java/com/hfkj/entity/GoodsShoppingCartExample.java +++ b/service/src/main/java/com/hfkj/entity/GoodsShoppingCartExample.java @@ -306,6 +306,66 @@ public class GoodsShoppingCartExample { return (Criteria) this; } + public Criteria andSourceIsNull() { + addCriterion("`source` is null"); + return (Criteria) this; + } + + public Criteria andSourceIsNotNull() { + addCriterion("`source` is not null"); + return (Criteria) this; + } + + public Criteria andSourceEqualTo(Integer value) { + addCriterion("`source` =", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotEqualTo(Integer value) { + addCriterion("`source` <>", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThan(Integer value) { + addCriterion("`source` >", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThanOrEqualTo(Integer value) { + addCriterion("`source` >=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThan(Integer value) { + addCriterion("`source` <", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThanOrEqualTo(Integer value) { + addCriterion("`source` <=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceIn(List values) { + addCriterion("`source` in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotIn(List values) { + addCriterion("`source` not in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceBetween(Integer value1, Integer value2) { + addCriterion("`source` between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotBetween(Integer value1, Integer value2) { + addCriterion("`source` not between", value1, value2, "source"); + return (Criteria) this; + } + public Criteria andUserIdIsNull() { addCriterion("user_id is null"); return (Criteria) this;