소스 검색

fix Ai类品账号续费率

zoujiajian 2 년 전
부모
커밋
c3f271220e
1개의 변경된 파일12개의 추가작업 그리고 8개의 파일을 삭제
  1. 12 8
      netflix-dao/src/main/resources/mapper/StatisticsExportMapper.xml

+ 12 - 8
netflix-dao/src/main/resources/mapper/StatisticsExportMapper.xml

@@ -72,9 +72,10 @@
     </select>
 
     <select id="getMonthAiExNumOfUser" resultType="java.lang.Integer">
-        select count(distinct user_id)
+        select count(distinct buyer_id)
         from `order_don` od
-        where status not in ('close','refund','noPayment')
+        where status not in ('close','noPayment')
+        and (refund_money is null or refund_money != money)
         and created_time BETWEEN #{lastMonth} and #{thisMonth}
         and sku_id in
         <foreach collection="skuIds" item="item" open="(" separator="," close=")">
@@ -83,19 +84,21 @@
     </select>
 
     <select id="getMonthAiExNumOfUserByType" resultType="java.lang.Integer">
-        select count(distinct user_id) from (select user_id
+        select count(distinct buyer_id) from (select buyer_id
         from `order_don` od
-        where status not in ('close','refund','noPayment')
+        where status not in ('close','noPayment')
+        and (refund_money is null or refund_money != money)
         and created_time BETWEEN #{lastMonth} and #{thisMonth}
         and sku_id in
         <foreach collection="skuIds" item="item" open="(" separator="," close=")">
             #{item}
         </foreach>) s where EXISTS(select id
         from order_don
-        where status not in ('close','refund','noPayment')
+        where status not in ('close','noPayment')
+        and (refund_money is null or refund_money != money)
         and created_time between #{thisMonth} and #{nextMonth}
         and order_type = #{type}
-        and user_id = s.user_id
+        and buyer_id = s.buyer_id
         and sku_id in
         <foreach collection="skuIds" item="item" open="(" separator="," close=")">
             #{item}
@@ -104,9 +107,10 @@
     </select>
 
     <select id="getMonthAiRenewNumOfUser" resultType="java.lang.Integer">
-        select count(distinct user_id)
+        select count(distinct buyer_id)
         from `order_don` od
-        where status not in ('close','refund','noPayment')
+        where status not in ('close','noPayment')
+        and (refund_money is null or refund_money != money)
         and created_time BETWEEN #{thisMonth} and #{nextMonth}
         and order_type = 2
         and sku_id in