|
|
|
@ -62,33 +62,47 @@
|
|
|
|
|
and lwug.allocation_id = #{id} |
|
|
|
|
</select> |
|
|
|
|
<select id="selectOrder" resultType="com.logpm.warehouse.vo.WarehouseStockArticleZationVO"> |
|
|
|
|
select ldsa.* from logpm_distribution_stock_article ldsa |
|
|
|
|
select * from logpm_distribution_stock_article ldsa |
|
|
|
|
<where> |
|
|
|
|
ldsa.is_deleted = 0 and ldsa.is_zero ='0' |
|
|
|
|
<if test="list != null "> |
|
|
|
|
and ldsa.warehouse_id in |
|
|
|
|
<foreach collection="list" item="item" open="(" close=")" separator=","> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.serviceNumber!=null and param.serviceNumber!=''"> |
|
|
|
|
and ldsa.service_number like concat('%',#{param.serviceNumber},'%') |
|
|
|
|
</if> |
|
|
|
|
<!-- <if test="param.warehouseId!=null and param.warehouseId!=''">--> |
|
|
|
|
<!-- and ldsa.warehouse_id = #{param.warehouseId}--> |
|
|
|
|
<!-- </if>--> |
|
|
|
|
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)"> |
|
|
|
|
and ldsa.warehouse_id in |
|
|
|
|
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=","> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderCode!=null and param.orderCode!=''"> |
|
|
|
|
and ldsa.order_code like concat('%',#{param.orderCode},'%') |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
<select id="selectservicenub" resultType="com.logpm.warehouse.vo.WarehouseStockArticleZationVO"> |
|
|
|
|
select group_concat(ldsa.order_Code separator ',') as orderCode, group_concat(ldsa.service_number separator ',') |
|
|
|
|
|
|
|
|
|
select group_concat(ldsa.order_Code separator ',') as orderCode, ldsa.service_number |
|
|
|
|
as serviceNumber, group_concat(ldsa.customer_name separator ',') as customerName , |
|
|
|
|
group_concat(ldsa.customer_address separator ',') as customerAddress, group_concat(ldsa.customer_telephone |
|
|
|
|
separator ',') as customerTelephone from logpm_distribution_stock_article ldsa |
|
|
|
|
separator ',') as customerTelephone |
|
|
|
|
from logpm_distribution_stock_article ldsa |
|
|
|
|
<where> |
|
|
|
|
ldsa.is_deleted = 0 and ldsa.is_zero ='0' |
|
|
|
|
ldsa.is_deleted = 0 and ldsa.is_zero ='0' and ldsa.service_number in ( |
|
|
|
|
select DISTINCT service_number |
|
|
|
|
from logpm_distribution_stock_article |
|
|
|
|
<where> |
|
|
|
|
is_deleted = 0 and is_zero ='0' and service_number is not null |
|
|
|
|
<if test="param.warehouseIdList != null"> |
|
|
|
|
and warehouse_id in |
|
|
|
|
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=","> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
) |
|
|
|
|
</where> |
|
|
|
|
<if test="param.customerName!=null and param.customerName!=''"> |
|
|
|
|
and ldsa.customer_name like concat('%',#{param.customerName},'%') |
|
|
|
|
</if> |
|
|
|
@ -98,12 +112,12 @@
|
|
|
|
|
<!-- <if test="param.warehouseId!=null and param.warehouseId!=''">--> |
|
|
|
|
<!-- and ldsa.warehouse_id = #{param.warehouseId}--> |
|
|
|
|
<!-- </if>--> |
|
|
|
|
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)"> |
|
|
|
|
and ldsa.warehouse_id in |
|
|
|
|
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=","> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<!-- <if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">--> |
|
|
|
|
<!-- and ldsa.warehouse_id in--> |
|
|
|
|
<!-- <foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">--> |
|
|
|
|
<!-- #{item}--> |
|
|
|
|
<!-- </foreach>--> |
|
|
|
|
<!-- </if>--> |
|
|
|
|
</where> |
|
|
|
|
GROUP BY ldsa.service_number |
|
|
|
|
</select> |
|
|
|
@ -218,32 +232,32 @@
|
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
<select id="selectInventory" resultType="com.logpm.warehouse.vo.WarehouseStockListZationVO"> |
|
|
|
|
-- SELECT |
|
|
|
|
-- ldsl.id id, |
|
|
|
|
-- ldsl.material_id materialId, |
|
|
|
|
-- ldsl.order_code orderCode, |
|
|
|
|
-- lbm.product_code materialCode, |
|
|
|
|
-- ldsl.service_number serviceNumber, |
|
|
|
|
-- ldsl.description_goods descriptionGoods, |
|
|
|
|
-- ldsl.cargo_number cargoNumber, |
|
|
|
|
-- ldsl.market_id marketId, |
|
|
|
|
-- ldsl.cargo_norms cargoNorms, |
|
|
|
|
-- ldsl.incoming_batch incomingBatch, |
|
|
|
|
-- ldsl.cargo_unit cargoUnit, |
|
|
|
|
-- ldsl.stock_list_code stockListCode, |
|
|
|
|
-- ldsl.quantity_stock quantityStock, |
|
|
|
|
-- ldsl.sku sku, |
|
|
|
|
-- sum(lwug.num) allNum |
|
|
|
|
-- FROM |
|
|
|
|
-- logpm_distribution_stock_list ldsl |
|
|
|
|
-- left JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id |
|
|
|
|
-- AND ldsl.market_id = lwug.market_id |
|
|
|
|
-- AND ldsl.incoming_batch = lwug.incoming_batch |
|
|
|
|
-- left join logpm_basicdata_material lbm on lbm.id =ldsl.material_id |
|
|
|
|
<!---- SELECT |
|
|
|
|
-- ldsl.id id, |
|
|
|
|
-- ldsl.material_id materialId, |
|
|
|
|
-- ldsl.order_code orderCode, |
|
|
|
|
-- lbm.product_code materialCode, |
|
|
|
|
-- ldsl.service_number serviceNumber, |
|
|
|
|
-- ldsl.description_goods descriptionGoods, |
|
|
|
|
-- ldsl.cargo_number cargoNumber, |
|
|
|
|
-- ldsl.market_id marketId, |
|
|
|
|
-- ldsl.cargo_norms cargoNorms, |
|
|
|
|
-- ldsl.incoming_batch incomingBatch, |
|
|
|
|
-- ldsl.cargo_unit cargoUnit, |
|
|
|
|
-- ldsl.stock_list_code stockListCode, |
|
|
|
|
-- ldsl.quantity_stock quantityStock, |
|
|
|
|
-- ldsl.sku sku, |
|
|
|
|
-- sum(lwug.num) allNum |
|
|
|
|
-- FROM |
|
|
|
|
-- logpm_distribution_stock_list ldsl |
|
|
|
|
-- left JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id |
|
|
|
|
-- AND ldsl.market_id = lwug.market_id |
|
|
|
|
-- AND ldsl.incoming_batch = lwug.incoming_batch |
|
|
|
|
-- left join logpm_basicdata_material lbm on lbm.id =ldsl.material_id--> |
|
|
|
|
SELECT |
|
|
|
|
ldsl.id AS id, |
|
|
|
|
ldsl.material_id AS materialId, |
|
|
|
|
ldsl.order_code AS orderCode, |
|
|
|
|
ldsl.incoming_batch AS orderCode, |
|
|
|
|
lbm.product_code AS materialCode, |
|
|
|
|
ldsl.service_number AS serviceNumber, |
|
|
|
|
ldsl.description_goods AS descriptionGoods, |
|
|
|
@ -254,6 +268,9 @@
|
|
|
|
|
ldsl.cargo_unit AS cargoUnit, |
|
|
|
|
ldsl.stock_list_code AS stockListCode, |
|
|
|
|
ldsl.quantity_stock AS quantityStock, |
|
|
|
|
ldsl.market_name AS marketName, |
|
|
|
|
ldsl.incoming_batch AS incomingBatch, |
|
|
|
|
ldsl.warehousing_time AS warehousingTime, |
|
|
|
|
ldsl.sku AS sku, |
|
|
|
|
COALESCE(lwug.allNum, 0) AS allNum |
|
|
|
|
FROM |
|
|
|
@ -279,7 +296,7 @@
|
|
|
|
|
<where> |
|
|
|
|
(ldsl.quantity_stock > COALESCE(lwug.allNum, 0) OR lwug.association_id IS NULL) and ldsl.is_deleted = 0 |
|
|
|
|
<if test="param.orderCode!=null and param.orderCode !=''"> |
|
|
|
|
and ldpl.order_code like concat('%',#{param.orderCode},'%') |
|
|
|
|
and ldsl.incoming_batch like concat('%',#{param.orderCode},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)"> |
|
|
|
|
and ldsl.warehouse_id in |
|
|
|
@ -288,8 +305,24 @@
|
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.sku!=null and param.sku !=''"> |
|
|
|
|
and ldpl.sku like concat('%',#{param.sku},'%') |
|
|
|
|
and ldsl.sku like concat('%',#{param.sku},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.marketName!=null and param.marketName !=''"> |
|
|
|
|
and ldsl.market_name like concat('%',#{param.marketName},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.incomingBatch!=null and param.incomingBatch !=''"> |
|
|
|
|
and ldsl.incoming_batch like concat('%',#{param.incomingBatch},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.descriptionGoods!=null and param.descriptionGoods !=''"> |
|
|
|
|
and ldsl.description_goods like concat('%',#{param.descriptionGoods},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.cargoNumber != null and param.cargoNumber !=''"> |
|
|
|
|
and ldsl.cargo_number like concat('%',#{param.cargoNumber},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.waerTime !=null "> |
|
|
|
|
and ldsl.warehousing_time like concat(#{param.waerTime},'%') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
<select id="selectAllTray" resultType="com.logpm.warehouse.vo.WarehouseTrayVO"> |
|
|
|
|