|
|
@ -52,12 +52,18 @@
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="analysisLuckyMoney" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="analysisLuckyMoney" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
SELECT COUNT(red_packet_order_id) total_counts,sum(red_packet_amount) total_amount,
|
|
|
|
SELECT COUNT(red_packet_order_id) total_counts,
|
|
|
|
ifnull(SUM(if(status=0 AND lock_key is null,1,0)),0) unsend_counts,SUM(if(status=0 AND lock_key is null,red_packet_amount,0)) unsend_amount,
|
|
|
|
sum(red_packet_amount) total_amount,
|
|
|
|
sum(if(status!=0,1,0)) send_counts,SUM(if(status !=0 ,red_packet_amount,0)) send_amount,
|
|
|
|
ifnull(SUM(if(status=0 AND lock_key is null,1,0)),0) unsend_counts,
|
|
|
|
sum(if(status=2,1,0)) fail_counts,SUM(if(status=2,red_packet_amount,0)) fail_amount,
|
|
|
|
SUM(if(status=0 AND lock_key is null,red_packet_amount,0)) unsend_amount,
|
|
|
|
sum(if(status=1 or status=3,1,0)) receive_counts,SUM(if(status=1 or status=3,red_packet_amount,0)) receive_amount,
|
|
|
|
sum(if(status!=0,1,0)) send_counts,
|
|
|
|
sum(if(status=4,1,0)) return_counts,SUM(if(status=4,red_packet_amount,0)) return_amount
|
|
|
|
SUM(if(status !=0 ,red_packet_amount,0)) send_amount,
|
|
|
|
|
|
|
|
sum(if(status=2,1,0)) fail_counts,
|
|
|
|
|
|
|
|
SUM(if(status=2,red_packet_amount,0)) fail_amount,
|
|
|
|
|
|
|
|
sum(if(status=1 or status=3,1,0)) receive_counts,
|
|
|
|
|
|
|
|
SUM(if(status=1 or status=3,red_packet_amount,0)) receive_amount,
|
|
|
|
|
|
|
|
sum(if(status=4,1,0)) return_counts,
|
|
|
|
|
|
|
|
SUM(if(status=4,red_packet_amount,0)) return_amount
|
|
|
|
FROM act_red_packets_orders
|
|
|
|
FROM act_red_packets_orders
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
act_id = #{act_id}
|
|
|
|
act_id = #{act_id}
|
|
|
@ -164,7 +170,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getRedPacketsByOpenid" resultType="int">
|
|
|
|
<select id="getRedPacketsByOpenid" resultType="int">
|
|
|
|
SELECT count(1) FROM act_red_packets_orders WHERE open_id=#{open_id} and date(event_time) = date(#{event_date}) and status !=0 and act_id = '2'
|
|
|
|
SELECT count(1)
|
|
|
|
|
|
|
|
FROM act_red_packets_orders
|
|
|
|
|
|
|
|
WHERE open_id=#{open_id}
|
|
|
|
|
|
|
|
and date(event_time) = date(#{event_date})
|
|
|
|
|
|
|
|
and status !=0 and act_id = '2'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|