浏览代码

直播间领取优惠券数量

yuhongqi 1 周之前
父节点
当前提交
c23cf54a28

+ 4 - 0
fs-service-system/src/main/java/com/fs/live/domain/LiveCouponIssueUser.java

@@ -36,4 +36,8 @@ public class LiveCouponIssueUser extends BaseEntity
     @Excel(name = "商品ID")
     private Long goodsId;
 
+    /** $column.columnComment */
+    @Excel(name = "直播间ID")
+    private Long liveId;
+
 }

+ 0 - 2
fs-service-system/src/main/java/com/fs/live/mapper/LiveCouponIssueUserMapper.java

@@ -70,8 +70,6 @@ public interface LiveCouponIssueUserMapper
      * 统计直播间优惠券领取数量
      */
     @Select("select count(1) from live_coupon_issue_user lciu " +
-            "left join live_coupon_issue lci on lci.id = lciu.issue_id " +
-            "left join live_coupon_issue_relation lcir on lcir.coupon_issue_id = lci.id " +
             "where lcir.live_id = #{liveId} and lciu.issue_id = #{couponIssueId} and lciu.is_del = 0")
     int countClaimedByLiveIdAndIssueId(@Param("liveId") Long liveId, @Param("couponIssueId") Long couponIssueId);
 }

+ 1 - 1
fs-service-system/src/main/java/com/fs/live/mapper/LiveLotteryConfMapper.java

@@ -98,6 +98,6 @@ public interface LiveLotteryConfMapper {
 
     void finishStatusByLotteryIds(@Param("ids")  List<Long> ids);
 
-    @Select("SELECT * FROM live_lottery_conf WHERE live_id = #{liveId} AND lottery_status = 0 ")
+    @Select("SELECT * FROM live_lottery_conf WHERE live_id = #{liveId}")
     List<LiveLotteryConf> selectLiveLotteryConfListOn(LiveLotteryConf liveLotteryConf);
 }

+ 1 - 1
fs-service-system/src/main/java/com/fs/live/mapper/LiveRedConfMapper.java

@@ -94,6 +94,6 @@ public interface LiveRedConfMapper {
 
     void finishRedStatusBySetIds(@Param("ids") Set<String> ids);
 
-    @Select("SELECT * FROM live_red_conf WHERE red_status = 0 and live_id=#{liveId}")
+    @Select("SELECT * FROM live_red_conf WHERE live_id=#{liveId}")
     List<LiveRedConf> selectLiveRedConfListOn(LiveRedConf liveRedConf);
 }

+ 1 - 0
fs-service-system/src/main/java/com/fs/live/service/impl/LiveCouponServiceImpl.java

@@ -253,6 +253,7 @@ public class LiveCouponServiceImpl implements ILiveCouponService
         record.setUpdateTime(now);
         record.setIsDel(0);
         record.setGoodsId(coupon.getGoodsId());
+        record.setLiveId(coupon.getLiveId());
 
 
         LiveCouponUser userRecord = new LiveCouponUser();

+ 6 - 1
fs-service-system/src/main/resources/mapper/live/LiveCouponIssueUserMapper.xml

@@ -12,10 +12,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime"    column="update_time"    />
         <result property="isDel"    column="is_del"    />
         <result property="goodsId"    column="goods_id"    />
+        <result property="liveId"    column="live_id"    />
     </resultMap>
 
     <sql id="selectLiveCouponIssueUserVo">
-        select id, user_id, issue_id, create_time, update_time, is_del,goods_id from live_coupon_issue_user
+        select id, user_id, issue_id, create_time, update_time, is_del,goods_id,live_id from live_coupon_issue_user
     </sql>
 
     <select id="selectLiveCouponIssueUserList" parameterType="LiveCouponIssueUser" resultMap="LiveCouponIssueUserResult">
@@ -25,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="issueId != null "> and issue_id = #{issueId}</if>
             <if test="isDel != null "> and is_del = #{isDel}</if>
             <if test="goodsId != null "> and goods_id = #{goodsId}</if>
+            <if test="liveId != null "> and live_id = #{liveId}</if>
         </where>
     </select>
 
@@ -42,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time,</if>
             <if test="isDel != null">is_del,</if>
             <if test="goodsId != null">goods_id,</if>
+            <if test="liveId != null">live_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -50,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">#{updateTime},</if>
             <if test="isDel != null">#{isDel},</if>
             <if test="goodsId != null">#{goodsId},</if>
+            <if test="liveId != null">#{liveId},</if>
          </trim>
     </insert>
 
@@ -62,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
             <if test="goodsId != null">goods_id = #{goodsId},</if>
+            <if test="liveId != null">live_id = #{liveId},</if>
         </trim>
         where id = #{id}
     </update>