|
|
@@ -111,5 +111,42 @@
|
|
|
points,variable_points, 4 as points_type,points_audit,expiry_date,expiry_date as creation_date,currently_available_points from tz_points_record where expiry_date =#{today} GROUP BY user_id ,channel_id
|
|
|
) a where a.points>0
|
|
|
</select>
|
|
|
+ <select id="backendPointsRecordList" resultType="com.yami.shop.bean.vo.PointsRecordVo">
|
|
|
+ SELECT a.`code`, b.real_name,b.user_mobile mobile ,IF(a.points_type in(1,3),CONCAT('+',a.variable_points),CONCAT('-',a.variable_points)) variable_points,a.currently_available_points,a.creation_date,
|
|
|
+ CASE
|
|
|
+ WHEN a.points_type = 1 THEN '充值'
|
|
|
+ WHEN a.points_type = 2 THEN '下单'
|
|
|
+ WHEN a.points_type = 3 THEN '退款'
|
|
|
+ WHEN a.points_type = 4 THEN '过期'
|
|
|
+ ELSE '其他'
|
|
|
+ END AS business_type
|
|
|
+ FROM `tz_points_record` a
|
|
|
+ LEFT JOIN tz_user b on a.user_id=b.user_id
|
|
|
+ <where>
|
|
|
+ <if test="po.mobile != null and po.mobile != ''">
|
|
|
+ AND b.user_mobile LIKE CONCAT("%",#{po.mobile},"%")
|
|
|
+ </if>
|
|
|
+ <if test="po.startTime != null and po.startTime != ''">
|
|
|
+ and ort.create_time>= #{po.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="po.endTime != null and po.endTime != ''">
|
|
|
+ and ort.create_time<= #{po.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="po.businessType != null and po.businessType != ''">
|
|
|
+ <if test="po.businessType == 'CZ'">
|
|
|
+ AND a.points_type = 1
|
|
|
+ </if>
|
|
|
+ <if test="po.businessType == 'XD'">
|
|
|
+ AND a.points_type = 2
|
|
|
+ </if>
|
|
|
+ <if test="po.businessType == 'TK'">
|
|
|
+ AND a.points_type = 3
|
|
|
+ </if>
|
|
|
+ <if test="po.businessType == 'GQ'">
|
|
|
+ AND a.points_type = 4
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|