From d9e3b7cf2a3fffb2cacda472449319481a76a9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Wed, 8 Apr 2026 15:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=89=A9=E6=96=99=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E6=95=B0=E9=87=8F;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/po/MaterialBaseInfoPO.java | 4 +- .../MaterialBaseInfoMapper.xml | 82 ++++++++++--------- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java index af30f5168..251b3bf5d 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java @@ -242,5 +242,7 @@ public class MaterialBaseInfoPO extends BaseVOEntity { @ApiModelProperty("临期预警数量") @Excel(name = "临期预警数量") private Integer expirationWarningCount; + //库存件数 + private BigDecimal stockQuantity; -} +} \ No newline at end of file diff --git a/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml b/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml index 1b90257ed..90ee2a554 100644 --- a/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml +++ b/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml @@ -60,7 +60,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select material_base_info_id, organization_id, organization_name, top_organization_id, shipper_id, shipper_code, shipper_name, material_code, material_name, bar_code, material_classify_code, material_classify_name, material_type, material_type_name, pack_id, pack_code, pack_name, unit_code, unit_name, brand_id, brand_code, brand_name, shelf_life, weight_limit, volume_limit, material_shape, material_shape_name, material_size, material_length, material_width, material_height, remark, nullify, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag, common, sku_code, unit_price, currency, origin_country, hs_code, declaration_unit, statutory_unit, statutory_second_unit, specification_model as specification_model from material_base_info + select a.material_base_info_id, a.organization_id, a.organization_name, a.top_organization_id, a.shipper_id, a.shipper_code, a.shipper_name, a.material_code, a.material_name, a.bar_code, a.material_classify_code, + material_classify_name, a.material_type, a.material_type_name, a.pack_id, a.pack_code, a.pack_name, a.unit_code, a.unit_name, a.brand_id, a.brand_code, a.brand_name, a.shelf_life, a.weight_limit, a.volume_limit, a.material_shape, + material_shape_name, a.material_size, a.material_length, a.material_width, a.material_height, a.remark, a.nullify, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.common, + sku_code, a.unit_price, a.currency, a.origin_country, a.hs_code, a.declaration_unit, a.statutory_unit, a.statutory_second_unit, + specification_model as specification_model,sum(b.INVENTORY_QUANTITY) as inventoryQuantity from material_base_info a left join MATERIAL_INVENTORY b on a.material_base_info_id = b.material_base_info_id @@ -84,114 +88,114 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - and organization_id = #{organizationId} + and a.organization_id = #{organizationId} - and material_base_info_id = #{materialBaseInfoId} + and a.material_base_info_id = #{materialBaseInfoId} - and organization_name like concat('%', #{organizationName}, '%') + and a.organization_name like concat('%', #{organizationName}, '%') - and top_organization_id = #{topOrganizationId} + and a.top_organization_id = #{topOrganizationId} - and shipper_id = #{shipperId} + and a.shipper_id = #{shipperId} - and shipper_code like concat('%', #{shipperCode}, '%') + and a.shipper_code like concat('%', #{shipperCode}, '%') - and shipper_name like concat('%', #{shipperName}, '%') + and a.shipper_name like concat('%', #{shipperName}, '%') - and material_code like concat('%', #{materialCode}, '%') + and a.material_code like concat('%', #{materialCode}, '%') - and material_name like concat('%', #{materialName}, '%') + and a.material_name like concat('%', #{materialName}, '%') - and unit_name like concat('%', #{unitName}, '%') + and a.unit_name like concat('%', #{unitName}, '%') - and bar_code like concat('%',#{barCode},'%') + and a.bar_code like concat('%',#{barCode},'%') - FIND_IN_SET(#{code}, material_classify_code) > 0 + FIND_IN_SET(#{code}, a.material_classify_code) > 0 - material_classify_name like concat('%', #{name}, '%') + a.material_classify_name like concat('%', #{name}, '%') - and material_type = #{materialType} + and a.material_type = #{materialType} - and material_type_name like concat('%', #{materialTypeName}, '%') + and a.material_type_name like concat('%', #{materialTypeName}, '%') - and pack_id = #{packId} + and a.pack_id = #{packId} - and pack_code = #{packCode} + and a.pack_code = #{packCode} - and pack_name like concat('%', #{packName}, '%') + and a.pack_name like concat('%', #{packName}, '%') - and brand_id = #{brandId} + and a.brand_id = #{brandId} - and brand_code = #{brandCode} + and a.brand_code = #{brandCode} - and brand_name like concat('%', #{brandName}, '%') + and a.brand_name like concat('%', #{brandName}, '%') - and shelf_life = #{shelfLife} + and a.shelf_life = #{shelfLife} - and weight_limit = #{weightLimit} + and a.weight_limit = #{weightLimit} - and volume_limit = #{volumeLimit} + and a.volume_limit = #{volumeLimit} - and material_shape = #{materialShape} + and a.material_shape = #{materialShape} - and material_shape_name like concat('%', #{materialShapeName}, '%') + and a.material_shape_name like concat('%', #{materialShapeName}, '%') - and material_size = #{materialSize} + and a.material_size = #{materialSize} - and material_length = #{materialLength} + and a.material_length = #{materialLength} - and material_width = #{materialWidth} + and a.material_width = #{materialWidth} - and material_height = #{materialHeight} + and a.material_height = #{materialHeight} - and nullify = #{nullify} + and a.nullify = #{nullify} - and create_by_name like concat('%', #{createByName}, '%') + and a.create_by_name like concat('%', #{createByName}, '%') - and update_by_name like concat('%', #{updateByName}, '%') + and a.update_by_name like concat('%', #{updateByName}, '%') - and ( instr(material_name, #{compoundOrQuery}) > 0 + and ( instr(a.material_name, #{compoundOrQuery}) > 0 or - instr(material_code, #{compoundOrQuery}) > 0 + instr(a.material_code, #{compoundOrQuery}) > 0 or - instr(bar_code, #{compoundOrQuery}) > 0 + instr(a.bar_code, #{compoundOrQuery}) > 0 ) @@ -210,8 +214,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" or common = 1 ) - and del_flag = #{delFlag} - and del_flag = 1 + and a.del_flag = #{delFlag} + and a.del_flag = 1