|
|
|
@ -899,14 +899,15 @@
|
|
|
|
|
WHERE ldsa.id = #{stockArticleId} AND ldpl.is_transfer = 0 |
|
|
|
|
</select> |
|
|
|
|
<select id="exportDistributionStockArticle" |
|
|
|
|
resultType="com.logpm.distribution.entity.DistributionStockArticleEntity"> |
|
|
|
|
select ldsa.id, |
|
|
|
|
resultType="com.logpm.distribution.excel.DistributionStockArticleExcel"> |
|
|
|
|
SELECT |
|
|
|
|
ldsa.id, |
|
|
|
|
ldsa.tenant_id, |
|
|
|
|
ldsa.create_user, |
|
|
|
|
ldsa.create_time, |
|
|
|
|
ldsa.update_user, |
|
|
|
|
ldsa.update_time, |
|
|
|
|
ldsa.status, |
|
|
|
|
ldsa.STATUS, |
|
|
|
|
ldsa.is_deleted, |
|
|
|
|
ldsa.create_dept, |
|
|
|
|
ldsa.incoming_num, |
|
|
|
@ -963,7 +964,7 @@
|
|
|
|
|
ldsa.available_quantity, |
|
|
|
|
ldsa.is_have_data, |
|
|
|
|
ldsa.stock_article_code, |
|
|
|
|
group_concat(DISTINCT ldpl.dealer_name) as dealerName, |
|
|
|
|
group_concat( DISTINCT ldpl.dealer_name ) AS dealerName, |
|
|
|
|
ldsa.dealer_code, |
|
|
|
|
ldsa.train_number, |
|
|
|
|
ldsa.factory_train, |
|
|
|
@ -974,14 +975,22 @@
|
|
|
|
|
ldsa.accept_warehouse_id, |
|
|
|
|
ldsa.accept_warehouse_name, |
|
|
|
|
ldsa.order_delivery_status, |
|
|
|
|
group_concat(DISTINCT ldpl.pallet ) as trays, |
|
|
|
|
group_concat(DISTINCT ldpl.goods_allocation) as allocation |
|
|
|
|
group_concat( DISTINCT ldpl.pallet ) AS trays, |
|
|
|
|
group_concat( DISTINCT ldpl.goods_allocation ) AS allocation, |
|
|
|
|
IF(ldsa.total_number > 0 AND ldsa.incoming_num > 0,ldsa.total_number - ldsa.incoming_num,0) AS unreceivedQuantity, |
|
|
|
|
CASE ldsa.is_zero |
|
|
|
|
WHEN 0 THEN '否' |
|
|
|
|
WHEN 1 THEN '是' |
|
|
|
|
ELSE |
|
|
|
|
'未知' |
|
|
|
|
END isZeroString |
|
|
|
|
from logpm_distribution_stock_article ldsa |
|
|
|
|
left join logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id |
|
|
|
|
<where> |
|
|
|
|
ldsa.is_deleted = 0 and ldsa.order_status IN ( '10', '20', '30', '40', '50', '60', '70' ) |
|
|
|
|
and ldsa.hand_quantity > 0 |
|
|
|
|
and ldsa.genre = '1' |
|
|
|
|
AND ldpl.is_transfer = 0 |
|
|
|
|
<if test="param.warehouseId != null and param.warehouseId != ''"> |
|
|
|
|
and ldsa.warehouse_id = #{param.warehouseId} |
|
|
|
|
</if> |
|
|
|
@ -999,6 +1008,9 @@
|
|
|
|
|
<if test="param.typeService != null and param.typeService != ''">and ldsa.type_service = |
|
|
|
|
#{param.typeService} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.brand != null and param.brand != ''">and ldsa.brand |
|
|
|
|
like CONCAT(#{param.brand},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.consigneeUnit != null and param.consigneeUnit != ''">and ldsa.consignee_unit = |
|
|
|
|
#{param.consigneeUnit} |
|
|
|
|
</if> |
|
|
|
|