Selaa lähdekoodia

Merge remote-tracking branch 'origin/freeze231204' into uat

njs 1 vuosi sitten
vanhempi
commit
71ddf1bad3

+ 6 - 6
suishenbang-sync/suishenbang-sync-common/src/main/java/com/dgtly/sync/service/HanaOrderComponent.java

@@ -400,13 +400,13 @@ public class HanaOrderComponent {
     /**HANA已冻结经销商**/
     public void hanaFreezeCustomer()throws Exception{
         Connection con = this.getHanaConnection();
-        PreparedStatement pstmt = con.prepareStatement(" SELECT  DISTINCT KUNNR \n" +
-                "                FROM ERP.KNVV  \n" +
+        PreparedStatement pstmt = con.prepareStatement(" select a.KUNNR from (SELECT   s.KUNNR \n" +
+                "                FROM ERP.KNVV s \n" +
                 "                WHERE \n" +
-                "                 (SPART = (case   when  SPART='14' then '14' \n" +
-                "                 when SPART='15' then '15' \n" +
-                "                 else  '16' end )   and (LIFSD IS NULL or LIFSD = '')  AND VTWEG = 'D9'and VKORG = 'S200' and KVGR3 not in ('D03')) or (KVGR3 = 'D03'  and (LIFSD IS NULL or LIFSD = '') AND VTWEG = 'D9' ) \n" +
-                "                 order by SPART asc ");
+                "                 (s.SPART = (case   when  s.SPART='14' then '14' \n" +
+                "                 when s.SPART='15' then '15' \n" +
+                "                 else  '16' end )   and (s.LIFSD IS NULL or s.LIFSD = '')  AND s.VTWEG = 'D9'and s.VKORG = 'S200' and s.KVGR3 not in ('D03')) or (s.KVGR3 = 'D03'  and (s.LIFSD IS NULL or s.LIFSD = '') AND s.VTWEG = 'D9' )order by s.SPART asc)a \n" +
+                "                 group by a.KUNNR  ");
         Long startTime = System.currentTimeMillis();
         ResultSet rs = pstmt.executeQuery();
         Long endTime = System.currentTimeMillis();