|
|
|
@ -50,6 +50,88 @@
|
|
|
|
|
<!-- <result column="reservation_num" property="reservationNum"/>--> |
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
<sql id="selectOrderList"> |
|
|
|
|
select ldsa.id, |
|
|
|
|
ldsa.tenant_id, |
|
|
|
|
ldsa.create_user, |
|
|
|
|
ldsa.create_time, |
|
|
|
|
ldsa.update_user, |
|
|
|
|
ldsa.update_time, |
|
|
|
|
ldsa.status, |
|
|
|
|
ldsa.is_deleted, |
|
|
|
|
ldsa.create_dept, |
|
|
|
|
ldsa.incoming_num, |
|
|
|
|
ldsa.service_number, |
|
|
|
|
ldsa.order_code, |
|
|
|
|
ldsa.mall_id, |
|
|
|
|
ldsa.mall_code, |
|
|
|
|
ldsa.mall_name, |
|
|
|
|
ldsa.store_name, |
|
|
|
|
ldsa.store_code, |
|
|
|
|
ldsa.store_id, |
|
|
|
|
ldsa.description_goods, |
|
|
|
|
ldsa.warehouse_id, |
|
|
|
|
ldsa.warehouse, |
|
|
|
|
ldsa.warehouse_entry_time, |
|
|
|
|
ldsa.store_time, |
|
|
|
|
ldsa.total_number, |
|
|
|
|
ldsa.hand_quantity, |
|
|
|
|
ldsa.complete_set, |
|
|
|
|
ldsa.brand, |
|
|
|
|
ldsa.type_service, |
|
|
|
|
ldsa.customer_name, |
|
|
|
|
ldsa.customer_telephone, |
|
|
|
|
ldsa.customer_address, |
|
|
|
|
ldsa.genre, |
|
|
|
|
ldsa.stockup_status, |
|
|
|
|
ldsa.reservation_status, |
|
|
|
|
ldsa.order_status, |
|
|
|
|
ldsa.grounding_status, |
|
|
|
|
ldsa.order_receive_status, |
|
|
|
|
ldsa.freeze_status, |
|
|
|
|
ldsa.notification, |
|
|
|
|
ldsa.fee, |
|
|
|
|
ldsa.rate, |
|
|
|
|
ldsa.advance_id, |
|
|
|
|
ldsa.waybill_id, |
|
|
|
|
ldsa.waybill_number AS waybillNumber, |
|
|
|
|
ldsa.consignee_unit, |
|
|
|
|
ldsa.collect_fee, |
|
|
|
|
ldsa.storage_fee, |
|
|
|
|
ldsa.consignee_person, |
|
|
|
|
ldsa.consignee_address, |
|
|
|
|
ldsa.consignee_mobile, |
|
|
|
|
ldsa.warehouse_entry_time_end, |
|
|
|
|
ldsa.sorting_quantity, |
|
|
|
|
ldsa.delivery_quantity, |
|
|
|
|
ldsa.transfer_quantity, |
|
|
|
|
ldsa.signin_quantity, |
|
|
|
|
ldsa.resource, |
|
|
|
|
ldsa.is_opai, |
|
|
|
|
ldsa.inventory_date, |
|
|
|
|
ldsa.inventory_person, |
|
|
|
|
ldsa.inventory_person_id, |
|
|
|
|
ldsa.available_quantity, |
|
|
|
|
ldsa.is_have_data, |
|
|
|
|
ldsa.stock_article_code, |
|
|
|
|
group_concat(DISTINCT ldpl.dealer_name) as dealerName, |
|
|
|
|
ldsa.dealer_code, |
|
|
|
|
ldsa.train_number, |
|
|
|
|
ldsa.factory_train, |
|
|
|
|
ldsa.sending, |
|
|
|
|
ldsa.send_warehouse_id, |
|
|
|
|
ldsa.send_warehouse_name, |
|
|
|
|
ldsa.is_zero, |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
from logpm_distribution_stock_article ldsa |
|
|
|
|
left join logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id |
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectDistributionStockArticlePage" resultMap="distributionStockArticleResultMap"> |
|
|
|
|
select * |
|
|
|
@ -85,80 +167,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectClientListPage" resultMap="distributionStockArticleResultMap"> |
|
|
|
|
SELECT * from logpm_distribution_stock_article ldsa where |
|
|
|
|
ldsa.is_deleted = 0 and ldsa.type_service ='2' and ldsa.genre = '1' and ldsa.reservation_status in ('10','20') |
|
|
|
|
and ldsa.order_status in ('10','20','30','70') |
|
|
|
|
<if test="distributionStockArticleVO.orderCode!=null and distributionStockArticleVO.orderCode !=''"> |
|
|
|
|
and ldsa.order_code like concat(#{distributionStockArticleVO.orderCode},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.stockupStatus != null and distributionStockArticleVO.stockupStatus != ''"> |
|
|
|
|
and ldsa.stockup_status = #{distributionStockArticleVO.stockupStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.reservationStatus != null and distributionStockArticleVO.reservationStatus != ''"> |
|
|
|
|
and ldsa.reservation_status = #{distributionStockArticleVO.reservationStatus} |
|
|
|
|
</if> |
|
|
|
|
<!-- <if test="distributionStockArticleVO.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(distributionStockArticleVO.warehouseIdList)">--> |
|
|
|
|
<!-- and ldsa.warehouse_id in--> |
|
|
|
|
<!-- <foreach collection="distributionStockArticleVO.warehouseIdList" item="item" open="(" close=")" separator=",">--> |
|
|
|
|
<!-- #{item}--> |
|
|
|
|
<!-- </foreach>--> |
|
|
|
|
<!-- </if>--> |
|
|
|
|
<if test="distributionStockArticleVO.orderStatus != null and distributionStockArticleVO.orderStatus != ''"> |
|
|
|
|
and ldsa.order_status = #{distributionStockArticleVO.orderStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.groundingStatus != null and distributionStockArticleVO.groundingStatus != ''"> |
|
|
|
|
and ldsa.grounding_status = #{distributionStockArticleVO.groundingStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.freezeStatus != null and distributionStockArticleVO.freezeStatus != ''"> |
|
|
|
|
and ldsa.freeze_status = #{distributionStockArticleVO.freezeStatus} |
|
|
|
|
</if> |
|
|
|
|
<!-- 条件没有写完 --> |
|
|
|
|
<if test="distributionStockArticleVO.descriptionGoods != null and distributionStockArticleVO.descriptionGoods != ''"> |
|
|
|
|
and ldsa.description_goods like concat('%',#{distributionStockArticleVO.descriptionGoods},'%') |
|
|
|
|
</if> |
|
|
|
|
select ldsa.id, ldsa.tenant_id, |
|
|
|
|
ldsa.create_user, |
|
|
|
|
ldsa.create_time, |
|
|
|
|
ldsa.update_user, |
|
|
|
|
ldsa.update_time, |
|
|
|
|
ldsa.incoming_num AS incomingNum, |
|
|
|
|
ldsa.status, ldsa.is_deleted, ldsa.create_dept, |
|
|
|
|
ldsa.reserve1, ldsa.reserve2, ldsa.reserve3, ldsa.reserve4, ldsa.reserve5, |
|
|
|
|
ldsa.service_number, ldsa.order_code, |
|
|
|
|
ldsa.mall_id, ldsa.mall_code, ldsa.mall_name, ldsa.store_name, |
|
|
|
|
ldsa.store_code, ldsa.store_id, ldsa.description_goods, ldsa.warehouse_id, |
|
|
|
|
ldsa.warehouse, ldsa.warehouse_entry_time, ldsa.store_time, ldsa.total_number, ldsa.hand_quantity, |
|
|
|
|
ldsa.complete_set, ldsa.brand, ldsa.type_service, ldsa.customer_name, ldsa.customer_telephone, |
|
|
|
|
ldsa.customer_address, ldsa.genre, |
|
|
|
|
ldsa.stockup_status, ldsa.reservation_status, ldsa.order_status, ldsa.grounding_status, |
|
|
|
|
ldsa.order_receive_status, |
|
|
|
|
ldsa.freeze_status, ldsa.notification, ldsa.fee, ldsa.rate, ldsa.advance_id, ldsa.waybill_id, |
|
|
|
|
GROUP_CONCAT( DISTINCT ldpl.waybill_number ) waybill_number, |
|
|
|
|
ldsa.consignee_unit, ldsa.collect_fee, ldsa.storage_fee, ldsa.consignee_person, ldsa.consignee_address, |
|
|
|
|
ldsa.consignee_mobile, ldsa.warehouse_entry_time_end, |
|
|
|
|
ldsa.sorting_quantity, ldsa.delivery_quantity, ldsa.transfer_quantity, |
|
|
|
|
ldsa.signin_quantity, ldsa.resource, ldsa.is_opai, |
|
|
|
|
ldsa.inventory_date, ldsa.inventory_person, ldsa.inventory_person_id, |
|
|
|
|
ldsa.available_quantity, ldsa.is_have_data, ldsa.stock_article_code, GROUP_CONCAT( DISTINCT ldpl.dealer_name ) |
|
|
|
|
dealerName, ldsa.dealer_code, |
|
|
|
|
ldsa.train_number, ldsa.factory_train, ldsa.sending, ldsa.send_warehouse_id, ldsa.send_warehouse_name, |
|
|
|
|
ldsa.is_zero, ldsa.accept_warehouse_id, ldsa.accept_warehouse_name, ldsa.order_delivery_status, |
|
|
|
|
ldsa.trays trays, |
|
|
|
|
ldsa.allocation allocation |
|
|
|
|
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.hand_quantity > 0 and ldsa.order_status in ('10','20','30','40','50','60','70') |
|
|
|
|
and ldsa.genre = '1' and ldsa.type_service='2' |
|
|
|
|
<if test="distributionStockArticleVO.orderCode!=null and distributionStockArticleVO.orderCode !=''"> |
|
|
|
|
and ldsa.order_code like concat(#{distributionStockArticleVO.orderCode},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.stockupStatus != null and distributionStockArticleVO.stockupStatus != ''"> |
|
|
|
|
and ldsa.stockup_status = #{distributionStockArticleVO.stockupStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.reservationStatus != null and distributionStockArticleVO.reservationStatus != ''"> |
|
|
|
|
and ldsa.reservation_status = #{distributionStockArticleVO.reservationStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="warehouseIds != null"> |
|
|
|
|
and ldsa.warehouse_id in |
|
|
|
|
<foreach collection="warehouseIds" item="warehouseId" open="(" separator="," close=")"> |
|
|
|
|
#{warehouseId} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.orderStatus != null and distributionStockArticleVO.orderStatus != ''"> |
|
|
|
|
and ldsa.order_status = #{distributionStockArticleVO.orderStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.groundingStatus != null and distributionStockArticleVO.groundingStatus != ''"> |
|
|
|
|
and ldsa.grounding_status = #{distributionStockArticleVO.groundingStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.freezeStatus != null and distributionStockArticleVO.freezeStatus != ''"> |
|
|
|
|
and ldsa.freeze_status = #{distributionStockArticleVO.freezeStatus} |
|
|
|
|
</if> |
|
|
|
|
<!-- 条件没有写完 --> |
|
|
|
|
<if test="distributionStockArticleVO.descriptionGoods != null and distributionStockArticleVO.descriptionGoods != ''"> |
|
|
|
|
and ldsa.description_goods like concat('%',#{distributionStockArticleVO.descriptionGoods},'%') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.warehouse != null and distributionStockArticleVO.warehouse != ''"> |
|
|
|
|
and ldsa.warehouse like concat('%',#{distributionStockArticleVO.warehouse},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.warehouse != null and distributionStockArticleVO.warehouse != ''"> |
|
|
|
|
and ldsa.warehouse like concat('%',#{distributionStockArticleVO.warehouse},'%') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.brand != null and distributionStockArticleVO.brand != ''"> |
|
|
|
|
and ldsa.brand like concat('%',#{distributionStockArticleVO.brand},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.brand != null and distributionStockArticleVO.brand != ''"> |
|
|
|
|
and ldsa.brand like concat('%',#{distributionStockArticleVO.brand},'%') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.storeName != null and distributionStockArticleVO.storeName != ''"> |
|
|
|
|
and ldsa.store_name like concat('%',#{distributionStockArticleVO.storeName},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.storeName != null and distributionStockArticleVO.storeName != ''"> |
|
|
|
|
and ldsa.store_name like concat('%',#{distributionStockArticleVO.storeName},'%') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.customerName != null and distributionStockArticleVO.customerName != ''"> |
|
|
|
|
and ldsa.customer_name like concat('%',#{distributionStockArticleVO.customerName},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.customerName != null and distributionStockArticleVO.customerName != ''"> |
|
|
|
|
and ldsa.customer_name like concat('%',#{distributionStockArticleVO.customerName},'%') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.customerTelephone != null and distributionStockArticleVO.customerTelephone != ''"> |
|
|
|
|
and ldsa.customer_telephone like concat('%',#{distributionStockArticleVO.customerTelephone},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.customerTelephone != null and distributionStockArticleVO.customerTelephone != ''"> |
|
|
|
|
and ldsa.customer_telephone like concat('%',#{distributionStockArticleVO.customerTelephone},'%') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.customerAddress != null and distributionStockArticleVO.customerAddress != ''"> |
|
|
|
|
and ldsa.customer_address like concat('%',#{distributionStockArticleVO.customerAddress},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.customerAddress != null and distributionStockArticleVO.customerAddress != ''"> |
|
|
|
|
and ldsa.customer_address like concat('%',#{distributionStockArticleVO.customerAddress},'%') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.waybillNumber != null and distributionStockArticleVO.waybillNumber != ''"> |
|
|
|
|
and ldsa.waybill_number like concat('%',#{distributionStockArticleVO.waybillNumber},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.waybillNumber != null and distributionStockArticleVO.waybillNumber != ''"> |
|
|
|
|
and ldsa.waybill_number like concat('%',#{distributionStockArticleVO.waybillNumber},'%') |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.totalNumber != null and distributionStockArticleVO.totalNumber != ''"> |
|
|
|
|
and ldsa.total_number = #{distributionStockArticleVO.totalNumber} |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.totalNumber != null "> |
|
|
|
|
and ldsa.total_number = #{distributionStockArticleVO.totalNumber} |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.handQuantity != null and distributionStockArticleVO.handQuantity != ''"> |
|
|
|
|
and ldsa.hand_quantity = #{distributionStockArticleVO.handQuantity} |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.handQuantity != null and distributionStockArticleVO.handQuantity != ''"> |
|
|
|
|
and ldsa.hand_quantity = #{distributionStockArticleVO.handQuantity} |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="distributionStockArticleVO.clientIds != null and distributionStockArticleVO.handQuantity != ''"> |
|
|
|
|
and ldsa.mall_id in |
|
|
|
|
<foreach collection="distributionStockArticleVO.clientIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="distributionStockArticleVO.clientIds != null "> |
|
|
|
|
and ldsa.mall_id in |
|
|
|
|
<foreach collection="distributionStockArticleVO.clientIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
</where> |
|
|
|
|
group by ldsa.id |
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
@ -795,11 +911,6 @@
|
|
|
|
|
ldsa.is_deleted, |
|
|
|
|
ldsa.create_dept, |
|
|
|
|
ldsa.incoming_num, |
|
|
|
|
ldsa.reserve1, |
|
|
|
|
ldsa.reserve2, |
|
|
|
|
ldsa.reserve3, |
|
|
|
|
ldsa.reserve4, |
|
|
|
|
ldsa.reserve5, |
|
|
|
|
ldsa.service_number, |
|
|
|
|
ldsa.order_code, |
|
|
|
|
ldsa.mall_id, |
|
|
|
@ -864,14 +975,11 @@
|
|
|
|
|
ldsa.accept_warehouse_id, |
|
|
|
|
ldsa.accept_warehouse_name, |
|
|
|
|
ldsa.order_delivery_status, |
|
|
|
|
group_concat(DISTINCT lwt.pallet_name) as trays, |
|
|
|
|
group_concat(DISTINCT lwug.position_code) as allocation |
|
|
|
|
group_concat(DISTINCT ldpl.pallet ) as trays, |
|
|
|
|
group_concat(DISTINCT ldpl.goods_allocation) as allocation |
|
|
|
|
|
|
|
|
|
from logpm_distribution_stock_article ldsa |
|
|
|
|
left join logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id |
|
|
|
|
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id |
|
|
|
|
left join logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id |
|
|
|
|
left JOIN logpm_warehouse_tray lwt on lwtg.tray_id= lwt.id |
|
|
|
|
<where> |
|
|
|
|
ldsa.is_deleted = 0 and ldsa.order_status IN ( '10', '20', '30', '40', '50', '60', '70' ) |
|
|
|
|
and ldsa.hand_quantity > 0 |
|
|
|
@ -1780,6 +1888,134 @@
|
|
|
|
|
AND ldbs.order_status != 2 |
|
|
|
|
GROUP BY ldbs.bill_lading_id |
|
|
|
|
</select> |
|
|
|
|
<select id="exportMallOrder" resultType="com.logpm.distribution.entity.DistributionStockArticleEntity"> |
|
|
|
|
select ldsa.id, |
|
|
|
|
ldsa.tenant_id, |
|
|
|
|
ldsa.create_user, |
|
|
|
|
ldsa.create_time, |
|
|
|
|
ldsa.update_user, |
|
|
|
|
ldsa.update_time, |
|
|
|
|
ldsa.status, |
|
|
|
|
ldsa.is_deleted, |
|
|
|
|
ldsa.create_dept, |
|
|
|
|
ldsa.incoming_num, |
|
|
|
|
ldsa.service_number, |
|
|
|
|
ldsa.order_code, |
|
|
|
|
ldsa.mall_id, |
|
|
|
|
ldsa.mall_code, |
|
|
|
|
ldsa.mall_name, |
|
|
|
|
ldsa.store_name, |
|
|
|
|
ldsa.store_code, |
|
|
|
|
ldsa.store_id, |
|
|
|
|
ldsa.description_goods, |
|
|
|
|
ldsa.warehouse_id, |
|
|
|
|
ldsa.warehouse, |
|
|
|
|
ldsa.warehouse_entry_time, |
|
|
|
|
ldsa.store_time, |
|
|
|
|
ldsa.total_number, |
|
|
|
|
ldsa.hand_quantity, |
|
|
|
|
ldsa.complete_set, |
|
|
|
|
ldsa.brand, |
|
|
|
|
ldsa.type_service, |
|
|
|
|
ldsa.customer_name, |
|
|
|
|
ldsa.customer_telephone, |
|
|
|
|
ldsa.customer_address, |
|
|
|
|
ldsa.genre, |
|
|
|
|
ldsa.stockup_status, |
|
|
|
|
ldsa.reservation_status, |
|
|
|
|
ldsa.order_status, |
|
|
|
|
ldsa.grounding_status, |
|
|
|
|
ldsa.order_receive_status, |
|
|
|
|
ldsa.freeze_status, |
|
|
|
|
ldsa.notification, |
|
|
|
|
ldsa.fee, |
|
|
|
|
ldsa.rate, |
|
|
|
|
ldsa.advance_id, |
|
|
|
|
ldsa.waybill_id, |
|
|
|
|
ldsa.waybill_number AS waybillNumber, |
|
|
|
|
ldsa.consignee_unit, |
|
|
|
|
ldsa.collect_fee, |
|
|
|
|
ldsa.storage_fee, |
|
|
|
|
ldsa.consignee_person, |
|
|
|
|
ldsa.consignee_address, |
|
|
|
|
ldsa.consignee_mobile, |
|
|
|
|
ldsa.warehouse_entry_time_end, |
|
|
|
|
ldsa.sorting_quantity, |
|
|
|
|
ldsa.delivery_quantity, |
|
|
|
|
ldsa.transfer_quantity, |
|
|
|
|
ldsa.signin_quantity, |
|
|
|
|
ldsa.resource, |
|
|
|
|
ldsa.is_opai, |
|
|
|
|
ldsa.inventory_date, |
|
|
|
|
ldsa.inventory_person, |
|
|
|
|
ldsa.inventory_person_id, |
|
|
|
|
ldsa.available_quantity, |
|
|
|
|
ldsa.is_have_data, |
|
|
|
|
ldsa.stock_article_code, |
|
|
|
|
group_concat(DISTINCT ldpl.dealer_name) as dealerName, |
|
|
|
|
ldsa.dealer_code, |
|
|
|
|
ldsa.train_number, |
|
|
|
|
ldsa.factory_train, |
|
|
|
|
ldsa.sending, |
|
|
|
|
ldsa.send_warehouse_id, |
|
|
|
|
ldsa.send_warehouse_name, |
|
|
|
|
ldsa.is_zero, |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
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' |
|
|
|
|
<if test="param.warehouseId != null and param.warehouseId != ''"> |
|
|
|
|
and ldsa.warehouse_id = #{param.warehouseId} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.warehouseIds != null "> |
|
|
|
|
and ldsa.warehouse_id in |
|
|
|
|
<foreach collection="param.warehouseIds" item="wIitem" index="index" open="(" close=")" separator=","> |
|
|
|
|
#{wIitem} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.waybillNumber != null and param.waybillNumber != ''">and ldpl.waybill_number = |
|
|
|
|
#{param.waybillNumber} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderCode != null and param.orderCode != ''">and ldsa.order_code = #{param.orderCode}</if> |
|
|
|
|
<if test="param.mallName != null and param.mallName != ''">and ldsa.mall_name = #{param.mallName}</if> |
|
|
|
|
<if test="param.typeService != null and param.typeService != ''">and ldsa.type_service = |
|
|
|
|
#{param.typeService} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.consigneeUnit != null and param.consigneeUnit != ''">and ldsa.consignee_unit = |
|
|
|
|
#{param.consigneeUnit} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.trainNumber != null and param.trainNumber != ''">and ldsa.train_number = |
|
|
|
|
#{param.trainNumber} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.acceptWarehouseName != null and param.acceptWarehouseName != ''">and |
|
|
|
|
ldsa.accept_warehouse_name = #{param.acceptWarehouseName} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.serviceNumber != null and param.serviceNumber != ''"> |
|
|
|
|
and ldsa.service_number = #{param.serviceNumber} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.clientIds != null and param.handQuantity != ''"> |
|
|
|
|
and ldsa.mall_id in |
|
|
|
|
<foreach collection="param.clientIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderIds != null "> |
|
|
|
|
and ldsa.id in |
|
|
|
|
<foreach collection="param.orderIds" item="wIitem" index="index" open="(" close=")" separator=","> |
|
|
|
|
#{wIitem} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
group by ldsa.id |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<update id="clearTraysByIds" > |
|
|
|
|
update logpm_distribution_stock_article |
|
|
|
|