|
|
|
@ -2057,4 +2057,169 @@
|
|
|
|
|
and waybill_number = #{waybillNo} |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="pageListOweTransfer" 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.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, |
|
|
|
|
ldsa.waybill_number 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 ) |
|
|
|
|
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.order_status in ('10','20','30','40','50','60','70') |
|
|
|
|
and ldsa.hand_quantity > 0 |
|
|
|
|
<if test="param.orderCodeNumList != null"> |
|
|
|
|
and ldsa.order_code in |
|
|
|
|
<foreach collection="param.orderCodeNumList" separator="," close=")" item="a" open="("> |
|
|
|
|
#{a} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="warehouseIds != null"> |
|
|
|
|
and ldsa.warehouse_id in |
|
|
|
|
<foreach collection="warehouseIds" item="s" open="(" close=")" separator=","> |
|
|
|
|
#{s} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.orderCodeNumLike != '' and param.orderCodeNumLike != null ">and ldsa.order_code like |
|
|
|
|
concat('%',#{param.orderCodeNumLike},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.brand != '' and param.brand != null ">and ldsa.brand like |
|
|
|
|
concat(#{param.brand},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.reservation != '' and param.reservation != null "> |
|
|
|
|
and ldsa.reservation_status in (10,20) and ldpl.order_package_reservation_status = 10 |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.waybillNumList != null "> |
|
|
|
|
and ldpl.waybill_number in |
|
|
|
|
<foreach collection="param.waybillNumList" open="(" item="a" close=")" separator=","> |
|
|
|
|
#{a} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.consigneeUnit != null and param.consigneeUnit != '' "> |
|
|
|
|
and ldsa.consignee_unit like concat('%',#{param.consigneeUnit},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.waybillNumLike != '' and param.waybillNumLike != null ">and ldsa.waybill_number like |
|
|
|
|
concat('%',#{param.waybillNumLike},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.typeService != '' and param.typeService != null "> |
|
|
|
|
and ldsa.type_service =#{param.typeService} |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test=" param.idsList != null ">and ldsa.id in |
|
|
|
|
<foreach collection="param.idsList" open="(" item="a" close=")" separator=","> |
|
|
|
|
#{a} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.idsLike != '' and param.idsLike != null ">and ldsa.id = #{param.idsLike}</if> |
|
|
|
|
<if test=" param.reservationStatus != '' and param.reservationStatus != null ">and ldsa.reservation_status |
|
|
|
|
= #{param.reservationStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.startDate != null ">and ldsa.warehouse_entry_time between #{param.startDate} and |
|
|
|
|
#{param.entDate} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.warehouseEntryTime != null ">and DATE(ldsa.warehouse_entry_time) = |
|
|
|
|
#{param.warehouseEntryTime} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.warehouseEntryTimeEnd != null ">and DATE(ldsa.warehouse_entry_time) = |
|
|
|
|
#{param.warehouseEntryTimeEnd} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.inventoryDate != null ">and DATE(ldsa.inventory_date) = #{param.inventoryDate}</if> |
|
|
|
|
<if test=" param.serviceNumber != null and param.serviceNumber != '' ">and ldsa.service_number like |
|
|
|
|
concat('%',#{param.serviceNumber},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.orderCode != null and param.orderCode != '' ">and ldsa.order_code like |
|
|
|
|
concat('%',#{param.orderCode},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.waybillNumber != null and param.waybillNumber != '' ">and ldpl.waybill_number like |
|
|
|
|
concat('%',#{param.waybillNumber},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.mallName != null and param.mallName != '' ">and ldsa.mall_name like |
|
|
|
|
concat('%',#{param.mallName},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.descriptionGoods != null and param.descriptionGoods != '' ">and ldsa.description_goods |
|
|
|
|
like concat('%',#{param.descriptionGoods},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.warehouse != null and param.warehouse != '' ">and ldsa.warehouse like |
|
|
|
|
concat('%',#{param.warehouse},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.consigneePerson != null and param.consigneePerson != '' ">and ldsa.consignee_person like |
|
|
|
|
concat('%',#{param.consigneePerson},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.availableQuantity != null ">and ldsa.available_quantity like |
|
|
|
|
concat('%',#{param.availableQuantity},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.groundingStatus != null and param.groundingStatus != '' ">and ldsa.grounding_status = |
|
|
|
|
#{param.groundingStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.genre != null and param.genre != '' ">and ldsa.genre=#{param.genre}</if> |
|
|
|
|
<if test=" param.freezeStatus != null and param.freezeStatus != '' ">and ldsa.freeze_status = |
|
|
|
|
#{param.freezeStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.orderStatus != null and param.orderStatus != '' ">and ldsa.order_status = |
|
|
|
|
#{param.orderStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.reservationStatus != null and param.reservationStatus != '' ">and ldsa.reservation_status = |
|
|
|
|
#{param.reservationStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.stockupStatus != null and param.stockupStatus != '' ">and ldsa.stockup_status = |
|
|
|
|
#{param.stockupStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.notification != null and param.notification != '' ">and ldsa.notification = |
|
|
|
|
#{param.notification} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.orderReceiveStatus != null and param.orderReceiveStatus != '' ">and ldsa.order_receive_status |
|
|
|
|
= |
|
|
|
|
#{param.orderReceiveStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.completeSet != null ">and ldsa.complete_set =#{param.completeSet} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.customerName != null and param.customerName != '' ">and ldsa.customer_name like |
|
|
|
|
concat('%',#{param.customerName},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.isZero != null and param.isZero != '' "> |
|
|
|
|
and ldsa.is_zero = #{param.isZero} |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.customerTelephone != null and param.customerTelephone != '' ">and |
|
|
|
|
ldsa.customer_telephone like concat('%',#{param.customerTelephone},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.customerAddress != null and param.customerAddress != '' ">and ldsa.customer_address like |
|
|
|
|
concat('%',#{param.customerAddress},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.trays != null and param.trays != '' "> |
|
|
|
|
and ldsa.trays like concat('%',#{param.trays},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test=" param.allocation != null and param.allocation != '' "> |
|
|
|
|
and ldsa.allocation like concat('%',#{param.allocation},'%') |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
group by ldsa.id |
|
|
|
|
HAVING sum(ldpl.is_transfer) > 0 |
|
|
|
|
order by ldsa.warehouse_entry_time desc |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
|