|
|
@@ -112,7 +112,7 @@
|
|
|
) 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,
|
|
|
+ SELECT c.order_number, 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 '下单'
|
|
|
@@ -122,6 +122,47 @@
|
|
|
END AS business_type
|
|
|
FROM `tz_points_record` a
|
|
|
LEFT JOIN tz_user b on a.user_id=b.user_id
|
|
|
+ LEFT JOIN tz_order c on a.order_number=c.order_number
|
|
|
+ <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 a.creation_date>= #{po.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="po.endTime != null and po.endTime != ''">
|
|
|
+ and a.creation_date<= #{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>
|
|
|
+ order by a.creation_date desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="backendPointsRecordList2" resultType="com.yami.shop.bean.vo.PointsRecordVo">
|
|
|
+ SELECT c.order_number, 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
|
|
|
+ LEFT JOIN tz_order c on a.order_number=c.order_number
|
|
|
<where>
|
|
|
<if test="po.mobile != null and po.mobile != ''">
|
|
|
AND b.user_mobile LIKE CONCAT("%",#{po.mobile},"%")
|