|
|
|
@ -13,4 +13,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
where
|
|
|
|
|
x.material_id = #{entity.materialId}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="listInventoryAlarm" resultType="org.dromara.wms.domain.vo.WmsInventoryVo"
|
|
|
|
|
parameterType="org.dromara.wms.domain.bo.WmsInventoryBo">
|
|
|
|
|
SELECT
|
|
|
|
|
x.material_id,
|
|
|
|
|
SUM(x.inventory_qty) inventory_qty,
|
|
|
|
|
x.warehouse_id,
|
|
|
|
|
MAX(b.min_stock_amount) min_stock_amount,
|
|
|
|
|
MAX(b.max_stock_amount) max_stock_amount,
|
|
|
|
|
MAX(c.warehouse_code) warehouse_code,
|
|
|
|
|
MAX(d.material_code) material_code,
|
|
|
|
|
MAX(x.lock_state) lock_state,
|
|
|
|
|
MAX(x.inventory_status) inventory_status,
|
|
|
|
|
MAX(x.material_categories) material_categories,
|
|
|
|
|
MAX(x.location_code) locationCode,
|
|
|
|
|
MAX(x.batch_code) batchCode
|
|
|
|
|
FROM
|
|
|
|
|
hwmom.dbo.wms_inventory x
|
|
|
|
|
left join base_material_info b on
|
|
|
|
|
x.material_id = b.material_id
|
|
|
|
|
left join wms_base_warehouse c on
|
|
|
|
|
x.warehouse_id = c.warehouse_id
|
|
|
|
|
left join base_material_info d
|
|
|
|
|
on
|
|
|
|
|
x.material_id = d.material_id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="entity.materialId != null ">and x.material_id = #{entity.materialId}</if>
|
|
|
|
|
<if test="entity.warehouseId != null and entity.warehouseId != ''">and x.warehouse_id = #{entity.warehouseId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
group by
|
|
|
|
|
x.warehouse_id ,
|
|
|
|
|
x.material_id
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|