|
@@ -36,6 +36,39 @@
|
|
|
</where>
|
|
|
</delete>
|
|
|
|
|
|
+ <select id="queryWeek" resultType="map" parameterType="map">
|
|
|
+ select year "year",week "week" from market_base_week where current date>=begin_date and current date <![CDATA[ <= ]]> end_date
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateYbh" parameterType="map">
|
|
|
+ UPDATE MARKET_BASE_IMPORT A SET A.IS_IMPORT='2'
|
|
|
+ WHERE (a.year,a.week) in (select year,week from market_base_week where current date>=begin_date and current date <![CDATA[ <= ]]> end_date)
|
|
|
+ AND A.CLIENT_CODE IN (SELECT A.CLIENT_CODE FROM MARKET_SAMPLE A
|
|
|
+ JOIN V_B_CLIENT B ON A.CLIENT_CODE=B.CLIENT_CODE AND A.COUNTY_CODE=B.COUNTY_CODE and b.county_code=#{countyCode})
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <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>
|
|
|
+
|
|
|
+ <update id="updateZdh1" parameterType="map">
|
|
|
+ UPDATE MARKET_BASE_IMPORT A SET A.YBH=(SELECT TYPE FROM MARKET_SAMPLE_ZD B WHERE A.CLIENT_CODE=B.CLIENT_CODE)
|
|
|
+ WHERE a.year=#{year} and a.week=#{week}
|
|
|
+ AND A.CLIENT_CODE IN (SELECT CLIENT_CODE FROM MARKET_SAMPLE_ZD WHERE COUNTY_CODE=#{countyCode})
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateZdh3" parameterType="map">
|
|
|
+ UPDATE MARKET_BASE_IMPORT A SET A.YBH='0'
|
|
|
+ WHERE a.year=#{year} and a.week=#{week} AND A.CLIENT_CODE not IN (SELECT CLIENT_CODE FROM MARKET_SAMPLE_ZD)
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateZdh2" parameterType="map">
|
|
|
+ UPDATE HBYC.MARKET_BASE_IMPORT A SET A.IS_IMPORT='1'
|
|
|
+ WHERE a.year=#{year} and a.week=#{week} AND A.YBH IN ('4','5','6','7') AND A.IS_IMPORT='0'
|
|
|
+ </update>
|
|
|
+
|
|
|
<select id="selectSourceByClientId" resultType="am.lodge.platform.model.AdmissionsSource">
|
|
|
SELECT bas.id id,bas.name name
|
|
|
from buss_admissions_source bas LEFT JOIN buss_client_source bcs on bas.ID=bcs.SOURCE_ID
|