@ -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) orderNum,
SELECT COALESCE(SUM(CASE WHEN association_type = '1' THEN 1 END), 0) orderNum,
COALESCE(SUM(CASE WHEN association_type = '2' THEN 1 END), 0) lessNum,
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
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,9 +78,10 @@
</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
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!=''" >
@ -69,7 +93,8 @@
<if test= "param.warehouseId!=null and param.warehouseId!=''" >
and ldsa.warehouse_id = #{param.warehouseId}
</if>
</where> GROUP BY ldsa.service_number
</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
@ -84,7 +109,8 @@
</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
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
@ -168,7 +194,8 @@
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" >
@ -221,13 +248,21 @@
</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>