This commit is contained in:
2026-03-04 18:01:13 +08:00
parent 15af775af4
commit 97df87eb06
20 changed files with 608 additions and 156 deletions

View File

@@ -1,4 +1,52 @@
<?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.material.mapper.MaterialInfoMapper">
<!-- 按物料名称批量更新 -->
<update id="updateByName">
<foreach collection="list" item="item" separator=";">
UPDATE sys_material_info
SET
<if test="item.encoding != null and item.encoding != ''" >
encoding = #{item.encoding},
</if>
<if test="item.unitWeight != null">
unit_weight = #{item.unitWeight},
</if>
<if test="item.materialSpec != null and item.materialSpec != ''">
material_spec = #{item.materialSpec},
</if>
<if test="item.updateTime != null">
update_time = NOW(),
</if>
<if test="item.updateUser != null and item.updateUser != ''">
update_user = #{item.updateUser}
</if>
WHERE material_name = #{item.materialName}
</foreach>
</update>
<update id="updateByCode">
<foreach collection="list" item="item" separator=";">
UPDATE sys_material_info
SET
<if test="item.materialName != null and item.materialName != ''">
material_name = #{item.materialName},
</if>
<if test="item.unitWeight != null">
unit_weight = #{item.unitWeight},
</if>
<if test="item.materialSpec != null and item.materialSpec != ''">
material_spec = #{item.materialSpec},
</if>
<if test="item.updateTime != null">
update_time = NOW(),
</if>
<if test="item.updateUser != null and item.updateUser != ''">
update_user = #{item.updateUser}
</if>
WHERE encoding = #{item.encoding}
</foreach>
</update>
</mapper>

View File

@@ -1,21 +0,0 @@
<?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.system.mapper.RuleRelationMapper">
<delete id="deleteByRuleId" parameterType="top.wms.admin.system.model.entity.RuleRelationDO">
DELETE FROM equipment_rule_relation
WHERE 1=1
<!-- 判空规则:字段不为 null 且 不为空字符串(兼容字符串/数字类型) -->
<if test="ruleId != null and ruleId != ''">
AND rule_id = #{ruleId}
</if>
<if test="equipmentId != null and equipmentId != ''">
AND equipment_id = #{equipmentId}
</if>
<if test="equipmentRuleId != null and equipmentRuleId != ''">
AND equipment_rule_id = #{equipmentRuleId}
</if>
</delete>
</mapper>