|
|
@@ -277,15 +277,9 @@
|
|
|
( `status` = 1
|
|
|
<if test="dataTime != null and dataTime != ''">
|
|
|
AND
|
|
|
- used_time > #{dataTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR ( `status` = 0
|
|
|
- <if test="dataTime != null and dataTime != ''">
|
|
|
- AND
|
|
|
buy_time > #{dataTime}
|
|
|
</if>
|
|
|
- )
|
|
|
+ )
|
|
|
</select>
|
|
|
<select id="getTradingVolume" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
|
|
|
SELECT
|
|
|
@@ -706,7 +700,7 @@
|
|
|
FROM
|
|
|
life_user_order
|
|
|
WHERE
|
|
|
- `status` = 4
|
|
|
+ `status` = 5
|
|
|
<if test="dataTime != null and dataTime != ''">
|
|
|
AND refund_time > #{dataTime}
|
|
|
</if>
|
|
|
@@ -717,39 +711,10 @@
|
|
|
FROM
|
|
|
life_user_order `order`
|
|
|
WHERE
|
|
|
- 1 = 1
|
|
|
- AND (
|
|
|
- (`order`.`status` = 0
|
|
|
- <if test="dataTime != null and dataTime != ''">
|
|
|
- AND pay_time > #{dataTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 1
|
|
|
- <if test="dataTime != null and dataTime != ''">
|
|
|
- AND used_time > #{dataTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 4
|
|
|
- <if test="dataTime != null and dataTime != ''">
|
|
|
- AND refund_time > #{dataTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 3
|
|
|
+ delete_flag = 0
|
|
|
<if test="dataTime != null and dataTime != ''">
|
|
|
- AND refund_time > #{dataTime}
|
|
|
+ AND buy_time > #{dataTime}
|
|
|
</if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 99
|
|
|
- <if test="dataTime != null and dataTime != ''">
|
|
|
- AND `order`.created_time > #{dataTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 98
|
|
|
- <if test="dataTime != null and dataTime != ''">
|
|
|
- AND `order`.created_time > #{dataTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- )
|
|
|
</select>
|
|
|
<select id="getStorePlatformOrderVolume" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
|
|
|
SELECT
|
|
|
@@ -760,69 +725,33 @@
|
|
|
ROUND(`order`.final_price, 2) AS final_price,
|
|
|
CASE
|
|
|
`order`.`status`
|
|
|
- WHEN 0 THEN '已付款'
|
|
|
- WHEN 1 THEN '已完成'
|
|
|
- WHEN 4 THEN '已退款'
|
|
|
- WHEN 99 THEN '待付款'
|
|
|
- WHEN 98 THEN '已取消'
|
|
|
- WHEN 3 THEN '待退款'
|
|
|
+ WHEN 0 THEN '待支付'
|
|
|
+ WHEN 1 THEN '已支付/待使用'
|
|
|
+ WHEN 2 THEN '已核销'
|
|
|
+ WHEN 3 THEN '已过期'
|
|
|
+ WHEN 4 THEN '已取消'
|
|
|
+ WHEN 5 THEN '已退款'
|
|
|
+ WHEN 6 THEN '退款失败'
|
|
|
+ WHEN 7 THEN '已完成'
|
|
|
END AS status_name
|
|
|
FROM
|
|
|
life_user_order `order`
|
|
|
LEFT JOIN life_coupon coupon ON `order`.quan_id = coupon.id
|
|
|
<where>
|
|
|
1 = 1
|
|
|
- <choose>
|
|
|
- <when test="orderType != null and orderType != ''">
|
|
|
- AND (`order`.`status` = #{orderType}
|
|
|
- <if test="orderType == 99">
|
|
|
- or `order`.`status` = "98"
|
|
|
- </if>
|
|
|
- )
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
<choose>
|
|
|
- <when test="orderType == 0 and startTime != null and startTime != ''">AND pay_time > #{startTime}</when>
|
|
|
- <when test="orderType == 1 and startTime != null and startTime != ''">AND used_time > #{startTime}</when>
|
|
|
- <when test="orderType == 4 and startTime != null and startTime != ''">AND refund_time > #{startTime}</when>
|
|
|
- <when test="orderType == 3 and startTime != null and startTime != ''">AND refund_time > #{startTime}</when>
|
|
|
- <when test="orderType == 98 and startTime != null and startTime != ''">AND `order`.created_time > #{startTime}</when>
|
|
|
- <when test="orderType == 99 and startTime != null and startTime != ''">AND `order`.created_time > #{startTime}</when>
|
|
|
+ <when test="orderType == 2">
|
|
|
+ AND (`order`.`status` = "0" or `order`.`status` = "4")
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND `order`.`status` = #{orderType}
|
|
|
+ </otherwise>
|
|
|
</choose>
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- AND (
|
|
|
- (`order`.`status` = 0
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- AND pay_time > #{startTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 1
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- AND used_time > #{startTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 4
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- AND refund_time > #{startTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 3
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- AND refund_time > #{startTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 99
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- AND `order`.created_time > #{startTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- OR (`order`.`status` = 98
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- AND `order`.created_time > #{startTime}
|
|
|
- </if>
|
|
|
- )
|
|
|
- )
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND buy_time > #{startTime}
|
|
|
+ </if>
|
|
|
<if test="orderId != null and orderId != ''">
|
|
|
AND `order`.`order_no` like concat('%',#{orderId},'%')
|
|
|
</if>
|