1
0

4 Ревизии e20e8fb36b ... 59e3c8a9ad

Автор SHA1 Съобщение Дата
  zhangjr 59e3c8a9ad 岗位管理 преди 4 години
  zhangjr 911d583777 岗位管理 преди 4 години
  zhangjr 9622e59226 更新 преди 4 години
  zhangjr 09b9345d79 岗位管理 преди 4 години
променени са 2 файла, в които са добавени 34 реда и са изтрити 1 реда
  1. 33 0
      src/main/resources/mapper/base/AdmissionsSource.xml
  2. 1 1
      src/main/resources/mapper/base/Dept.xml

+ 33 - 0
src/main/resources/mapper/base/AdmissionsSource.xml

@@ -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

+ 1 - 1
src/main/resources/mapper/base/Dept.xml

@@ -26,7 +26,7 @@
 	<select id="treeList" resultType="am.lodge.platform.model.Dept">
 		select id, name, case when PARENT_ID ='' or PARENT_ID is null then org_id else PARENT_ID end as parentId from SYS_Dept
 		where org_id = #{orgId}
-		<if test="deptId!='' and deptId!='11421101'.toString()"> and id= #{deptId}</if>
+		<if test="deptId!='11421101'.toString()"> and id= #{deptId}</if>
 		order by order_Num
 	</select>