VipOrderDonMapper.xml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.cyksj.mapper.vip.VipOrderDonMapper">
  4. <select id="countPopularizeOrderDetail" resultType="com.cyksj.model.views.ChannelPopularizeView">
  5. select *
  6. from (select count(*) as orderCount, ifnull(sum(money),0) as orderMoney
  7. from vip_order_don
  8. where popularize_id = #{popularizeId}
  9. <if test="startTime != null and startTime != ''">
  10. and created_time >= #{startTime}
  11. </if>
  12. <if test="endTime != null and endTime != ''">
  13. and created_time &lt; #{endTime}
  14. </if>
  15. <if test="goodsId != null">
  16. and goods_id = #{goodsId}
  17. </if>
  18. and status not in ('close', 'noPayment')) s1
  19. ,
  20. (select count(*) as refundCount, ifnull(sum(money),0) as refundMoney
  21. from vip_order_don
  22. where popularize_id = #{popularizeId}
  23. <if test="startTime != null and startTime != ''">
  24. and created_time >= #{startTime}
  25. </if>
  26. <if test="endTime != null and endTime != ''">
  27. and created_time &lt; #{endTime}
  28. </if>
  29. <if test="goodsId != null">
  30. and goods_id = #{goodsId}
  31. </if>
  32. and status = 'refund')
  33. s2
  34. </select>
  35. </mapper>