@ -8,36 +8,59 @@
<select id= "selectWarehouseGoodsAllocationPage" resultMap= "warehouseGoodsAllocationResultMap" >
select * from logpm_warehouse_goods_allocation where is_deleted = 0
select *
from logpm_warehouse_goods_allocation
where is_deleted = 0
</select>
<select id= "exportWarehouseGoodsAllocation" resultType= "com.logpm.warehouse.excel.WarehouseGoodsAllocationExcel" >
SELECT * FROM logpm_warehouse_goods_allocation ${ew.customSqlSegment}
SELECT *
FROM logpm_warehouse_goods_allocation ${ew.customSqlSegment}
</select>
<select id= "selectnum" resultType= "com.logpm.warehouse.vo.WarehouseGoodsAllocationVO" >
SELECT
COALESCE(SUM(CASE WHEN association_type = '1' THEN 1 END), 0) order Num,
COALESCE(SUM(CASE WHEN association_type = '2' THEN 1 END), 0) less Num,
COALESCE(SUM(CASE WHEN association_type = '3' THEN 1 END), 0) packageNum,
COALESCE(SUM(CASE WHEN association_type = '4' THEN 1 END), 0) inventoryNum
FROM
logpm_warehouse_updown_goods where allocation_id = #{id} and is_deleted = 0
SELECT COALESCE(SUM(CASE WHEN association_type = '1' THEN 1 END), 0) orderNum,
COALESCE(SUM(CASE WHEN association_type = '2' THEN 1 END), 0) less Num,
COALESCE(SUM(CASE WHEN association_type = '3' THEN 1 END), 0) package Num,
COALESCE(SUM(CASE WHEN association_type = '4' THEN 1 END), 0) inventoryNum
FROM logpm_warehouse_updown_goods
where allocation_id = #{id}
and is_deleted = 0
</select>
<select id= "topWarehouse" resultType= "com.logpm.warehouse.vo.WarehouseVisCargo" >
select lww.* from logpm_warehouse_warehouse lww where lww.is_deleted = 0
select lww.* from logpm_warehouse_warehouse lww
<where >
lww.is_deleted = 0
<if test= "id!=null and id!=''" >
and lww.id = #{id}
</if>
</where>
</select>
<select id= "topArea" resultType= "com.logpm.warehouse.vo.WarehouseGoodsAreaVO" >
select lwga.* from logpm_warehouse_goods_area lwga where lwga.is_deleted = 0 and lwga.warehouse_id = #{id}
select lwga.*
from logpm_warehouse_goods_area lwga
where lwga.is_deleted = 0
and lwga.warehouse_id = #{id}
</select>
<select id= "topShelf" resultType= "com.logpm.warehouse.entity.WarehouseGoodsShelfEntity" >
select lwgs.* from logpm_warehouse_goods_shelf lwgs where lwgs.is_deleted = 0 and lwgs.goods_area_id = #{id}
select lwgs.*
from logpm_warehouse_goods_shelf lwgs
where lwgs.is_deleted = 0
and lwgs.goods_area_id = #{id}
</select>
<select id= "selectServe" resultType= "com.logpm.warehouse.vo.WarehouseVisualizationVO" >
select ldpl.service_number serviceNumber,ldpl.brand_name brandName from logpm_distribution_parcel_list ldpl join logpm_warehouse_updown_goods lwug on ldpl.id = lwug.association_id WHERE lwug.association_type = '3' and lwug.allocation_id = #{id}
select ldpl.service_number serviceNumber, ldpl.brand_name brandName
from logpm_distribution_parcel_list ldpl
join logpm_warehouse_updown_goods lwug on ldpl.id = lwug.association_id
WHERE lwug.association_type = '3'
and lwug.allocation_id = #{id}
</select>
<select id= "selectStockList" resultType= "com.logpm.warehouse.entity.WarehouseMaterialEntity" >
select lbm.product_code productCode, lbm.name name from logpm_basicdata_material lbm join logpm_warehouse_updown_goods lwug on lbm.id = lwug.association_id WHERE lwug.association_type = '4' and lwug.allocation_id = #{id}
select lbm.product_code productCode, lbm.name name
from logpm_basicdata_material lbm
join logpm_warehouse_updown_goods lwug on lbm.id = lwug.association_id
WHERE lwug.association_type = '4'
and lwug.allocation_id = #{id}
</select>
<select id= "selectOrder" resultType= "com.logpm.warehouse.vo.WarehouseStockArticleZationVO" >
select ldsa.* from logpm_distribution_stock_article ldsa
@ -55,24 +78,26 @@
</where>
</select>
<select id= "selectservicenub" resultType= "com.logpm.warehouse.vo.WarehouseStockArticleZationVO" >
select GROUP_CONCAT( ldsa.order_Code SEPARATOR ',' ) orderCode, ldsa.service_number
serviceNumber,GROUP_CONCAT(ldsa.customer_name SEPARATOR ',' ) customerName,ldsa.customer_address
customerAddress, ldsa.customer_telephone customerTelephone from logpm_distribution_stock_article ldsa
<where >
ldsa.is_deleted = 0 and ldsa.is_zero ='0'
<if test= "param.customerName!=null and param.customerName!=''" >
and ldsa.customer_name like concat('%',#{param.customerName},'%')
</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>
</where> GROUP BY ldsa.service_number
select group_concat(ldsa.order_Code separator ',') as orderCode, group_concat(ldsa.service_number separator ',')
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
<where >
ldsa.is_deleted = 0 and ldsa.is_zero ='0'
<if test= "param.customerName!=null and param.customerName!=''" >
and ldsa.customer_name like concat('%',#{param.customerName},'%')
</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>
</where>
GROUP BY ldsa.service_number
</select>
<select id= "selectorderByServiceNumber" resultType= "com.logpm.warehouse.dto.UpShelfOrderDTO" >
select ldsa.service_number serviceNumber,ldsa.order_code orderCode from logpm_distribution_stock_article ldsa
select ldsa.service_number serviceNumber,ldsa.order_code orderCode from logpm_distribution_stock_article ldsa
<where >
ldsa.is_deleted = 0 and ldsa.is_zero ='0'
<if test= "array != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(array)" >
@ -81,17 +106,18 @@
#{item}
</foreach>
</if>
</where>
</where>
</select>
<select id= "selectwrap" resultType= "com.logpm.warehouse.vo.WarehouseVisualizationVO" >
select ldpl.* ,ldsa.customer_name,ldsa.customer_telephone,ldsa.customer_address from logpm_distribution_parcel_list ldpl
left join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id
select ldpl.* ,ldsa.customer_name,ldsa.customer_telephone,ldsa.customer_address from
logpm_distribution_parcel_list ldpl
left join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id
<where >
ldpl.order_package_grounding_status ='10' and ldpl.is_deleted = 0
ldpl.order_package_grounding_status ='10' and ldpl.is_deleted = 0
<if test= "param.serviceNumber!=null and param.serviceNumber!=''" >
and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if>
<if test= "param.orderCode!=null and param.orderCode!=''" >
<if test= "param.orderCode!=null and param.orderCode!=''" >
and ldpl.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test= "param.orderPackageCode!=null and param.orderPackageCode!=''" >
@ -101,17 +127,17 @@
</select>
<select id= "selectTray" resultType= "com.logpm.warehouse.vo.WarehouseTrayVO" >
SELECT
lwt.pallet_code palletCode,
lwt.id id,
lwt.tray_status trayStatus,
lwt.create_time createTime,
sum(lwtg.num) num
lwt.pallet_code palletCode,
lwt.id id,
lwt.tray_status trayStatus,
lwt.create_time createTime,
sum(lwtg.num) num
FROM
logpm_warehouse_tray lwt
LEFT JOIN logpm_warehouse_tary_allocation lwta ON lwt.id = lwta.tary_id
LEFT JOIN logpm_warehouse_tray_goods lwtg ON lwt.id = lwtg.tray_id
logpm_warehouse_tray lwt
LEFT JOIN logpm_warehouse_tary_allocation lwta ON lwt.id = lwta.tary_id
LEFT JOIN logpm_warehouse_tray_goods lwtg ON lwt.id = lwtg.tray_id
<where >
lwta.tary_id is NULL and lwt.is_deleted = 0 and lwtg.tray_id is not null
lwta.tary_id is NULL and lwt.is_deleted = 0 and lwtg.tray_id is not null
<if test= "param.palletCode!=null and param.palletCode!=''" >
and ldpl.pallet_code like concat('%',#{param.palletCode},'%')
</if>
@ -119,32 +145,32 @@
and lwt.warehouse_id = #{param.warehouseId}
</if>
</where>
GROUP BY lwt.id
GROUP BY lwt.id
</select>
<select id= "selectAllwrap" resultType= "com.logpm.warehouse.vo.WarehouseVisualizationVO" >
SELECT
ldpl.warehouse warehouse,
ldpl.service_number serviceNumber,
ldpl.material_name materialName,
ldpl.material_code materialCode,
ldpl.train_number trainNumber,
ldpl.create_time createTime,
ldpl.order_package_code orderPackageCode,
ldpl.firsts firsts,
ldpl.second second,
ldpl.third_product thirdProduct,
ldpl.customer_name customerName,
ldpl.customer_telephone customerTelephone,
ldpl.customer_address customerAddress,
ldpl.order_code orderCode,
lwut.updown_type updownType,
lwtg.tray_code trayCode,
CONCAT(lwug.area_title,'-',lwug.shelf_title,'-',lwug.allocation_title) positionCode
ldpl.warehouse warehouse,
ldpl.service_number serviceNumber,
ldpl.material_name materialName,
ldpl.material_code materialCode,
ldpl.train_number trainNumber,
ldpl.create_time createTime,
ldpl.order_package_code orderPackageCode,
ldpl.firsts firsts,
ldpl.second second,
ldpl.third_product thirdProduct,
ldpl.customer_name customerName,
ldpl.customer_telephone customerTelephone,
ldpl.customer_address customerAddress,
ldpl.order_code orderCode,
lwut.updown_type updownType,
lwtg.tray_code trayCode,
CONCAT(lwug.area_title,'-',lwug.shelf_title,'-',lwug.allocation_title) positionCode
FROM
logpm_distribution_parcel_list ldpl
JOIN logpm_warehouse_updown_goods lwug ON ldpl.id = lwug.association_id
left JOIN logpm_warehouse_updown_type lwut on lwut.id = lwug.updown_type_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
logpm_distribution_parcel_list ldpl
JOIN logpm_warehouse_updown_goods lwug ON ldpl.id = lwug.association_id
left JOIN logpm_warehouse_updown_type lwut on lwut.id = lwug.updown_type_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
<where >
lwug.association_type = 3
AND ldpl.is_deleted = 0 and lwug.allocation_id =#{param.id}
@ -152,38 +178,39 @@
</select>
<select id= "selectAllInventory" resultType= "com.logpm.warehouse.vo.WarehouseStockListZationVO" >
SELECT
ldsl.order_code orderCode,
ldsl.service_number serviceNumber,
ldsl.description_goods descriptionGoods,
ldsl.cargo_number cargoNumber,
ldsl.cargo_norms cargoNorms,
ldsl.cargo_unit cargoUnit,
ldsl.sku sku,
ldsl.stock_list_code stockListCode,
lwtg.tray_code trayCode,
CONCAT(lwug.area_title,'-',lwug.shelf_title,'-',lwug.allocation_title) positionCode
ldsl.order_code orderCode,
ldsl.service_number serviceNumber,
ldsl.description_goods descriptionGoods,
ldsl.cargo_number cargoNumber,
ldsl.cargo_norms cargoNorms,
ldsl.cargo_unit cargoUnit,
ldsl.sku sku,
ldsl.stock_list_code stockListCode,
lwtg.tray_code trayCode,
CONCAT(lwug.area_title,'-',lwug.shelf_title,'-',lwug.allocation_title) positionCode
FROM
logpm_distribution_stock_list ldsl
JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id
left JOIN logpm_warehouse_updown_type lwut on lwut.id = lwug.updown_type_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldsl.material_id
logpm_distribution_stock_list ldsl
JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id
left JOIN logpm_warehouse_updown_type lwut on lwut.id = lwug.updown_type_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldsl.material_id
<where >
lwug.association_type = 4 and ldsl.market_id = lwug.market_id AND ldsl.is_deleted = 0 and lwug.allocation_id =#{param.id}
lwug.association_type = 4 and ldsl.market_id = lwug.market_id AND ldsl.is_deleted = 0 and lwug.allocation_id
=#{param.id}
</where>
</select>
<select id= "selectInventory" resultType= "com.logpm.warehouse.vo.WarehouseStockListZationVO" >
SELECT
ldsl.material_id materialId,
ldsl.order_code orderCode,
ldsl.service_number serviceNumber,
ldsl.description_goods descriptionGoods,
ldsl.cargo_number cargoNumber,
ldsl.cargo_norms cargoNorms,
ldsl.cargo_unit cargoUnit,
ldsl.sku sku
ldsl.material_id materialId,
ldsl.order_code orderCode,
ldsl.service_number serviceNumber,
ldsl.description_goods descriptionGoods,
ldsl.cargo_number cargoNumber,
ldsl.cargo_norms cargoNorms,
ldsl.cargo_unit cargoUnit,
ldsl.sku sku
FROM
logpm_distribution_stock_list ldsl
left JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id
logpm_distribution_stock_list ldsl
left JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id
<where >
lwug.association_id is null and ldsl.is_deleted = 0
<if test= "param.orderCode!=null and param.orderCode !=''" >
@ -200,34 +227,42 @@
lwt.pallet_name palletName,
lwt.pallet_code palletCode,
lwt.type type,
GROUP_CONCAT(lwtg.association_type SEPARATOR ',') associationType,
sum(lwtg.num) num,
GROUP_CONCAT(lwtg.palletizing_type SEPARATOR ',') palletizingType
GROUP_CONCAT(lwtg.association_type SEPARATOR ',') associationType,
sum(lwtg.num) num,
GROUP_CONCAT(lwtg.palletizing_type SEPARATOR ',') palletizingType
FROM
logpm_warehouse_tray lwt
JOIN logpm_warehouse_tary_allocation lwta ON lwt.id = lwta.tary_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.tray_id =lwt.id
WHERE
lwta.is_deleted =0 GROUP BY lwt.id
lwta.is_deleted =0 GROUP BY lwt.id
<where >
lwta.is_deleted =0
<if test= "param.palletName!=null and param.palletName!=''" >
and lwt.pallet_name like concat('%',#{param.palletName},'%')
</if>
<if test= "param.palletCode!=null and param.palletCode!=''" >
<if test= "param.palletCode!=null and param.palletCode!=''" >
and lwt.pallet_code like concat('%',#{param.palletCode},'%')
</if>
and lwta.allocation_id =#{param.id}
</where>
</select>
<select id= "selectZeroOrder" resultType= "com.logpm.warehouse.vo.WarehouseStockArticleZationVO" >
SELECT ldsa.* FROM logpm_distribution_stock_article ldsa WHERE ldsa.is_zero ='1'
SELECT ldsa.*
FROM logpm_distribution_stock_article ldsa
WHERE ldsa.is_zero = '1'
</select>
<select id= "selectAllZeroOrder" resultType= "com.logpm.warehouse.vo.WarehouseStockArticleZationVO" >
SELECT ldsa.* FROM logpm_distribution_stock_article ldsa join logpm_warehouse_updown_goods lwug on lwug.association_id = ldsa.id WHERE ldsa.is_zero ='1'
SELECT ldsa.*
FROM logpm_distribution_stock_article ldsa
join logpm_warehouse_updown_goods lwug on lwug.association_id = ldsa.id
WHERE ldsa.is_zero = '1'
</select>
<select id= "selectCargoSumId" resultType= "com.logpm.warehouse.vo.WarehouseCargoSumVO" >
select id from logpm_warehouse_goods_area WHERE is_deleted = 0 and enable_status = '1'
select id
from logpm_warehouse_goods_area
WHERE is_deleted = 0
and enable_status = '1'
</select>