查询物料库存数量;
This commit is contained in:
+3
-1
@@ -242,5 +242,7 @@ public class MaterialBaseInfoPO extends BaseVOEntity {
|
||||
@ApiModelProperty("临期预警数量")
|
||||
@Excel(name = "临期预警数量")
|
||||
private Integer expirationWarningCount;
|
||||
//库存件数
|
||||
private BigDecimal stockQuantity;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
|
||||
<sql id="selectMaterialBaseInfoPo">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<sql id="JoinMaterialBaseInfoPo">
|
||||
@@ -84,114 +88,114 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<sql id="selectMaterialBaseInfoPo1">
|
||||
<where>
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="materialBaseInfoId != null and materialBaseInfoId != ''">
|
||||
and material_base_info_id = #{materialBaseInfoId}
|
||||
and a.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and organization_name like concat('%', #{organizationName}, '%')
|
||||
and a.organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and shipper_id = #{shipperId}
|
||||
and a.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="shipperCode != null and shipperCode != ''">
|
||||
and shipper_code like concat('%', #{shipperCode}, '%')
|
||||
and a.shipper_code like concat('%', #{shipperCode}, '%')
|
||||
</if>
|
||||
<if test="shipperName != null and shipperName != ''">
|
||||
and shipper_name like concat('%', #{shipperName}, '%')
|
||||
and a.shipper_name like concat('%', #{shipperName}, '%')
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and material_code like concat('%', #{materialCode}, '%')
|
||||
and a.material_code like concat('%', #{materialCode}, '%')
|
||||
</if>
|
||||
<if test="materialName != null and materialName != ''">
|
||||
and material_name like concat('%', #{materialName}, '%')
|
||||
and a.material_name like concat('%', #{materialName}, '%')
|
||||
</if>
|
||||
<if test="unitName != null and unitName != ''">
|
||||
and unit_name like concat('%', #{unitName}, '%')
|
||||
and a.unit_name like concat('%', #{unitName}, '%')
|
||||
</if>
|
||||
<if test="barCode != null and barCode != ''">
|
||||
and bar_code like concat('%',#{barCode},'%')
|
||||
and a.bar_code like concat('%',#{barCode},'%')
|
||||
</if>
|
||||
<if test="materialClassifyCode != null and materialClassifyCode.size() > 0">
|
||||
<foreach collection="materialClassifyCode" item="code" open="and (" separator="or" close=")">
|
||||
FIND_IN_SET(#{code}, material_classify_code) > 0
|
||||
FIND_IN_SET(#{code}, a.material_classify_code) > 0
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="materialClassifyName != null and materialClassifyName.size() > 0">
|
||||
<foreach collection="materialClassifyName" item="name" open="and (" separator="or" close=")">
|
||||
material_classify_name like concat('%', #{name}, '%')
|
||||
a.material_classify_name like concat('%', #{name}, '%')
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="materialType != null and materialType != ''">
|
||||
and material_type = #{materialType}
|
||||
and a.material_type = #{materialType}
|
||||
</if>
|
||||
<if test="materialTypeName != null and materialTypeName != ''">
|
||||
and material_type_name like concat('%', #{materialTypeName}, '%')
|
||||
and a.material_type_name like concat('%', #{materialTypeName}, '%')
|
||||
</if>
|
||||
<if test="packId != null ">
|
||||
and pack_id = #{packId}
|
||||
and a.pack_id = #{packId}
|
||||
</if>
|
||||
<if test="packCode != null and packCode != ''">
|
||||
and pack_code = #{packCode}
|
||||
and a.pack_code = #{packCode}
|
||||
</if>
|
||||
<if test="packName != null and packName != ''">
|
||||
and pack_name like concat('%', #{packName}, '%')
|
||||
and a.pack_name like concat('%', #{packName}, '%')
|
||||
</if>
|
||||
<if test="brandId != null ">
|
||||
and brand_id = #{brandId}
|
||||
and a.brand_id = #{brandId}
|
||||
</if>
|
||||
<if test="brandCode != null and brandCode != ''">
|
||||
and brand_code = #{brandCode}
|
||||
and a.brand_code = #{brandCode}
|
||||
</if>
|
||||
<if test="brandName != null and brandName != ''">
|
||||
and brand_name like concat('%', #{brandName}, '%')
|
||||
and a.brand_name like concat('%', #{brandName}, '%')
|
||||
</if>
|
||||
<if test="shelfLife != null ">
|
||||
and shelf_life = #{shelfLife}
|
||||
and a.shelf_life = #{shelfLife}
|
||||
</if>
|
||||
<if test="weightLimit != null ">
|
||||
and weight_limit = #{weightLimit}
|
||||
and a.weight_limit = #{weightLimit}
|
||||
</if>
|
||||
<if test="volumeLimit != null ">
|
||||
and volume_limit = #{volumeLimit}
|
||||
and a.volume_limit = #{volumeLimit}
|
||||
</if>
|
||||
<if test="materialShape != null and materialShape != ''">
|
||||
and material_shape = #{materialShape}
|
||||
and a.material_shape = #{materialShape}
|
||||
</if>
|
||||
<if test="materialShapeName != null and materialShapeName != ''">
|
||||
and material_shape_name like concat('%', #{materialShapeName}, '%')
|
||||
and a.material_shape_name like concat('%', #{materialShapeName}, '%')
|
||||
</if>
|
||||
<if test="materialSize != null and materialSize != ''">
|
||||
and material_size = #{materialSize}
|
||||
and a.material_size = #{materialSize}
|
||||
</if>
|
||||
<if test="materialLength != null ">
|
||||
and material_length = #{materialLength}
|
||||
and a.material_length = #{materialLength}
|
||||
</if>
|
||||
<if test="materialWidth != null ">
|
||||
and material_width = #{materialWidth}
|
||||
and a.material_width = #{materialWidth}
|
||||
</if>
|
||||
<if test="materialHeight != null ">
|
||||
and material_height = #{materialHeight}
|
||||
and a.material_height = #{materialHeight}
|
||||
</if>
|
||||
<if test="nullify != null ">
|
||||
and nullify = #{nullify}
|
||||
and a.nullify = #{nullify}
|
||||
</if>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
and a.create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
and a.update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<if test="compoundOrQuery != null and compoundOrQuery != ''">
|
||||
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
|
||||
)
|
||||
</if>
|
||||
<if test="batchId != null">
|
||||
@@ -210,8 +214,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
or common = 1 )</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="delFlag != null"> and del_flag = #{delFlag} </when>
|
||||
<otherwise> and del_flag = 1 </otherwise>
|
||||
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
||||
<otherwise> and a.del_flag = 1 </otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
Reference in New Issue
Block a user