| | |
| | | </foreach>
|
| | | </if>
|
| | | </select>
|
| | |
|
| | |
|
| | | |
| | | |
| | | <select id="countOrderByTypeAndDate" resultType="Integer">
|
| | | SELECT COUNT(co.`co_id`) FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE 1=1
|
| | | <if test="orderType == 1"> <!-- 自购订单 -->
|
| | | AND (v2.hb_type =1 or v2.hb_type =2)
|
| | | </if>
|
| | | <if test="orderType == 2"> <!-- 分享订单 -->
|
| | | AND v2.`hb_type` = 20
|
| | | </if>
|
| | | <if test="orderType == 3"> <!-- 邀请订单 -->
|
| | | AND v2.`hb_type` = 6
|
| | | </if>
|
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL AND (co.`co_state`=1 OR co.`co_state`=2) |
| | | AND DATE_FORMAT(co.`co_third_create_time`,'%Y-%m-%d') = #{preDay}
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`
|
| | | </select>
|
| | | |
| | | </mapper>
|