入库管理收货、上架数量修改

This commit is contained in:
秦鸿展
2026-01-28 09:51:58 +08:00
parent 0738c939ae
commit 00dacdae19
7 changed files with 230 additions and 128 deletions
@@ -53,8 +53,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<sql id="JoinMaterialBaseInfoPo">
,b.shipper_id, b.shipper_code, b.shipper_name, b.material_code, b.material_name, b.bar_code, b.material_classify_code, b.material_classify_name,
b.material_type, b.material_type_name, b.common
<!-- 注意:物料基础信息表中的货主字段统一使用别名,避免与主表中的 shipper_id/shipper_code/shipper_name 冲突 -->
,b.shipper_id AS base_shipper_id,
b.shipper_code AS base_shipper_code,
b.shipper_name AS base_shipper_name,
b.material_code,
b.material_name,
b.bar_code,
b.material_classify_code,
b.material_classify_name,
b.material_type,
b.material_type_name,
b.common
</sql>
<sql id="selectMaterialBaseInfoPo1">
@@ -175,41 +185,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<sql id="JoinMaterialBaseInfoPoWhere">
<!-- 该片段总是在物料基础信息表使用别名 b 时被 include,例如:
FROM ... LEFT JOIN material_base_info b ON ...
因此这里所有列名都加上 b. 前缀以避免和主表列名歧义 -->
<if test="shipperId != null ">
and shipper_id = #{shipperId}
and b.shipper_id = #{shipperId}
</if>
<if test="shipperCode != null and shipperCode != ''">
and shipper_code like concat('%', #{shipperCode}, '%')
and b.shipper_code like concat('%', #{shipperCode}, '%')
</if>
<if test="shipperName != null and shipperName != ''">
and shipper_name like concat('%', #{shipperName}, '%')
and b.shipper_name like concat('%', #{shipperName}, '%')
</if>
<if test="materialCode != null and materialCode != ''">
and material_code = #{materialCode}
and b.material_code = #{materialCode}
</if>
<if test="materialName != null and materialName != ''">
and material_name like concat('%', #{materialName}, '%')
and b.material_name like concat('%', #{materialName}, '%')
</if>
<if test="barCode != null and barCode != ''">
and bar_code = #{barCode}
and b.bar_code = #{barCode}
</if>
<if test="materialClassifyCode != null and materialClassifyCode != ''">
and material_classify_code = #{materialClassifyCode}
and b.material_classify_code = #{materialClassifyCode}
</if>
<if test="materialClassifyName != null and materialClassifyName != ''">
and material_classify_name like concat('%', #{materialClassifyName}, '%')
and b.material_classify_name like concat('%', #{materialClassifyName}, '%')
</if>
<if test="materialType != null and materialType != ''">
and material_type = #{materialType}
and b.material_type = #{materialType}
</if>
<if test="materialTypeName != null and materialTypeName != ''">
and material_type_name like concat('%', #{materialTypeName}, '%')
and b.material_type_name like concat('%', #{materialTypeName}, '%')
</if>
<if test="shipperInfo != null and shipperInfo != ''">
and (shipper_code like concat('%', #{shipperInfo}, '%') or shipper_name like concat('%', #{shipperInfo}, '%'))
and (b.shipper_code like concat('%', #{shipperInfo}, '%') or b.shipper_name like concat('%', #{shipperInfo}, '%'))
</if>
<if test="materialInfo != null and materialInfo != ''">
and (material_code = #{materialInfo} or material_name like concat('%', #{materialInfo}, '%') or bar_code = #{materialInfo})
and (b.material_code = #{materialInfo} or b.material_name like concat('%', #{materialInfo}, '%') or b.bar_code = #{materialInfo})
</if>
</sql>