Sfoglia il codice sorgente

修改匹配已存在物料逻辑,enuu和code都相同时,判定为重复

dongbw 8 anni fa
parent
commit
306b5a8432

+ 2 - 1
src/main/java/com/uas/platform/b2b/dao/ProductTempDao.java

@@ -56,7 +56,8 @@ public class ProductTempDao {
 
     public void matchExists(String importId) {
         jdbcTemplate.update("Merge Into (Select * From Products_Temp Where Pr_Import_Id=? And Pr_Exist_Id Is Null) T " +
-                "Using Products P On (T.Pr_Title=P.Pr_Title And ((T.Pr_Cmpcode=P.Pr_Cmpcode And T.Pr_Brand=P.Pr_Brand) Or (T.Pr_Cmpcode=P.Pr_Pcmpcode And T.Pr_Brand=P.Pr_Pbrand)) " +
+                "Using Products P On ((T.pr_code = P.pr_code Or (T.Pr_Title=P.Pr_Title And T.Pr_Cmpcode=P.Pr_Cmpcode And T.Pr_Brand=P.Pr_Brand) " +
+                "Or (T.Pr_Title=P.Pr_Title And T.Pr_Cmpcode=P.Pr_Pcmpcode And T.Pr_Brand=P.Pr_Pbrand)) " +
                 "and t.pr_enuu=p.pr_enuu) when matched then update set t.pr_exist_id=p.pr_id", importId);
     }