| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.cyksj.mapper.vip.VipOrderDonMapper">
- <select id="countPopularizeOrderDetail" resultType="com.cyksj.model.views.ChannelPopularizeView">
- select *
- from (select count(*) as orderCount, ifnull(sum(money),0) as orderMoney
- from vip_order_don
- where popularize_id = #{popularizeId}
- <if test="startTime != null and startTime != ''">
- and created_time >= #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- and created_time < #{endTime}
- </if>
- <if test="goodsId != null">
- and goods_id = #{goodsId}
- </if>
- and status not in ('close', 'noPayment')) s1
- ,
- (select count(*) as refundCount, ifnull(sum(money),0) as refundMoney
- from vip_order_don
- where popularize_id = #{popularizeId}
- <if test="startTime != null and startTime != ''">
- and created_time >= #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- and created_time < #{endTime}
- </if>
- <if test="goodsId != null">
- and goods_id = #{goodsId}
- </if>
- and status = 'refund')
- s2
- </select>
- </mapper>
|