<iftest="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if>
<iftest="param.waybillNumber != null and param.waybillNumber != '' ">and lawo.waybill_number like concat('%', #{param.waybillNumber },'%') </if>
<iftest="param.orderCode != null and param.orderCode != '' ">and lawo.order_code like concat('%', #{param.orderCode },'%') </if>
<iftest="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </if>
<iftest="param.first != null and param.first != '' ">and lawo.first like concat('%', #{param.first },'%') </if>
<iftest="param.secondary != null and param.secondary != '' ">and lawo.secondary like concat('%', #{param.secondary },'%') </if>
<iftest="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<iftest="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<iftest="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>
<iftest="param.first != null and param.first != '' ">and t.first like concat('%',#{param.first},'%') </if>
<iftest="param.secondary != null and param.secondary != '' ">and t.secondary like concat('%',#{param.secondary},'%') </if>
<iftest="param.brandName != null and param.brandName != '' ">and t.brand_name like concat('%',#{param.brandName},'%') </if>
<iftest="param.waybillNumber != null and param.waybillNumber != ''">and t.waybill_number like concat('%',#{param.waybillNumber},'%') </if>
<iftest="param.packageCode != null and param.packageCode != ''">and t.package_code like concat('%',#{param.packageCode},'%') </if>
</where>
group by lawo.id
ORDER BY lawo.create_time DESC
@ -320,11 +331,8 @@
law.initiation_identification,
law.discovery_node,
law.work_order_number,
law.waybill_number,
law.order_code,
law.train_number,
laap.FIRST,
laap.secondary,
law.vehicle_route,
law.deliver_goods_time,
law.discovery_time,
@ -346,26 +354,41 @@
law.audit_time,
law.entry_time,
law.operator,
laap.brand_name
t.`first` AS `first`,
t.secondary AS secondary,
t.brand_name AS brandName,
t.waybill_number AS waybillNumber,
t.package_code AS packageCode
FROM
logpm_aftersales_processor lap
LEFT JOIN logpm_aftersales_work_order law ON lap.work_order_id = law.id
left join logpm_aftersales_abnormal_package laap on laap.work_order_id=law.id
LEFT JOIN (SELECT
a.id,
group_concat( DISTINCT b.`first` SEPARATOR ',' ) AS `first`,
group_concat( DISTINCT b.secondary SEPARATOR ',' ) AS secondary,
group_concat( DISTINCT b.brand_name SEPARATOR ',' ) AS brand_name,
group_concat( DISTINCT b.package_code SEPARATOR ',' ) AS package_code,
group_concat( DISTINCT b.waybill_number SEPARATOR ',' ) AS waybill_number
FROM
logpm_aftersales_work_order AS a
LEFT JOIN logpm_aftersales_abnormal_package AS b ON a.id = b.work_order_id
WHERE
a.is_deleted = 0
AND b.is_deleted = 0
GROUP BY
a.id) AS t ON t.id = law.id
<where>
lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null and lap.processing_status in ('1','3') and lap.types_of = '2' and law.work_order_status in ('10','20','30')
<iftest="param.workOrderStatus != null and param.workOrderStatus != ''">and law.work_order_status = #{param.workOrderStatus}</if>
<iftest="param.warehouseId != null and param.warehouseId != ''">and lap.business_id = #{param.warehouseId}</if>
<iftest="param.workOrderType != null and param.workOrderType != ''">and law.work_order_type = #{param.workOrderType}</if>
<iftest="param.discoveryNode != null and param.discoveryNode != ''">and law.discovery_node = #{param.discoveryNode}</if>
<iftest="param.workOrderNumber != null and param.workOrderNumber != ''">and law.work_order_number like concat('%',#{param.workOrderNumber},'%')</if>
<iftest="param.waybillNumber != null and param.waybillNumber != ''">and law.waybill_number like concat('%',#{param.waybillNumber},'%')</if>
<iftest="param.orderCode != null and param.orderCode != ''">and law.order_code like concat('%',#{param.orderCode},'%')</if>
<iftest="param.first != null and param.first != ''">and laap.first like concat('%',#{param.first},'%')</if>
<iftest="param.secondary != null and param.secondary != ''">and laap.secondary like concat('%',#{param.secondary},'%')</if>
<iftest="param.waybillMall != null and param.waybillMall != ''">and law.waybill_mall like concat('%',#{param.waybillMall},'%')</if>
<iftest="param.brandName != null and param.brandName != ''">and law.brand_name like concat('%',#{param.brandName},'%')</if>
<iftest="param.customerServiceName != null and param.customerServiceName != ''">and law.customer_service_name like concat('%',#{param.customerServiceName},'%')</if>
<iftest="param.deliveryDriver != null and param.deliveryDriver != '' ">and law.delivery_driver like concat('%',#{param.deliveryDriver},'%') </if>
<iftest="param.trainNumber != null and param.trainNumber != '' ">and law.train_number like concat('%', #{param.trainNumber },'%') </if>