|
@@ -536,17 +536,33 @@
|
|
|
LEFT JOIN (SELECT a.sku_id,SUM(a.product_count) product_count
|
|
LEFT JOIN (SELECT a.sku_id,SUM(a.product_count) product_count
|
|
|
FROM `tz_order_refund_sku` a
|
|
FROM `tz_order_refund_sku` a
|
|
|
LEFT JOIN tz_order_refund b on a.order_refund_id=b.refund_id
|
|
LEFT JOIN tz_order_refund b on a.order_refund_id=b.refund_id
|
|
|
|
|
+ LEFT JOIN tz_order c on b.order_number=c.order_number
|
|
|
|
|
+ LEFT JOIN tz_sku d on a.sku_id=d.sku_id
|
|
|
|
|
+ LEFT JOIN tz_user e on b.user_id=e.user_id
|
|
|
WHERE return_money_sts=70
|
|
WHERE return_money_sts=70
|
|
|
-
|
|
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and b.apply_time>= #{po.startTime}
|
|
and b.apply_time>= #{po.startTime}
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
and b.apply_time<= #{po.endTime}
|
|
and b.apply_time<= #{po.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ and c.channel_id in
|
|
|
|
|
+ <foreach collection="po.channelIds" item="id" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ <if test="po.skuId != null">
|
|
|
|
|
+ AND a.sku_id like concat('%',#{po.skuId} ,'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="po.skuName != null and po.skuName != ''">
|
|
|
|
|
+ AND d.sku_name like concat('%',#{po.skuName} ,'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="po.spec != null and po.spec != ''">
|
|
|
|
|
+ AND d.spec like concat('%',#{po.spec} ,'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
|
|
+ </if>
|
|
|
GROUP BY a.sku_id) d on a.sku_id = d.sku_id
|
|
GROUP BY a.sku_id) d on a.sku_id = d.sku_id
|
|
|
-
|
|
|
|
|
WHERE b.is_payed=1
|
|
WHERE b.is_payed=1
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and a.rec_time>= #{po.startTime}
|
|
and a.rec_time>= #{po.startTime}
|
|
@@ -588,22 +604,37 @@
|
|
|
LEFT JOIN (SELECT a.sku_id,SUM(a.product_count) product_count
|
|
LEFT JOIN (SELECT a.sku_id,SUM(a.product_count) product_count
|
|
|
FROM `tz_order_refund_sku` a
|
|
FROM `tz_order_refund_sku` a
|
|
|
LEFT JOIN tz_order_refund b on a.order_refund_id=b.refund_id
|
|
LEFT JOIN tz_order_refund b on a.order_refund_id=b.refund_id
|
|
|
|
|
+ LEFT JOIN tz_order c on b.order_number=c.order_number
|
|
|
|
|
+ LEFT JOIN tz_sku d on a.sku_id=d.sku_id
|
|
|
|
|
+ LEFT JOIN tz_user e on b.user_id=e.user_id
|
|
|
WHERE return_money_sts=70
|
|
WHERE return_money_sts=70
|
|
|
-
|
|
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and b.apply_time>= #{po.startTime}
|
|
and b.apply_time>= #{po.startTime}
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
and b.apply_time<= #{po.endTime}
|
|
and b.apply_time<= #{po.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ and c.channel_id in
|
|
|
|
|
+ <foreach collection="po.channelIds" item="id" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ <if test="po.skuId != null">
|
|
|
|
|
+ AND a.sku_id like concat('%',#{po.skuId} ,'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="po.skuName != null and po.skuName != ''">
|
|
|
|
|
+ AND d.sku_name like concat('%',#{po.skuName} ,'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="po.spec != null and po.spec != ''">
|
|
|
|
|
+ AND d.spec like concat('%',#{po.spec} ,'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
|
|
+ </if>
|
|
|
GROUP BY a.sku_id) d on a.sku_id = d.sku_id
|
|
GROUP BY a.sku_id) d on a.sku_id = d.sku_id
|
|
|
-
|
|
|
|
|
WHERE b.is_payed=1
|
|
WHERE b.is_payed=1
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and a.rec_time>= #{po.startTime}
|
|
and a.rec_time>= #{po.startTime}
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
and a.rec_time<= #{po.endTime}
|
|
and a.rec_time<= #{po.endTime}
|
|
|
</if>
|
|
</if>
|
|
@@ -614,11 +645,9 @@
|
|
|
<if test="po.skuId != null">
|
|
<if test="po.skuId != null">
|
|
|
AND a.sku_id like concat('%',#{po.skuId} ,'%')
|
|
AND a.sku_id like concat('%',#{po.skuId} ,'%')
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
<if test="po.skuName != null and po.skuName != ''">
|
|
<if test="po.skuName != null and po.skuName != ''">
|
|
|
AND a.sku_name like concat('%',#{po.skuName} ,'%')
|
|
AND a.sku_name like concat('%',#{po.skuName} ,'%')
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
<if test="po.spec != null and po.spec != ''">
|
|
<if test="po.spec != null and po.spec != ''">
|
|
|
AND c.spec like concat('%',#{po.spec} ,'%')
|
|
AND c.spec like concat('%',#{po.spec} ,'%')
|
|
|
</if>
|
|
</if>
|