xdd hace 1 mes
padre
commit
8540f56783

+ 15 - 20
fs-service/src/main/resources/mapper/statis/ConsumptionBalanceMapper.xml

@@ -121,11 +121,10 @@
         </where>
     </select>
     <select id="queryRewardCount" resultType="java.lang.Long">
-        select count(*) from company_red_package_logs rpl
+        select count(*) from fs_course_red_packet_log rpl
             left join fs_course_watch_log log
             on rpl.watch_log_id=log.log_id
         <where>
-            rpl.operate_type=1
             <if test="startTime != null and endTime != null">
                 and rpl.create_time BETWEEN #{startTime} AND #{endTime}
             </if>
@@ -138,11 +137,10 @@
         </where>
     </select>
     <select id="queryRewardMoney" resultType="java.math.BigDecimal">
-        select sum(up_money) from company_red_package_logs rpl
+        select sum(rpl.amount) from fs_course_red_packet_log rpl
         left join fs_course_watch_log log
         on rpl.watch_log_id=log.log_id
         <where>
-            rpl.operate_type=1
             <if test="startTime != null and endTime != null">
                 and rpl.create_time BETWEEN #{startTime} AND #{endTime}
             </if>
@@ -280,14 +278,12 @@
             <if test="dataType == 1">
                 rpl.course_id as course_id,
             </if>
-            SUM(rpl.money) as rewardMoney
+            SUM(rpl.amount) as rewardMoney
         FROM
-            company_red_package_logs rpl
-        left join fs_course_watch_log log
-        on rpl.watch_log_id=log.log_id
+            fs_course_red_packet_log rpl
+            left join fs_course_watch_log log
+            on rpl.watch_log_id=log.log_id
         <where>
-            rpl.operate_type = 1
-            AND rpl.status = 1
             <if test="startTime != null">
                 AND rpl.create_time <![CDATA[>=]]> #{startTime}
             </if>
@@ -322,8 +318,8 @@
         <if test="type == 2 or type == 3 or type == 4">
             DATE_FORMAT(rpl.create_time, '%Y-%m-%d') AS start_date,
         </if>
-               SUM(rpl.money) as rewardMoney
-        from company_red_package_logs rpl
+            SUM(rpl.amount) as rewardMoney
+        from fs_course_red_packet_log rpl
         left join fs_course_watch_log log
         on rpl.watch_log_id=log.log_id
         <where>
@@ -339,13 +335,11 @@
             <if test="companyId != null">
                 and log.company_id = ${companyId}
             </if>
-            AND rpl.operate_type = 1
-            AND rpl.status = 1
         </where>
         group by start_date
     </select>
     <select id="getCurrentBalance" resultType="java.math.BigDecimal">
-        select sum(money) from company
+        select sum(money) from company where is_del=0
     </select>
     <select id="dealerAggregatedCompanyId" resultType="com.fs.statis.dto.DealerAggregatedDTO">
         SELECT
@@ -381,11 +375,11 @@
                                 </where>
                 ) AS black_num,
                 (select COUNT(*) FROM qw_user
-                    <where>
-                        <if test="companyId != null">
-                            company_id = ${companyId}
-                        </if>
-                    </where>
+                <where>
+                    <if test="companyId != null">
+                       AND company_id = ${companyId}
+                    </if>
+                </where>
         ) AS qw_member_num
     </select>
     <select id="getCurrentBalanceCompanyId" resultType="java.math.BigDecimal">
@@ -394,6 +388,7 @@
             <if test="companyId != null">
                 company_id = #{companyId}
             </if>
+            AND is_del=0
         </where>
     </select>