查询库存逻辑修改;

This commit is contained in:
王奎兴
2026-02-03 10:48:19 +08:00
parent 2c27ce7031
commit 2b0a582a5a
@@ -690,6 +690,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN material_base_info b on a.material_base_info_id = b.material_base_info_id
WHERE
a.del_flag = 1 AND b.shipper_id = #{shipperId} AND a.organization_id = #{organizationId}
AND TRUNC(a.EXT_ATTR_4) = TRUNC(#{extAttr4})
AND TRUNC(a.EXT_ATTR_3) = TRUNC(#{extAttr3})
AND TRUNC(a.inventory_date) = TRUNC(#{inventoryDate})
AND TRUNC(a.EXPIRY_DATE) = TRUNC(#{expiryDate})
AND TRUNC(a.PRODUCTION_DATE) = TRUNC(#{productionDate})
AND a.EXT_ATTR_2 = #{extAttr2}
AND a.EXT_ATTR_1 = #{extAttr1}
AND a.BOX_PALLET_NO = #{boxPalletNo}
AND a.SHEET_REF_NO = #{sheetRefNo}
AND a.BATCH_REF_NO = #{batchRefNo}
<if test="materialBaseInfoId != null and materialBaseInfoId != ''">
AND a.material_base_info_id = #{materialBaseInfoId}
</if>
@@ -702,36 +712,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="storageLocationId != null and storageLocationId != ''">
AND a.storage_location_id = #{storageLocationId}
</if>
<if test="extAttr4 != null">
AND TRUNC(a.EXT_ATTR_4) = TRUNC(#{extAttr4})
</if>
<if test="extAttr3 != null">
AND TRUNC(a.EXT_ATTR_3) = TRUNC(#{extAttr3})
</if>
<if test="inventoryDate != null">
AND TRUNC(a.inventory_date) = TRUNC(#{inventoryDate})
</if>
<if test="expiryDate != null">
AND TRUNC(a.EXPIRY_DATE) = TRUNC(#{expiryDate})
</if>
<if test="productionDate != null">
AND TRUNC(a.PRODUCTION_DATE) = TRUNC(#{productionDate})
</if>
<if test="extAttr2 != null and extAttr2 != ''">
AND a.EXT_ATTR_2 = #{extAttr2}
</if>
<if test="extAttr1 != null and extAttr1 != ''">
AND a.EXT_ATTR_1 = #{extAttr1}
</if>
<if test="boxPalletNo != null and boxPalletNo != ''">
AND a.BOX_PALLET_NO = #{boxPalletNo}
</if>
<if test="sheetRefNo != null and sheetRefNo != ''">
AND a.SHEET_REF_NO = #{sheetRefNo}
</if>
<if test="batchRefNo != null and batchRefNo != ''">
AND a.BATCH_REF_NO = #{batchRefNo}
</if>
</select>
<!-- 根据库存ID查询库存信息(包含批次属性字段) -->