Commit dd2e76e7 authored by huyuchen's avatar huyuchen

huych-档案更新优化

parent 93be0208
......@@ -636,112 +636,29 @@
<update id="updateExcelEmpProject" parameterType="java.util.List">
update t_employee_project
<trim prefix="set" suffixOverrides=",">
<trim prefix="EMP_LABEL =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.empLabel!=null">
when ID=#{i.id} then #{i.empLabel}
</if>
</foreach>
</trim>
<trim prefix="EMP_NATRUE =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.empNatrue!=null">
when ID=#{i.id} then #{i.empNatrue}
</if>
</foreach>
</trim>
<trim prefix="EMP_IDCARD =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.empIdcard!=null">
when ID=#{i.id} then #{i.empIdcard}
</if>
</foreach>
</trim>
<trim prefix="PROJECT_STATUS =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when ID=#{i.id} then 0
</foreach>
</trim>
<trim prefix="UPDATE_TIME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when ID=#{i.id} then now()
</foreach>
</trim>
<trim prefix="UPDATE_BY =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.updateBy!=null">
when ID=#{i.id} then #{i.updateBy}
</if>
</foreach>
</trim>
<trim prefix="DEPT_NO =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.deptNo!=null">
when ID=#{i.id} then #{i.deptNo}
</if>
</foreach>
</trim>
<trim prefix="CONTRACT_TYPE =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.contractType!=null">
when ID=#{i.id} then #{i.contractType}
</if>
</foreach>
</trim>
<trim prefix="WORKING_HOURS =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.workingHours!=null">
when ID=#{i.id} then #{i.workingHours}
</if>
</foreach>
</trim>
<trim prefix="POST =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.post!=null">
when ID=#{i.id} then #{i.post}
</if>
</foreach>
</trim>
<trim prefix="TRY_PERIOD =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.tryPeriod!=null">
when ID=#{i.id} then #{i.tryPeriod}
</if>
</foreach>
</trim>
<trim prefix="ENJOIN_DATE =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.enjoinDate!=null">
when ID=#{i.id} then #{i.enjoinDate}
</if>
</foreach>
</trim>
<trim prefix="BANK_NAME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.bankName!=null">
when ID=#{i.id} then #{i.bankName}
</if>
</foreach>
</trim>
<trim prefix="BANK_NO =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.bankNo!=null">
when ID=#{i.id} then #{i.bankNo}
</if>
</foreach>
</trim>
<trim prefix="BANK_SUB_NAME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.bankSubName!=null">
when ID=#{i.id} then #{i.bankSubName}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="i" index="index" >
ID=#{i.id}
<set>
<foreach collection="list" item="i" separator=",">
EMP_LABEL = COALESCE(#{i.empLabel}, EMP_LABEL),
EMP_NATRUE = COALESCE(#{i.empNatrue}, EMP_NATRUE),
EMP_IDCARD = COALESCE(#{i.empIdcard}, EMP_IDCARD),
PROJECT_STATUS = 0,
UPDATE_TIME = now(),
UPDATE_BY = COALESCE(#{i.updateBy}, UPDATE_BY),
DEPT_NO = COALESCE(#{i.deptNo}, DEPT_NO),
CONTRACT_TYPE = COALESCE(#{i.contractType}, CONTRACT_TYPE),
WORKING_HOURS = COALESCE(#{i.workingHours}, WORKING_HOURS),
POST = COALESCE(#{i.post}, POST),
TRY_PERIOD = COALESCE(#{i.tryPeriod}, TRY_PERIOD),
ENJOIN_DATE = COALESCE(#{i.enjoinDate}, ENJOIN_DATE),
BANK_NAME = COALESCE(#{i.bankName}, BANK_NAME),
BANK_NO = COALESCE(#{i.bankNo}, BANK_NO),
BANK_SUB_NAME = COALESCE(#{i.bankSubName}, BANK_SUB_NAME)
</foreach>
</set>
where id in
<foreach item="i" index="index" collection="list" open="("
separator="," close=")">
#{i.id}
</foreach>
</update>
<insert id="insertExcelEmpProject" parameterType="java.util.List">
......@@ -831,9 +748,10 @@
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="i" index="index" >
ID=#{i.id}
where id in
<foreach item="i" index="index" collection="list" open="("
separator="," close=")">
#{i.id}
</foreach>
</update>
<!--查询部门编码和最大员工数-->
......
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