las.processing_status = '4' and las.is_deleted = 0
<iftest="param.businessId != null"> and las.business_id LIKE CONCAT('%', #{param.businessId}, '%')</if>
<iftest="param.businessName != null and param.businessName != ''"> and las.business_name LIKE CONCAT('%', #{param.businessName}, '%')</if>
<iftest="param.workOrderNumber != null and param.workOrderNumber != ''"> and las.work_order_number LIKE CONCAT('%', #{param.workOrderNumber}, '%')</if>
<iftest="param.businessId != null"> and las.business_id =#{param.businessId</if>
<iftest="param.businessName != null and param.businessName != ''"> and las.business_name LIKE CONCAT( #{param.businessName}, '%')</if>
<iftest="param.workOrderNumber != null and param.workOrderNumber != ''"> and las.work_order_number LIKE CONCAT( #{param.workOrderNumber}, '%')</if>
<iftest="param.brandName != null and param.brandName != ''"> and las.brand_name LIKE CONCAT('%', #{param.brandName}, '%')</if>
<iftest="param.mallName != null and param.mallName != ''"> and las.mall_name LIKE CONCAT('%', #{param.mallName}, '%')</if>
<iftest="param.waybillNumber != null and param.waybillNumber != ''"> and las.waybill_number LIKE CONCAT('%', #{param.waybillNumber}, '%')</if>
logpm_aftersales_processor lap on lap.work_order_id= lawo.id
left join logpm_aftersales_abnormal_package laap on laap.work_order_id=lawo.id
LEFT JOIN `logpm_distribution_parcel_list` `ldpl` ON `ldpl`.`order_package_code` = `laap`.`package_code`
LEFT JOIN `logpm_distribution_stock_article` `ldsa` ON `ldsa`.`id` = `ldpl`.`stock_article_id`
LEFT JOIN `logpm_aftersales_processing_results` `lapr` ON `lapr`.`work_order_id` = `lap`.`work_order_id`
LEFT JOIN `logpm_aftersales_completion_record` `lacr` ON `lacr`.`work_order_id` = `lapr`.`work_order_id`
<where>
`lawo`.`work_order_status` = 90 and lap.is_deleted = 0
<iftest="param.businessId != null"> and lap.business_id =#{param.businessId}</if>
<iftest="param.businessName != null and param.businessName != ''"> and lap.business_name LIKE CONCAT( #{param.businessName}, '%')</if>
<iftest="param.workOrderNumber != null and param.workOrderNumber != ''"> and lawo.work_order_number LIKE CONCAT( #{param.workOrderNumber}, '%')</if>
<iftest="param.brandName != null and param.brandName != ''"> and ldpl.brand_name LIKE CONCAT('%', #{param.brandName}, '%')</if>
<iftest="param.mallName != null and param.mallName != ''"> and ldsa.mall_name LIKE CONCAT('%', #{param.mallName}, '%')</if>
<iftest="param.waybillNumber != null and param.waybillNumber != ''"> and laap.waybill_number LIKE CONCAT('%', #{param.waybillNumber}, '%')</if>
<iftest="param.workOrderType != null and param.workOrderType != ''"> and lawo.work_order_type LIKE CONCAT('%', #{param.workOrderType}, '%')</if>
<iftest="param.resultType != null and param.resultType != ''"> and lapr.result_type LIKE CONCAT('%', #{param.resultType}, '%')</if>
<iftest="param.discoveryNode != null and param.discoveryNode != ''"> and lawo.discovery_node LIKE CONCAT('%', #{param.discoveryNode}, '%')</if>
<iftest="param.resultDescription != null and param.resultDescription != ''"> and lapr.result_description LIKE CONCAT('%', #{param.resultDescription}, '%')</if>
<iftest="param.vehicleRoute != null and param.vehicleRoute != ''"> and lawo.vehicle_route LIKE CONCAT('%', #{param.vehicleRoute}, '%')</if>
<iftest="param.indemnitor != null and param.indemnitor != ''"> and lacr.indemnitor LIKE CONCAT('%', #{param.indemnitor}, '%')</if>
<iftest="param.reason != null and param.reason != ''"> and lacr.reason LIKE CONCAT('%', #{param.reason}, '%')</if>
<iftest="param.createTime != null "> and date_format(from_unixtime(lawo.create_time),'%Y-%m-%d') LIKE date_format(CONCAT('%', #{param.createTime}, '%'),'%Y-%m-%d')</if>
<iftest="param.processNumber != null and param.processNumber != ''"> and lawo.process_number LIKE CONCAT('%', #{param.processNumber}, '%')</if>