Explorar o código

1.提现任务分页总条数问题

wuhp hai 1 ano
pai
achega
322898593b

+ 3 - 2
src/main/resources/mapper/modules/console/WithdrawalTaskMapper.xml

@@ -43,6 +43,8 @@
                  left join sys_user_bank_card bc on bc.bank_number =a.bank_number and bc.user_id =a.user_id
                  left join sys_user su2 on su2.id = a.auditing_user_id
         <where>
+            and a.auditing_status in ('3','2')
+            and b.id is  not  null
             <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
                 AND a.create_time BETWEEN #{vo.beginDate} AND #{vo.endDate}
             </if>
@@ -53,7 +55,7 @@
     <select id="countWithdrawal" resultType="java.util.HashMap">
         select
               IFNULL(sum(a.amount),0) as "allWithdrawalAmount",
-              IFNULL(count(a.id),0) as "allWithdrawalNumber",
+              IFNULL(count(CASE WHEN a.auditing_status = 2 THEN  1  END),0)  +  IFNULL(count(CASE WHEN a.auditing_status = 3 THEN  1  END),0) as "allWithdrawalNumber",
               IFNULL(sum( CASE WHEN a.auditing_status = 2 THEN  IFNULL(a.amount,0)  END ),0)  AS notWithdrawalAmount,
               IFNULL(sum( CASE WHEN a.auditing_status = 3 THEN  IFNULL(a.amount,0)  END ),0)  AS withdrawalAmount,
               IFNULL(count(CASE WHEN a.auditing_status = 2 THEN  1  END),0) as "notAllWithdrawalNumber",
@@ -61,7 +63,6 @@
               IFNULL(sum( CASE WHEN a.auditing_status = 4 THEN  IFNULL(a.amount,0)  END ),0)  AS "failedWithdrawalAmount",
               IFNULL(count(CASE WHEN a.auditing_status = 4 THEN  1  END),0) as "failedWithdrawalNumber"
         from sys_amount_auditing a
-        LEFT JOIN sys_user_account_history b ON a.id = b.auditiing_id
         LEFT JOIN sys_user su ON su.id = a.user_id
         LEFT JOIN sys_dept sd ON sd.id = su.dept_id
         LEFT JOIN sys_user_bank_card bc ON bc.bank_number = a.bank_number