|
|
@@ -202,17 +202,17 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="goodsTotalPrice" resultType="Double">
|
|
|
- SELECT (SELECT SUM(IFNULL(total,0)) goods_total_price FROM tz_order
|
|
|
- WHERE is_payed=1
|
|
|
+ SELECT (SELECT IFNULL(SUM(IFNULL(a.total,0)) ,0) goods_total_price FROM tz_order a
|
|
|
+ LEFT JOIN tz_user e on a.user_id=e.user_id
|
|
|
+ WHERE a.is_payed=1
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
- and create_time>= #{po.startTime}
|
|
|
+ and a.create_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
- and create_time<= #{po.endTime}
|
|
|
+ and a.create_time<= #{po.endTime}
|
|
|
</if>
|
|
|
<if test="po.skuId != null or (po.skuName != null and po.skuName != '') or (po.spec != null and po.spec != '')">
|
|
|
- and order_number in(SELECT a.order_number FROM tz_order_item a LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
+ and a.order_number in(SELECT a.order_number FROM tz_order_item a LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
<where>
|
|
|
<if test="po.skuId != null">
|
|
|
AND a.sku_id like concat('%',#{po.skuId} ,'%')
|
|
|
@@ -229,22 +229,25 @@
|
|
|
)
|
|
|
</if>
|
|
|
|
|
|
- and channel_id in
|
|
|
+ and a.channel_id in
|
|
|
<foreach collection="po.channelIds" item="id" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
+ </if>
|
|
|
)
|
|
|
-
|
|
|
- (SELECT IFNULL(SUM(a.sku_price * product_count),0)
|
|
|
+ (SELECT IFNULL(SUM(a.sku_price * a.product_count),0)
|
|
|
FROM `tz_order_refund_sku` a
|
|
|
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 b.return_money_sts=70
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and b.apply_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
and b.apply_time<= #{po.endTime}
|
|
|
</if>
|
|
|
@@ -252,38 +255,37 @@
|
|
|
<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>
|
|
|
) goods_total_price
|
|
|
</select>
|
|
|
|
|
|
<select id="totalPoints" resultType="Double">
|
|
|
- SELECT TRUNCATE(((SELECT SUM(IFNULL(offset_points,0)) FROM tz_order
|
|
|
- WHERE is_payed=1
|
|
|
+ SELECT TRUNCATE(((SELECT SUM(IFNULL(a.offset_points,0)) FROM tz_order a
|
|
|
+ LEFT JOIN tz_user e on a.user_id=e.user_id
|
|
|
+ WHERE a.is_payed=1
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
- and create_time>= #{po.startTime}
|
|
|
+ and a.create_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
- and create_time<= #{po.endTime}
|
|
|
+ and a.create_time<= #{po.endTime}
|
|
|
</if>
|
|
|
- and channel_id in
|
|
|
+ and a.channel_id in
|
|
|
<foreach collection="po.channelIds" item="id" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
<if test="po.skuId != null or (po.skuName != null and po.skuName != '') or (po.spec != null and po.spec != '')">
|
|
|
- and order_number in(SELECT a.order_number FROM tz_order_item a LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
+ and a.order_number in(SELECT a.order_number FROM tz_order_item a LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
<where>
|
|
|
<if test="po.skuId != null">
|
|
|
AND a.sku_id like concat('%',#{po.skuId} ,'%')
|
|
|
@@ -296,6 +298,9 @@
|
|
|
<if test="po.spec != null and po.spec != ''">
|
|
|
AND b.spec like concat('%',#{po.spec} ,'%')
|
|
|
</if>
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
)
|
|
|
</if>
|
|
|
@@ -307,15 +312,19 @@
|
|
|
ELSE total_offset_points+ (freight_amount * 100)
|
|
|
END AS total_offset_points
|
|
|
FROM tz_order_refund a
|
|
|
+ LEFT JOIN tz_user e on a.user_id=e.user_id
|
|
|
LEFT JOIN (SELECT SUM(tor.offset_points) total_offset_points ,tor.order_number
|
|
|
FROM tz_order_refund tor
|
|
|
+ LEFT JOIN tz_user e on tor.user_id=e.user_id
|
|
|
WHERE tor.return_money_sts=70
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and tor.apply_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
and tor.apply_time<= #{po.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
</if>
|
|
|
and tor.order_number in(SELECT ao.order_number FROM tz_order_item ao
|
|
|
LEFT JOIN tz_sku b on ao.sku_id=b.sku_id
|
|
|
@@ -343,11 +352,13 @@
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and apply_time >= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
and apply_time <= #{po.endTime}
|
|
|
</if>
|
|
|
- and a.order_number in(SELECT ao2.order_number FROM tz_order_item ao2
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
+ </if>
|
|
|
+ and a.order_number in(SELECT ao2.order_number FROM tz_order_item ao2
|
|
|
LEFT JOIN tz_sku b on ao2.sku_id=b.sku_id
|
|
|
LEFT JOIN tz_order c on ao2.order_number=c.order_number
|
|
|
<where>
|
|
|
@@ -372,20 +383,24 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="totalCash" resultType="Double">
|
|
|
- SELECT (SELECT SUM(IFNULL(actual_total,0)) FROM tz_order WHERE is_payed=1
|
|
|
+ SELECT (SELECT SUM(IFNULL(a.actual_total,0)) FROM tz_order a
|
|
|
+ LEFT JOIN tz_user e on a.user_id=e.user_id
|
|
|
+ WHERE a.is_payed=1
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
- and create_time>= #{po.startTime}
|
|
|
+ and a.create_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
- and create_time<= #{po.endTime}
|
|
|
+ and a.create_time<= #{po.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
</if>
|
|
|
- and channel_id in
|
|
|
+ and a.channel_id in
|
|
|
<foreach collection="po.channelIds" item="id" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
<if test="po.skuId != null or (po.skuName != null and po.skuName != '') or (po.spec != null and po.spec != '')">
|
|
|
- and order_number in(SELECT a.order_number FROM tz_order_item a LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
+ and a.order_number in(SELECT a.order_number FROM tz_order_item a LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
<where>
|
|
|
<if test="po.skuId != null">
|
|
|
AND a.sku_id like concat('%',#{po.skuId} ,'%')
|
|
|
@@ -401,15 +416,19 @@
|
|
|
</if>
|
|
|
)
|
|
|
-
|
|
|
- (SELECT IFNULL(SUM( refund_amount ),0) FROM tz_order_refund WHERE return_money_sts=70
|
|
|
+ (SELECT IFNULL(SUM( a.refund_amount ),0) FROM tz_order_refund a
|
|
|
+ LEFT JOIN tz_user e on a.user_id=e.user_id
|
|
|
+ WHERE a.return_money_sts=70
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
- and apply_time>= #{po.startTime}
|
|
|
+ and a.apply_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
- and apply_time<= #{po.endTime}
|
|
|
+ and a.apply_time<= #{po.endTime}
|
|
|
</if>
|
|
|
- and order_number in(SELECT a.order_number FROM tz_order_item a
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
+ </if>
|
|
|
+ and a.order_number in(SELECT a.order_number FROM tz_order_item a
|
|
|
LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
LEFT JOIN tz_order c on a.order_number=c.order_number
|
|
|
<where>
|
|
|
@@ -433,21 +452,24 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="totalFreight" resultType="Double">
|
|
|
- SELECT (SELECT IFNULL(SUM(freight_amount),0) total_freight FROM tz_order
|
|
|
- WHERE is_payed=1
|
|
|
+ SELECT (SELECT IFNULL(SUM(a.freight_amount),0) total_freight FROM tz_order a
|
|
|
+ LEFT JOIN tz_user e on a.user_id=e.user_id
|
|
|
+ WHERE a.is_payed=1
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
- and create_time>= #{po.startTime}
|
|
|
+ and a.create_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
- and create_time<= #{po.endTime}
|
|
|
+ and a.create_time<= #{po.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
</if>
|
|
|
- and channel_id in
|
|
|
+ and a.channel_id in
|
|
|
<foreach collection="po.channelIds" item="id" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
<if test="po.skuId != null or (po.skuName != null and po.skuName != '') or (po.spec != null and po.spec != '')">
|
|
|
- and order_number in(SELECT a.order_number FROM tz_order_item a LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
+ and a.order_number in(SELECT a.order_number FROM tz_order_item a LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
<where>
|
|
|
<if test="po.skuId != null">
|
|
|
AND a.sku_id like concat('%',#{po.skuId} ,'%')
|
|
|
@@ -465,18 +487,21 @@
|
|
|
</if>
|
|
|
)
|
|
|
-
|
|
|
- (SELECT IFNULL(SUM(freight_amount),0)
|
|
|
- FROM `tz_order_refund`
|
|
|
- WHERE return_money_sts=70
|
|
|
+ (SELECT IFNULL(SUM(a.freight_amount),0)
|
|
|
+ FROM `tz_order_refund` a
|
|
|
+ LEFT JOIN tz_user e on a.user_id=e.user_id
|
|
|
+ WHERE a.return_money_sts=70
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
- and apply_time>= #{po.startTime}
|
|
|
+ and a.apply_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
- and apply_time<= #{po.endTime}
|
|
|
+ and a.apply_time<= #{po.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
</if>
|
|
|
- and refund_type=1
|
|
|
- and order_number in(SELECT a.order_number FROM tz_order_item a
|
|
|
+ and a.refund_type=1
|
|
|
+ and a.order_number in(SELECT a.order_number FROM tz_order_item a
|
|
|
LEFT JOIN tz_sku b on a.sku_id=b.sku_id
|
|
|
LEFT JOIN tz_order c on a.order_number=c.order_number
|
|
|
<where>
|
|
|
@@ -500,25 +525,44 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="skuStatisticsList" resultType="com.yami.shop.bean.vo.SkuStatisticsVo">
|
|
|
- SELECT a.prod_id,a.sku_id,a.sku_name,c.spec,TRUNCATE(IFNULL(SUM(a.price*a.prod_count)/SUM(a.prod_count),0),2) price,IFNULL(SUM(a.prod_count),0)-IFNULL(d.product_count,0) as prod_count,
|
|
|
- TRUNCATE(IFNULL(SUM(a.price*a.prod_count)/SUM(a.prod_count),0),2) * (IFNULL(SUM(a.prod_count),0)-IFNULL(d.product_count,0)) total
|
|
|
+ SELECT a.prod_id,a.sku_id,a.sku_name,c.spec,TRUNCATE(IFNULL(SUM(a.price*a.prod_count)/SUM(a.prod_count),0),2)
|
|
|
+ price,IFNULL(SUM(a.prod_count),0)-IFNULL(d.product_count,0) as prod_count,
|
|
|
+ TRUNCATE(IFNULL(SUM(a.price*a.prod_count)/SUM(a.prod_count),0),2) *
|
|
|
+ (IFNULL(SUM(a.prod_count),0)-IFNULL(d.product_count,0)) total
|
|
|
FROM tz_order_item a
|
|
|
LEFT JOIN tz_order b on a.order_number=b.order_number
|
|
|
LEFT JOIN tz_sku c on a.sku_id=c.sku_id
|
|
|
+ LEFT JOIN tz_user e on b.user_id=e.user_id
|
|
|
LEFT JOIN (SELECT a.sku_id,SUM(a.product_count) product_count
|
|
|
FROM `tz_order_refund_sku` a
|
|
|
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
|
|
|
-
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and b.apply_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
and b.apply_time<= #{po.endTime}
|
|
|
</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
|
|
|
-
|
|
|
WHERE b.is_payed=1
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and a.rec_time>= #{po.startTime}
|
|
|
@@ -542,34 +586,55 @@
|
|
|
<if test="po.spec != null and po.spec != ''">
|
|
|
AND c.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 HAVING prod_count>0
|
|
|
</select>
|
|
|
|
|
|
<select id="skuStatisticsList2" resultType="com.yami.shop.bean.vo.SkuStatisticsVo">
|
|
|
- SELECT a.prod_id,a.sku_id,a.sku_name,c.spec,TRUNCATE(IFNULL(SUM(a.price*a.prod_count)/SUM(a.prod_count),0),2) price,IFNULL(SUM(a.prod_count),0)-IFNULL(d.product_count,0) as prod_count,
|
|
|
- TRUNCATE(IFNULL(SUM(a.price*a.prod_count)/SUM(a.prod_count),0),2) * (IFNULL(SUM(a.prod_count),0)-IFNULL(d.product_count,0)) total
|
|
|
+ SELECT a.prod_id,a.sku_id,a.sku_name,c.spec,TRUNCATE(IFNULL(SUM(a.price*a.prod_count)/SUM(a.prod_count),0),2)
|
|
|
+ price,IFNULL(SUM(a.prod_count),0)-IFNULL(d.product_count,0) as prod_count,
|
|
|
+ TRUNCATE(IFNULL(SUM(a.price*a.prod_count)/SUM(a.prod_count),0),2) *
|
|
|
+ (IFNULL(SUM(a.prod_count),0)-IFNULL(d.product_count,0)) total
|
|
|
FROM tz_order_item a
|
|
|
LEFT JOIN tz_order b on a.order_number=b.order_number
|
|
|
LEFT JOIN tz_sku c on a.sku_id=c.sku_id
|
|
|
+ LEFT JOIN tz_user e on b.user_id=e.user_id
|
|
|
LEFT JOIN (SELECT a.sku_id,SUM(a.product_count) product_count
|
|
|
FROM `tz_order_refund_sku` a
|
|
|
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
|
|
|
-
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and b.apply_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
and b.apply_time<= #{po.endTime}
|
|
|
</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
|
|
|
-
|
|
|
WHERE b.is_payed=1
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and a.rec_time>= #{po.startTime}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.endTime != null and po.endTime != ''">
|
|
|
and a.rec_time<= #{po.endTime}
|
|
|
</if>
|
|
|
@@ -580,14 +645,15 @@
|
|
|
<if test="po.skuId != null">
|
|
|
AND a.sku_id like concat('%',#{po.skuId} ,'%')
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.skuName != null and po.skuName != ''">
|
|
|
AND a.sku_name like concat('%',#{po.skuName} ,'%')
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.spec != null and po.spec != ''">
|
|
|
AND c.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 HAVING prod_count>0
|
|
|
</select>
|
|
|
|
|
|
@@ -601,16 +667,15 @@
|
|
|
FROM (SELECT @row_number := 0) sort,
|
|
|
tz_order a
|
|
|
LEFT JOIN tz_user_addr_order b on a.addr_order_id =b.addr_order_id
|
|
|
+ LEFT JOIN tz_user e on a.user_id=e.user_id
|
|
|
WHERE a.is_payed=1 and a.hb_order_status not in(0,60)
|
|
|
and a.channel_id in
|
|
|
<foreach collection="po.channelIds" item="id" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
-
|
|
|
<if test="po.delivery != null">
|
|
|
and a.dvy_type=#{po.delivery}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.receiver != null and po.receiver != ''">
|
|
|
AND b.receiver like concat('%',#{po.receiver} ,'%')
|
|
|
</if>
|
|
|
@@ -626,6 +691,9 @@
|
|
|
<if test="po.orderNo != null and po.orderNo != ''">
|
|
|
AND a.order_number like concat('%',#{po.orderNo} ,'%')
|
|
|
</if>
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
+ </if>
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and a.pay_time>= #{po.startTime}
|
|
|
</if>
|
|
|
@@ -644,16 +712,15 @@
|
|
|
FROM (SELECT @row_number := 0) sort,
|
|
|
tz_order a
|
|
|
LEFT JOIN tz_user_addr_order b on a.addr_order_id =b.addr_order_id
|
|
|
+ LEFT JOIN tz_user e on a.user_id=e.user_id
|
|
|
WHERE a.is_payed=1 and a.hb_order_status not in(0,60)
|
|
|
and a.channel_id in
|
|
|
<foreach collection="po.channelIds" item="id" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
-
|
|
|
<if test="po.delivery != null">
|
|
|
and a.dvy_type=#{po.delivery}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="po.receiver != null and po.receiver != ''">
|
|
|
AND b.receiver like concat('%',#{po.receiver} ,'%')
|
|
|
</if>
|
|
|
@@ -669,6 +736,9 @@
|
|
|
<if test="po.orderNo != null and po.orderNo != ''">
|
|
|
AND a.order_number like concat('%',#{po.orderNo} ,'%')
|
|
|
</if>
|
|
|
+ <if test="po.userAttrType != null and po.userAttrType != 0">
|
|
|
+ AND e.user_attr_type=#{po.userAttrType}
|
|
|
+ </if>
|
|
|
<if test="po.startTime != null and po.startTime != ''">
|
|
|
and a.pay_time>= #{po.startTime}
|
|
|
</if>
|