Kaynağa Gözat

逾期 旧数据 处理

shenziyin-gh 1 yıl önce
ebeveyn
işleme
9d1eaca764

+ 1 - 5
src/main/java/com/cool/bang/modules/mysql/service/MySQLService.java

@@ -1457,11 +1457,7 @@ public class MySQLService {
             overdue.setLoanValidity(yqht.getSdyqdate());
             overdue.setAccumulationFundValidity(yqht.getGjjyqdate());
             //查看是否已经交完款  交完款的 逾期设置为
-            if (yqht.getTradeAmount().compareTo(yqht.getHTZJ()) > -1) {
-                overdue.setIsOverdue(1);//正常
-            } else {
-                overdue.setIsOverdue(0);//逾期
-            }
+            overdue.setIsOverdue(0);//逾期
             list.add(overdue);
         }
 

+ 32 - 2
src/main/resources/mapper/oracle/OracleMapper.xml

@@ -72,7 +72,7 @@
     </select>
 
     <select id="selectYqHtInfo" resultType="com.cool.bang.modules.oracle.domain.po.HtInfo">
-        SELECT
+        /*SELECT
             NVL(SUM(tra.TRADEAMOUNT),0) AS tradeAmount,
             h.HTBH,
             MAX(h.HTZJ) AS HTZJ,
@@ -86,7 +86,37 @@
         WHERE
             h.STATE = 1
           AND h.yqflag = 1
-        GROUP BY h.HTBH
+        GROUP BY h.HTBH*/
+        SELECT
+        t.htbh AS HTBH,
+        t.sdyqdate AS sdyqdate,
+        t.gjjyqdate AS gjjyqdate,
+        t.htzj AS HTZJ,
+        NVL(t.count,0) AS count
+        FROM
+        Bht t
+        WHERE
+        t.state = '1'
+        AND t.paymodel IN ( '01', '02', '04' )
+        AND EXISTS (
+        SELECT
+        p.htid
+        FROM
+        Bhtpay p
+        WHERE
+        p.paytype IN ( '3', '2' )
+        AND NOT EXISTS ( SELECT tr.id FROM Trade tr WHERE tr.tradestate = '1' AND tr.tradenum = p.jkbh )
+        AND t.htid = p.htid
+        )
+        AND NOT EXISTS ( SELECT * FROM Aregitem i WHERE i.jgstate = '-1' AND i.lzbh = t.lzbh )
+        AND (
+        ( t.htdate &lt; to_date( '2023-02-05', 'yyyy-mm-dd' ) AND ( t.yqflag = '0' OR t.yqflag IS NULL ) )
+        OR ( t.yqflag = '1' AND t.sdyqdate &lt; to_date( '2023-05-05 00:00:00', 'yyyy-mm-dd hh24:mi:ss' ) )
+        OR ( t.yqflag = '1' AND t.gjjyqdate &lt; to_date( '2023-05-05 00:00:00', 'yyyy-mm-dd hh24:mi:ss' ) )
+        OR t.yqflag = '1'
+        )
+        ORDER BY
+        t.htbh DESC
     </select>
 
     <select id="selectHtPayInfo" resultType="com.cool.bang.modules.oracle.domain.po.HtPay">