StatisticsUserDataMapper.xml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.manage.statistics.StatisticsUserDataMapper">
  4. <select id="getExportStreamingAccountData"
  5. resultType="com.cyksj.model.excel.statistics.ExcelStreamingAccountData">
  6. select count(distinct user_id) as numOfUser, count(*) as numOfOrder,ifnull(sum(money)/100,0) as money from
  7. `order_don`
  8. where sku_id in (select id from `goods_don_sku` where goods_id = #{goodsId})
  9. and status not in ('close','noPayment','refund')
  10. <if test="isDis!=null and isDis">
  11. and is_distribute = 1
  12. </if>
  13. <if test="isCode!=null and isCode">
  14. and `type` = 'EX_CODE'
  15. </if>
  16. and created_time between #{start} and #{end}
  17. </select>
  18. <select id="getTypeData" resultType="java.lang.Integer">
  19. select count(*) as numOfOrder from `order_don` od where
  20. sku_id in (select id from `goods_don_sku` where goods_id = #{goodsId} and spec_val like '%${type}%%'
  21. <if test="type =='月'.toString()">
  22. and spec_val not like '%年%'
  23. </if>)
  24. and status not in ('close','noPayment','refund')
  25. and created_time between #{start} and #{end}
  26. </select>
  27. <select id="getExportRealData" resultType="com.cyksj.model.excel.statistics.ExcelRealGoodsData">
  28. select count(distinct user_id) as numOfUser, count(*) as numOfOrder, ifnull(sum(money) / 100, 0) as money
  29. from `order_don`
  30. where sku_id = #{skuId}
  31. and status not in ('close', 'noPayment', 'refund')
  32. and created_time between #{start} and #{end}
  33. </select>
  34. <select id="getPlatformHasPaymentOrders" resultType="com.cyksj.model.entity.RegisterOrderDon">
  35. select id,
  36. platform,
  37. money,
  38. user_id
  39. from `register_order_don`
  40. where platform = #{platform}
  41. and created_time between #{start} and #{end}
  42. and status not in ('close', 'noPayment', 'refund')
  43. </select>
  44. </mapper>