GROUP_CONCAT(DISTINCT lapr.result_type) AS resultTypes,
GROUP_CONCAT(DISTINCT lapr.result_type) AS resultTypes,
GROUP_CONCAT(DISTINCT lapr.compensation_method) AS compensationMethods
GROUP_CONCAT(DISTINCT lapr.compensation_method) AS compensationMethods
FROM
FROM
@ -113,8 +114,8 @@
AND b.is_deleted = 0
AND b.is_deleted = 0
GROUP BY
GROUP BY
a.id) AS t ON t.id = lawo.id
a.id) AS t ON t.id = lawo.id
LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id AND lapr.is_deleted = 0
LEFT JOIN logpm_aftersales_processor AS lap ON lawo.id = lap.work_order_id AND lap.is_deleted = 0
LEFT JOIN logpm_aftersales_processor AS lap ON lawo.id = lap.work_order_id AND lap.is_deleted = 0
LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id AND lapr.is_deleted = 0 AND lap.types_of != '3' AND lap.types_of != '3'
<where>
<where>
lawo.is_deleted = 0
lawo.is_deleted = 0
<iftest="param.workOrderNumbers != null and param.workOrderNumbers != '' ">
<iftest="param.workOrderNumbers != null and param.workOrderNumbers != '' ">
@ -132,6 +133,7 @@
<iftest="param.startCreateTime != null and param.endCreateTime != null ">
<iftest="param.startCreateTime != null and param.endCreateTime != null ">
and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime}
and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime}
GROUP_CONCAT(DISTINCT lapr.result_type) AS resultTypes,
GROUP_CONCAT(DISTINCT lapr.result_type) AS resultTypes,
IFNULL( sum( lapr.money ), 0 ) AS totalAmountNum,
IFNULL( sum( lapr.money ), 0 ) AS totalAmountNum,
lawo.ceator,
lawo.ceator,
IF(lawo.work_order_status = '80',lawo.update_time,'') AS '完结时间',
lawo.compensation_money totalAmountNum,
IF(lawo.work_order_status = '100','是','否') AS '是否申述',
IF(lawo.work_order_status = '80',lawo.update_time,'') AS completeTime,
IF(lawo.work_order_status = '100','是','否') AS isAppeal,
lawo.process_number,
lawo.process_number,
IF(lawo.work_order_status = '100',(SELECT CASE types_of
IF(lawo.work_order_status = '100',(SELECT CASE types_of
WHEN 0 THEN '待处理'
WHEN 0 THEN '待处理'
WHEN 1 THEN '成立'
WHEN 1 THEN '成立'
WHEN 2 THEN '驳回'
WHEN 2 THEN '驳回'
WHEN 3 THEN '取消'
WHEN 3 THEN '取消'
ELSE
ELSE
'未知审核状态'
'未知审核状态'
END aaa
END aaa
FROM logpm_aftersales_appeal WHERE word_order_id = lawo.id AND is_deleted = 0 AND types_of != 3 ORDER BY create_time DESC LIMIT 1),'未申述') AS '申述状态'
FROM logpm_aftersales_appeal WHERE word_order_id = lawo.id AND is_deleted = 0 AND types_of != 3 ORDER BY create_time DESC LIMIT 1),'未申述') AS appealStatusName,
lawo.warehouse_service_name,
lawo.headquarters_name
FROM
FROM
logpm_aftersales_work_order lawo
logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id
LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id
AND lap.types_of = '2'
AND lap.types_of = '2'
AND lap.conditions IN ( 1, 2 )
AND lap.conditions IN ( 1, 2 )
AND lap.is_deleted = 0
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id
AND lacr.is_deleted = '0'
AND lacr.is_deleted = 0
LEFT JOIN (SELECT
LEFT JOIN (SELECT
a.id,
a.id,
group_concat( DISTINCT b.`first` SEPARATOR ',' ) AS `first`,
group_concat( DISTINCT b.`first` SEPARATOR ',' ) AS `first`,
@ -1143,7 +1149,93 @@
GROUP BY
GROUP BY
a.id) AS t ON t.id = lawo.id
a.id) AS t ON t.id = lawo.id
LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id AND lapr.is_deleted = 0
LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id AND lapr.is_deleted = 0
LEFT JOIN logpm_aftersales_person_responsible AS laprr ON laprr.word_order_id = lawo.id
LEFT JOIN logpm_aftersales_person_responsible AS laprr ON laprr.word_order_id = lawo.id AND laprr.is_deleted = '0'
<where>
lawo.is_deleted = 0
<iftest="param.workOrderNumbers != null and param.workOrderNumbers != '' ">
<iftest="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if>
<iftest="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </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>