Commit f416ab09 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.9' into MVP1.7.9

parents 17420ab6 ec245151
...@@ -710,47 +710,20 @@ ...@@ -710,47 +710,20 @@
</insert> </insert>
<update id="updateReduceEmpProject" parameterType="java.util.List"> <update id="updateReduceEmpProject" parameterType="java.util.List">
update t_employee_project update t_employee_project
<trim prefix="set" suffixOverrides=","> <set>
<trim prefix="EMP_LABEL =case" suffix="end,"> <foreach collection="list" item="i" separator=",">
<foreach collection="list" item="i" index="index"> EMP_LABEL = COALESCE(#{i.empLabel}, EMP_LABEL),
when ID=#{i.id} then #{i.empLabel} PROJECT_STATUS = 1,
</foreach> LEAVE_TIME = now(),
</trim> LEAVE_REASON = COALESCE(#{i.leaveReason}, LEAVE_REASON),
<trim prefix="LEAVE_TIME =case" suffix="end,"> LEAVE_USER = COALESCE(#{i.leaveUser}, LEAVE_USER),
<foreach collection="list" item="i" index="index"> LEAVE_REMARK = COALESCE(#{i.leaveRemark}, LEAVE_REMARK)
when ID=#{i.id} then now()
</foreach>
</trim>
<trim prefix="LEAVE_REASON =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.leaveReason!=null">
when ID=#{i.id} then #{i.leaveReason}
</if>
</foreach>
</trim>
<trim prefix="LEAVE_USER =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.leaveUser!=null">
when ID=#{i.id} then #{i.leaveUser}
</if>
</foreach>
</trim>
<trim prefix="LEAVE_REMARK =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.leaveRemark!=null">
when ID=#{i.id} then #{i.leaveRemark}
</if>
</foreach>
</trim>
<trim prefix="PROJECT_STATUS =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when ID=#{i.id} then 1
</foreach> </foreach>
</trim> </set>
</trim> where id in
where <foreach item="i" index="index" collection="list" open="("
<foreach collection="list" separator="or" item="i" index="index" > separator="," close=")">
ID=#{i.id} #{i.id}
</foreach> </foreach>
</update> </update>
<!--查询部门编码和最大员工数--> <!--查询部门编码和最大员工数-->
......
...@@ -233,58 +233,21 @@ ...@@ -233,58 +233,21 @@
<update id="batchUpdateUser" parameterType="java.util.List"> <update id="batchUpdateUser" parameterType="java.util.List">
update sys_user update sys_user
<trim prefix="set" suffixOverrides=","> <set>
<trim prefix="phone =case" suffix="end,"> <foreach collection="list" item="i" separator=",">
<foreach collection="list" item="i" index="index"> phone = COALESCE(#{i.telephoneNumber}, phone),
<if test="i.telephoneNumber!=null"> update_time = now(),
when username=#{i.uid} then #{i.telephoneNumber} email = COALESCE(#{i.email}, email),
</if> nickname = COALESCE(#{i.personName}, nickname),
</foreach> password = COALESCE(#{i.password}, password),
</trim> dept_id = COALESCE(#{i.deptId}, dept_id),
<trim prefix="email =case" suffix="end,"> dept_name = COALESCE(#{i.deptName}, dept_name)
<foreach collection="list" item="i" index="index">
<if test="i.email!=null">
when username=#{i.uid} then #{i.email}
</if>
</foreach>
</trim>
<trim prefix="nickname =case" suffix="end," >
<foreach collection="list" item="i" index="index">
<if test="i.personName!=null">
when username=#{i.uid} then #{i.personName}
</if>
</foreach> </foreach>
</trim> </set>
<trim prefix="password =case" suffix="end," > where username in
<foreach collection="list" item="i" index="index"> <foreach item="i" index="index" collection="list" open="("
<if test="i.password!=null"> separator="," close=")">
when username=#{i.uid} then #{i.password} #{i.uid}
</if>
</foreach>
</trim>
<trim prefix="update_time =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when username=#{i.uid} then now()
</foreach>
</trim>
<trim prefix="dept_id =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.deptId!=null">
when username=#{i.uid} then #{i.deptId}
</if>
</foreach>
</trim>
<trim prefix="dept_name =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.deptName!=null">
when username=#{i.uid} then #{i.deptName}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="i" index="index" >
username=#{i.uid}
</foreach> </foreach>
</update> </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