修改优惠“卷”为优惠“券”,用户信息返回积分总数和可用优惠券数量

This commit is contained in:
谭凯凯
2024-11-13 17:08:49 +08:00
committed by Tankaikai
parent 99e9aae70a
commit 9a7a358f70
23 changed files with 107 additions and 52 deletions

View File

@@ -101,7 +101,7 @@ id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, nu
order by inRecord.use_end_time asc
</select>
<!--查询剩余商品优惠数量-->
<!--查询剩余商品优惠数量-->
<select id="countCouponNum" resultType="INTEGER">
SELECT
ifnull(sum(over_num), 0)
@@ -110,6 +110,15 @@ id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, nu
INNER JOIN tb_shop_user vip ON record.vip_user_id = vip.id AND vip.user_id = #{userId}
</select>
<!--查询剩余商品优惠券数量-->
<select id="countCouponNumByShopId" resultType="INTEGER">
SELECT
ifnull(sum(over_num), 0)
FROM
tb_activate_in_record record
INNER JOIN tb_shop_user vip ON record.vip_user_id = vip.id AND vip.user_id = #{userId} AND vip.shop_id = #{shopId}
</select>
<!--查询指定行数据-->
<select id="queryAll" resultMap="TbActivateInRecordMap">
select

View File

@@ -32,12 +32,15 @@
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
<result column="mini_open_id" jdbcType="VARCHAR" property="miniOpenId" />
<result column="join_time" jdbcType="VARCHAR" property="joinTime" />
<result column="account_points" jdbcType="INTEGER" property="accountPoints" />
<result column="last_points_change_time" jdbcType="DATE" property="lastPointsChangeTime" />
<result column="last_float_points" jdbcType="INTEGER" property="lastFloatPoints" />
</resultMap>
<sql id="Base_Column_List">
id, amount, credit_amount, consume_amount, consume_number, level_consume, status,
merchant_id, shop_id, user_id, parent_id, parent_level, name, head_img, sex, birth_day,
telephone, is_vip, code, is_attention, attention_at, is_shareholder, level, distribute_type,
sort, created_at, updated_at, mini_open_id,dynamic_code,join_time
sort, created_at, updated_at, mini_open_id,dynamic_code,join_time,account_points,last_points_change_time,last_float_points
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
@@ -75,7 +78,9 @@
code, is_attention, attention_at,
is_shareholder, level, distribute_type,
sort, created_at, updated_at,
mini_open_id,join_time)
mini_open_id,join_time,
account_points,last_points_change_time,last_float_points
)
values (#{id,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{creditAmount,jdbcType=DECIMAL},
#{consumeAmount,jdbcType=DECIMAL}, #{consumeNumber,jdbcType=INTEGER}, #{levelConsume,jdbcType=DECIMAL},
#{status,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},
@@ -85,7 +90,11 @@
#{code,jdbcType=VARCHAR}, #{isAttention,jdbcType=TINYINT}, #{attentionAt,jdbcType=INTEGER},
#{isShareholder,jdbcType=TINYINT}, #{level,jdbcType=TINYINT}, #{distributeType,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT},
#{miniOpenId,jdbcType=VARCHAR},#{joinTime,jdbcType=TIMESTAMP})
#{miniOpenId,jdbcType=VARCHAR},#{joinTime,jdbcType=TIMESTAMP},
#{accountPoints,jdbcType=INTEGER},
#{lastPointsChangeTime,jdbcType=TIMESTAMP},
#{lastFloatPoints,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
insert into tb_shop_user
@@ -177,6 +186,15 @@
<if test="joinTime != null">
join_time,
</if>
<if test="accountPoints != null">
account_points,
</if>
<if test="lastPointsChangeTime != null">
last_points_change_time,
</if>
<if test="lastFloatPoints != null">
last_float_points,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -266,6 +284,15 @@
<if test="joinTime != null">
#{joinTime,jdbcType=TIMESTAMP},
</if>
<if test="accountPoints != null">
#{accountPoints,jdbcType=INTEGER},
</if>
<if test="lastPointsChangeTime != null">
#{lastPointsChangeTime,jdbcType=TIMESTAMP},
</if>
<if test="lastFloatPoints != null">
#{lastFloatPoints,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
@@ -364,6 +391,15 @@
<if test="joinTime != null">
join_time = #{joinTime,jdbcType=TIMESTAMP},
</if>
<if test="accountPoints != null">
account_points = #{accountPoints,jdbcType=INTEGER},
</if>
<if test="lastPointsChangeTime != null">
last_points_change_time = #{lastPointsChangeTime,jdbcType=TIMESTAMP},
</if>
<if test="lastFloatPoints != null">
last_float_points = #{lastFloatPoints,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@@ -395,8 +431,11 @@
sort = #{sort,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT},
join_time = #{joinTime,jdbcType=TIMESTAMP},
mini_open_id = #{miniOpenId,jdbcType=VARCHAR}
join_time = #{joinTime,jdbcType=TIMESTAMP},
mini_open_id = #{miniOpenId,jdbcType=VARCHAR},
account_points = #{accountPoints,jdbcType=INTEGER},
last_points_change_time = #{lastPointsChangeTime,jdbcType=TIMESTAMP},
last_float_points = #{lastFloatPoints,jdbcType=INTEGER}
where id = #{id,jdbcType=VARCHAR}
</update>