Commit e9ac31c4 authored by huyuchen's avatar huyuchen

huych-跨库查档案的合同表,因为需要查询合同的最新状态,合同表只用到身份证和项目编码和id三个字段,跨库查效率较高,如果后期改库需要调整这块代码

parent 6ef82d29
...@@ -456,7 +456,8 @@ ...@@ -456,7 +456,8 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
,if(b.id is not null,'0','1') as CONTRACT_STATUS,a.FUND_START_DATE ,if(b.id is not null,'0','1') as CONTRACT_STATUS,a.FUND_START_DATE
FROM t_dispatch_info_pre a FROM t_dispatch_info_pre a
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO <!--huych:跨库查档案的合同表,因为需要查询合同的最新状态,合同表只用到身份证和项目编码和id三个字段,跨库查效率较高,如果后期改库需要调整这块代码-->
left join mvp_archives.t_employee_contract_info b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where> <where>
a.DELETE_FLAG = '0' a.DELETE_FLAG = '0'
<include refid="tDispatchInfoPre_where"/> <include refid="tDispatchInfoPre_where"/>
...@@ -470,7 +471,7 @@ ...@@ -470,7 +471,7 @@
count(a.id) count(a.id)
FROM t_dispatch_info_pre a FROM t_dispatch_info_pre a
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO left join mvp_archives.t_employee_contract_info b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where> <where>
1=1 and a.type_sub = '0' 1=1 and a.type_sub = '0'
<include refid="tDispatchInfoPre_where"/> <include refid="tDispatchInfoPre_where"/>
...@@ -480,7 +481,7 @@ ...@@ -480,7 +481,7 @@
SELECT SELECT
count(a.id) count(a.id)
FROM t_dispatch_info_pre a FROM t_dispatch_info_pre a
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO left join mvp_archives.t_employee_contract_info b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where> <where>
1=1 and a.type_sub = '1' 1=1 and a.type_sub = '1'
and a.DELETE_FLAG = '0' and a.DELETE_FLAG = '0'
...@@ -492,7 +493,7 @@ ...@@ -492,7 +493,7 @@
SELECT SELECT
count(a.id) count(a.id)
FROM t_dispatch_info_pre a FROM t_dispatch_info_pre a
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO left join mvp_archives.t_employee_contract_info b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where> <where>
1=1 and a.type_sub = '1' 1=1 and a.type_sub = '1'
and a.DELETE_FLAG = '0' and a.DELETE_FLAG = '0'
...@@ -530,7 +531,7 @@ ...@@ -530,7 +531,7 @@
a.BIRTH_START, a.BIRTH_START,
a.BIGAILMENT_START a.BIGAILMENT_START
FROM t_dispatch_info_pre a FROM t_dispatch_info_pre a
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO left join mvp_archives.t_employee_contract_info b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where> <where>
a.DELETE_FLAG = '0' and a.type_sub = '0' a.DELETE_FLAG = '0' and a.type_sub = '0'
<include refid="tDispatchInfoPre_where"/> <include refid="tDispatchInfoPre_where"/>
...@@ -568,7 +569,7 @@ ...@@ -568,7 +569,7 @@
a.customer_username, a.customer_username,
a.FUND_START_DATE a.FUND_START_DATE
FROM t_dispatch_info_pre a FROM t_dispatch_info_pre a
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO left join mvp_archives.t_employee_contract_info b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where> <where>
a.DELETE_FLAG = '0' and a.type_sub = '1' a.DELETE_FLAG = '0' and a.type_sub = '1'
<include refid="tDispatchInfoPre_where"/> <include refid="tDispatchInfoPre_where"/>
...@@ -585,7 +586,7 @@ ...@@ -585,7 +586,7 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
,if(b.id is not null,'0','1') as CONTRACT_STATUS,a.FUND_START_DATE ,if(b.id is not null,'0','1') as CONTRACT_STATUS,a.FUND_START_DATE
FROM t_dispatch_info_pre a FROM t_dispatch_info_pre a
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO left join mvp_archives.t_employee_contract_info b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where> <where>
a.DELETE_FLAG = '0' a.DELETE_FLAG = '0'
<include refid="tDispatchInfoPre_other_where"/> <include refid="tDispatchInfoPre_other_where"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment