|
|
|
@ -18,13 +18,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
SELECT
|
|
|
|
|
x.material_id,
|
|
|
|
|
SUM(x.inventory_qty) inventory_qty,
|
|
|
|
|
CASE when SUM(x.inventory_qty) > MAX(b.max_stock_amount) then '0'
|
|
|
|
|
when MIN(b.min_stock_amount) > SUM(x.inventory_qty) then '0'
|
|
|
|
|
ELSE '1' END as inventory_status,
|
|
|
|
|
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(b.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
|
|
|
|
@ -34,9 +36,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
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>
|
|
|
|
|