|
|
|
|
@ -39,87 +39,29 @@ |
|
|
|
|
<select id="queryList" resultType="com.shkj.wms.vo.BusinStockInvVo" |
|
|
|
|
parameterType="com.shkj.wms.bo.BusinStockInvQueryBo"> |
|
|
|
|
SELECT |
|
|
|
|
g.good_no, |
|
|
|
|
g.good_name, |
|
|
|
|
g.specifications, |
|
|
|
|
g.storage_classify, |
|
|
|
|
g.storage_conditions, |
|
|
|
|
g.abc_classify, |
|
|
|
|
c.consignor_code, |
|
|
|
|
c.consignor_name, |
|
|
|
|
si.quantity AS qty, |
|
|
|
|
a.taskmode, |
|
|
|
|
bp.package_qty, |
|
|
|
|
bp.waster, |
|
|
|
|
bp.factory, |
|
|
|
|
bp.unit, |
|
|
|
|
b.batch_no, |
|
|
|
|
b.production_date, |
|
|
|
|
b.expired_date, |
|
|
|
|
l.location_code, |
|
|
|
|
l.location_name, |
|
|
|
|
l.location_group, |
|
|
|
|
b.batch_no, |
|
|
|
|
bs.storage_name, |
|
|
|
|
a.area_code, |
|
|
|
|
si.* |
|
|
|
|
si.id as invId, loc.id as locationId,loc.location_code,goods.vehiche_model,goods.color,loc.location_status,count(stock.id) goodQty |
|
|
|
|
FROM |
|
|
|
|
busin_stock_inv si |
|
|
|
|
JOIN base_goods g ON si.good_id = g.id |
|
|
|
|
JOIN base_consignor c ON si.consignor_id = c.id |
|
|
|
|
JOIN base_location l ON si.location_id = l.id |
|
|
|
|
JOIN sys_batch b ON b.id = si.batch_id |
|
|
|
|
JOIN base_package bp ON bp.id = b.package_id |
|
|
|
|
JOIN base_area a ON l.area_id = a.id |
|
|
|
|
JOIN base_storage bs ON a.storage_id = bs.id |
|
|
|
|
WHERE g.is_del = 0 AND l.is_del = 0 |
|
|
|
|
<if test="orderType!=null and orderType!=''"> |
|
|
|
|
and si.order_type=#{orderType} |
|
|
|
|
</if> |
|
|
|
|
<if test="inProgress!=null"> |
|
|
|
|
and si.inv_status not in('end','cancel') |
|
|
|
|
</if> |
|
|
|
|
JOIN base_location loc ON si.location_id = loc.id |
|
|
|
|
left join sys_stock_detail stock on stock.location_id=loc.id |
|
|
|
|
left join base_goods_data goods ON stock.goods_no =goods.goods_no |
|
|
|
|
<if test="invStatus != null and invStatus != ''"> |
|
|
|
|
and si.inv_status = #{invStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="diffStatus != null and diffStatus != ''"> |
|
|
|
|
and si.diff_status = #{diffStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="invWay != null and invWay != ''"> |
|
|
|
|
and si.inv_way = #{invWay} |
|
|
|
|
</if> |
|
|
|
|
<if test="goodId!=null and goodId!=''"> |
|
|
|
|
and si.good_id=#{goodId} |
|
|
|
|
<if test="tunnel != null and tunnel != ''"> |
|
|
|
|
AND loc.tunnel = #{tunnel} |
|
|
|
|
</if> |
|
|
|
|
<if test="goodIdsList!=null"> |
|
|
|
|
and si.good_id in |
|
|
|
|
<foreach collection="goodIdsList" item="goodId" open="(" separator="," close=")"> |
|
|
|
|
#{goodId} |
|
|
|
|
</foreach> |
|
|
|
|
<if test="locationRow != null and locationRow != ''"> |
|
|
|
|
AND loc.location_row = #{locationRow} |
|
|
|
|
</if> |
|
|
|
|
<if test="invOrderNo != null and invOrderNo != ''"> |
|
|
|
|
and si.inv_order_no like concat('%', #{invOrderNo},'%') |
|
|
|
|
<if test="locationColumn != null and locationColumn != ''"> |
|
|
|
|
AND loc.location_column = #{locationColumn} |
|
|
|
|
</if> |
|
|
|
|
<if test="locationCode != null and locationCode != ''"> |
|
|
|
|
AND ( |
|
|
|
|
l.location_code LIKE CONCAT('%', #{locationCode}, '%') |
|
|
|
|
OR l.location_name LIKE CONCAT('%', #{locationCode}, '%') |
|
|
|
|
) |
|
|
|
|
<if test="layer !=null and layer !='' "> |
|
|
|
|
and loc.layer=#{layer} |
|
|
|
|
</if> |
|
|
|
|
<if test="goodCode!=null and goodCode!=''"> |
|
|
|
|
AND ( |
|
|
|
|
g.good_no LIKE CONCAT('%', #{goodCode}, '%') |
|
|
|
|
OR g.good_name LIKE CONCAT('%', #{goodCode}, '%') |
|
|
|
|
) |
|
|
|
|
</if> |
|
|
|
|
<if test="execTime!=null"> |
|
|
|
|
and si.exec_time>=#{execTime} |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="endTime!=null"> |
|
|
|
|
and si.end_time<=#{endTime} |
|
|
|
|
</if> |
|
|
|
|
${consignorParams.dataScopeConsignor} |
|
|
|
|
group by si.id,loc.id,loc.location_code,goods.vehiche_model,goods.color,loc.location_status |
|
|
|
|
ORDER BY loc.route |
|
|
|
|
</select> |
|
|
|
|
<select id="queryListByGoodsGroup" resultType="com.shkj.wms.vo.BusinStockInvVo" |
|
|
|
|
parameterType="com.shkj.wms.bo.BusinStockInvQueryBo"> |
|
|
|
|
|