zz преди 1 година
родител
ревизия
f20ff84b9c
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 5 2
      src/main/resources/mapper/base/AdmissionsSource.xml

+ 5 - 2
src/main/resources/mapper/base/AdmissionsSource.xml

@@ -49,8 +49,11 @@
 
 
   <update id="updateClientLine" parameterType="map">
-    UPDATE MARKET_BASE_IMPORT A SET A.MANAGER_CODE= (SELECT MANAGER_CODE FROM V_B_CLIENT B WHERE A.CLIENT_CODE=B.CLIENT_CODE AND B.COUNTY_CODE=#{countyCode})
-    WHERE A.COUNTY_CODE=#{countyCode} AND (a.year,a.week) in (select year,week from market_base_week where current date>=begin_date and current date <![CDATA[ <= ]]> end_date)
+    update market_base_import a
+    join market_base_week b on a.year=b.year and a.week=b.week
+    join v_b_client c on a.client_code=c.client_code
+    set a.manager_code=c.manager_code
+    where current_date()>=b.begin_date  and current_date()<![CDATA[ <= ]]>b.end_date and a.county_code=#{countyCode}
   </update>
 
   <update id="updateZdh1" parameterType="map">