Commit fd189a67 authored by huyuchen's avatar huyuchen

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

parent c3f85d4f
......@@ -403,7 +403,7 @@
AND a.IS_CREATE_DATE = #{tDispatchInfoPre.isCreateDate}
</if>
<if test="tDispatchInfoPre.contractStatus != null and tDispatchInfoPre.contractStatus.trim() != ''">
AND if(b.id is not null,'0','1') = #{tDispatchInfoPre.contractStatus}
AND if(b.EMP_IDCARD is not null,'0','1') = #{tDispatchInfoPre.contractStatus}
</if>
<if test="tDispatchInfoPre.failType != null and tDispatchInfoPre.failType.trim() != ''">
AND a.error_info is not null
......@@ -456,7 +456,7 @@
<include refid="Base_Column_List"/>
,if(b.EMP_IDCARD is not null,'0','1') as CONTRACT_STATUS,a.FUND_START_DATE
FROM t_dispatch_info_pre a
<!--huych:跨库查档案的合同表,因为需要查询合同的最新状态,合同表只用到身份证和项目编码和id三个字段,跨库查效率较高,如果后期改库需要调整这块代码-->
<!--huych:跨库建档案的合同视图,因为需要查询合同的最新状态,合同表只用到身份证和项目编码两个字段,跨库查效率较高,如果后期档案改库名需要调整这块代码-->
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where>
a.DELETE_FLAG = '0'
......@@ -493,7 +493,6 @@
SELECT
count(a.id)
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
<where>
1=1 and a.type_sub = '1'
and a.DELETE_FLAG = '0'
......
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