update 修改框架中批量接口,改为原生mybatis执行foreach,改善性能

This commit is contained in:
朱杰
2021-05-31 17:23:13 +08:00
committed by 疯狂的狮子li
parent 079dc12fe1
commit 90063ad03c
13 changed files with 98 additions and 17 deletions

View File

@@ -57,4 +57,17 @@
order by d.parent_id, d.order_num
</select>
<update id="updateDeptChildren" parameterType="java.util.List">
update sys_dept set ancestors =
<foreach collection="depts" item="item" index="index"
separator=" " open="case dept_id" close="end">
when #{item.deptId} then #{item.ancestors}
</foreach>
where dept_id in
<foreach collection="depts" item="item" index="index"
separator="," open="(" close=")">
#{item.deptId}
</foreach>
</update>
</mapper>