From e423d56d730db1baed24f3f7dbbc4141038776b6 Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Fri, 18 Jun 2021 22:12:03 +0800
Subject: [PATCH] 修复每日业绩bug和优化赠送业绩计算方式
---
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml | 141 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 141 insertions(+), 0 deletions(-)
diff --git a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml
index d0c549b..d15125a 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml
@@ -5,4 +5,145 @@
<mapper namespace="com.matrix.system.activity.dao.ActivitySignReceiveRecordDao">
+ <select id="findSignReceiveList" resultType="com.matrix.system.activity.vo.SignReceiveListVo">
+ SELECT
+ a.id id,
+ b.nick_name nickName,
+ a.receive_time reciveTime,
+ a.state,
+ c.cumulative_day cumulativeDay,
+ c.award_type awardType,
+ c.award_name awardName,
+ c.coupon_name couponName,
+ c.score_cnt scoreCnt,
+ d.act_type actType,
+ c.award_rule awardRule
+ FROM
+ activity_sign_receive_record a
+ LEFT JOIN sys_vip_info b ON a.user_id = b.id
+ LEFT JOIN activity_sign_award_set c ON a.award_id = c.id
+ LEFT JOIN shop_activities d ON a.award_id = d.id
+ <where>
+ a.company_id = #{record.companyId}
+ and a.activity_id = #{record.actId}
+ <if test="record.yhmc != null and record.yhmc != ''">
+ and b.nick_name like concat('%',#{record.yhmc},'%')
+ </if>
+ <if test="record.startTime != null ">
+ and a.receive_time >= #{record.startTime}
+ </if>
+ <if test="record.endTime != null">
+ and #{record.endTime} >= a.receive_time
+ </if>
+ </where>
+ <if test="record.sort !=null">
+ order by
+ a.${record.sort} ${record.order}
+ </if>
+ </select>
+
+ <select id="selectCouponList" resultType="com.matrix.system.activity.vo.CouponVo">
+ SELECT
+ a.id id,
+ a.c_name cName,
+ a.end_time endTime
+ FROM
+ shop_coupon a
+ <where>
+ a.company_id = #{record.companyId}
+ <if test="record.yhjmc != null and record.yhjmc != ''">
+ and a.c_name like concat('%',#{record.yhjmc},'%')
+ </if>
+ </where>
+ <if test="record.sort !=null">
+ order by
+ a.${record.sort} ${record.order}
+ </if>
+ </select>
+
+ <select id="selectGoodsList" resultType="com.matrix.system.activity.vo.GoodsVo">
+ SELECT
+ a.id id,
+ a.name name,
+ a.good_type goodType,
+ a.code code,
+ a.seal_pice sealPice
+ FROM
+ shopping_goods a
+ <where>
+ a.company_id = #{record.companyId}
+ <if test="record.cpmc != null and record.cpmc != ''">
+ and a.name like concat('%',#{record.cpmc},'%')
+ </if>
+ </where>
+ <if test="record.sort !=null">
+ order by
+ a.${record.sort} ${record.order}
+ </if>
+ </select>
+
+ <select id="getSignAwardReceiveCount" resultType="int">
+ SELECT
+ count(a.id)
+ FROM
+ activity_sign_receive_record a
+ LEFT JOIN activity_sign_award_set b ON a.award_id = b.id
+ where
+ b.award_type = 1
+ and a.company_id = #{companyId}
+ and a.user_id = #{userId}
+
+ </select>
+
+ <select id="selectSignAwardList" resultType="com.matrix.system.shopXcx.api.vo.SignAwardListVo">
+ SELECT
+ a.id id,
+ a.state state,
+ 1 total,
+ a.receive_time receiveTime,
+ b.award_way awardWay,
+ b.introduce_img introduceImg,
+ b.award_name awardName
+
+ FROM
+ activity_sign_receive_record a
+ LEFT JOIN activity_sign_award_set b ON a.award_id = b.id
+ WHERE
+ b.award_type = 1
+ and a.company_id = #{record.companyId}
+ and a.user_id = #{record.userId}
+ <if test="record.sort !=null">
+ order by
+ a.${record.sort} ${record.order}
+ </if>
+ </select>
+
+ <select id="selectSeeAwardTextVOById" resultType="com.matrix.system.shopXcx.api.vo.SeeAwardTextVo">
+ SELECT
+ a.id id,
+ a.state state,
+ a.consignee_phone consigneePhone,
+ a.consignee_address consigneeAddress,
+ a.consignee,
+ a.receive_time receiveTime,
+ a.write_off_code writeOffCode,
+ 1 total,
+ b.wechat_img wechatImg,
+ b.prize_address prizeAddress,
+ b.operation_tip operationTip,
+ b.prize_end_time prizeEndTime,
+ b.prize_start_time prizeStartTime,
+ b.award_way awardWay,
+ b.introduce_img introduceImg,
+ b.customer_phone customerPhone,
+ b.award_name awardName
+ FROM
+ activity_sign_receive_record a
+ LEFT JOIN activity_sign_award_set b ON a.award_id = b.id
+ WHERE
+ a.id = #{record.awardId}
+ and a.company_id = #{record.companyId}
+ and a.user_id = #{record.userId}
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1