2026-03-18 11:24:49 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
|
|
<mapper namespace="top.wms.admin.materialProcess.mapper.MaterialProcessMapper">
|
2026-03-20 18:06:45 +08:00
|
|
|
<!-- 按流程名称批量更新 -->
|
|
|
|
|
<update id="updateByName">
|
|
|
|
|
UPDATE sys_material_process
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="list != null and list.size() > 0">
|
|
|
|
|
process_code = CASE
|
|
|
|
|
<foreach collection="list" item="item" separator="">
|
|
|
|
|
<if test="item.processCode != null and item.processCode != ''">
|
|
|
|
|
WHEN process_name = #{item.processName} THEN #{item.processCode}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
ELSE process_code
|
|
|
|
|
END,
|
|
|
|
|
update_user = CASE
|
|
|
|
|
<foreach collection="list" item="item" separator="">
|
|
|
|
|
<if test="item.updateUser != null">
|
|
|
|
|
WHEN process_name = #{item.processName} THEN #{item.updateUser}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
ELSE update_user
|
|
|
|
|
END,
|
|
|
|
|
update_time = NOW()
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE process_name IN
|
|
|
|
|
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
|
|
|
|
#{item.processName}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateByCode">
|
|
|
|
|
UPDATE sys_material_process
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="list != null and list.size() > 0">
|
|
|
|
|
process_name = CASE
|
|
|
|
|
<foreach collection="list" item="item" separator="">
|
|
|
|
|
<if test="item.processName != null and item.processName != ''">
|
|
|
|
|
WHEN process_code = #{item.processCode} THEN #{item.processName}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
ELSE process_name
|
|
|
|
|
END,
|
|
|
|
|
update_user = CASE
|
|
|
|
|
<foreach collection="list" item="item" separator="">
|
|
|
|
|
<if test="item.updateUser != null">
|
|
|
|
|
WHEN process_code = #{item.processCode} THEN #{item.updateUser}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
ELSE update_user
|
|
|
|
|
END,
|
|
|
|
|
update_time = NOW()
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE process_code IN
|
|
|
|
|
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
|
|
|
|
#{item.processCode}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
2026-04-03 16:52:21 +08:00
|
|
|
|
|
|
|
|
<select id="getCodeByMaterial" resultType="java.lang.String">
|
|
|
|
|
SELECT process_code
|
|
|
|
|
FROM sys_material_process p
|
|
|
|
|
left join sys_material_info m on p.id = m.material_process_id
|
|
|
|
|
WHERE m.encoding = #{materialCode}
|
|
|
|
|
</select>
|
2026-03-18 11:24:49 +08:00
|
|
|
</mapper>
|