|
@@ -309,4 +309,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<update id="clearInvByLocationId">
|
|
|
delete from inv_lot_loc_id where location_id = #{locationId}
|
|
|
</update>
|
|
|
+
|
|
|
+ <select id="queryInvBySku" resultType="double">
|
|
|
+ select
|
|
|
+ count(inv.qty) qty
|
|
|
+ from inv_lot_loc_id inv
|
|
|
+ left join inv_lot_att att on inv.lotnum = att.lotnum
|
|
|
+ left join base_location_info b on inv.location_id = b.id
|
|
|
+ left join base_sku sk on inv.sku = sk.sku
|
|
|
+ left join base_sku_type skt on sk.sku_type = skt.item_code
|
|
|
+ left join base_location_zone bz on b.zone_id = bz.zone_id
|
|
|
+ <where>
|
|
|
+ <if test="sku != null and sku != ''"> and sk.sku = #{sku}</if>
|
|
|
+ <if test="lotattDTO.lotatt01 != null and lotattDTO.lotatt01 != ''"> and att.lotatt01 = #{lotattDTO.lotatt01}</if>
|
|
|
+ <if test="lotattDTO.lotatt02 != null and lotattDTO.lotatt02 != ''"> and att.lotatt02 = #{lotattDTO.lotatt02}</if>
|
|
|
+ <if test="lotattDTO.lotatt03 != null and lotattDTO.lotatt03 != ''"> and att.lotatt03 = #{lotattDTO.lotatt03}</if>
|
|
|
+ <if test="lotattDTO.lotatt04 != null and lotattDTO.lotatt04 != ''"> and att.lotatt04 = #{lotattDTO.lotatt04}</if>
|
|
|
+ <if test="lotattDTO.lotatt05 != null and lotattDTO.lotatt05 != ''"> and att.lotatt05 = #{lotattDTO.lotatt05}</if>
|
|
|
+ <if test="lotattDTO.lotatt06 != null and lotattDTO.lotatt06 != ''"> and att.lotatt06 = #{lotattDTO.lotatt06}</if>
|
|
|
+ <if test="lotattDTO.lotatt07 != null and lotattDTO.lotatt07 != ''"> and att.lotatt07 = #{lotattDTO.lotatt07}</if>
|
|
|
+ <if test="lotattDTO.lotatt08 != null and lotattDTO.lotatt08 != ''"> and att.lotatt08 = #{lotattDTO.lotatt08}</if>
|
|
|
+ <if test="lotattDTO.lotatt09 != null and lotattDTO.lotatt09 != ''"> and att.lotatt09 = #{lotattDTO.lotatt09}</if>
|
|
|
+ <if test="lotattDTO.lotatt10 != null and lotattDTO.lotatt10 != ''"> and att.lotatt10 = #{lotattDTO.lotatt10}</if>
|
|
|
+ <if test="lotattDTO.lotatt11 != null and lotattDTO.lotatt11 != ''"> and att.lotatt11 = #{lotattDTO.lotatt11}</if>
|
|
|
+ <if test="lotattDTO.lotatt12 != null and lotattDTO.lotatt12 != ''"> and att.lotatt12 = #{lotattDTO.lotatt12}</if>
|
|
|
+ <if test="lotattDTO.lotatt13 != null and lotattDTO.lotatt13 != ''"> and att.lotatt13 = #{lotattDTO.lotatt13}</if>
|
|
|
+ <if test="lotattDTO.lotatt14 != null and lotattDTO.lotatt14 != ''"> and att.lotatt14 = #{lotattDTO.lotatt14}</if>
|
|
|
+ <if test="lotattDTO.lotatt15 != null and lotattDTO.lotatt15 != ''"> and att.lotatt15 = #{lotattDTO.lotatt15}</if>
|
|
|
+ <if test="lotattDTO.lotatt16 != null and lotattDTO.lotatt16 != ''"> and att.lotatt16 = #{lotattDTO.lotatt16}</if>
|
|
|
+ <if test="lotattDTO.lotatt17 != null and lotattDTO.lotatt17 != ''"> and att.lotatt17 = #{lotattDTO.lotatt17}</if>
|
|
|
+ <if test="lotattDTO.lotatt18 != null and lotattDTO.lotatt18 != ''"> and att.lotatt18 = #{lotattDTO.lotatt18}</if>
|
|
|
+ </where>
|
|
|
+ and bz.userdefine1 = 'INV'
|
|
|
+ </select>
|
|
|
</mapper>
|