<iftest="param.customerIdentification != null and param.customerIdentification == 1 ">
and lawo.work_order_status IN ( '10', '20', '21', '30', '40', '50', '60', '70', '80', '90' ,'100','110')
</if>
<iftest="param.handleStatus != null "> or 1=1 </if>
<iftest="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<iftest="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') and lap.types_of = '2' </if>
<iftest="param.handleStatus!= null and param.handleStatus == 30"> and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<iftest="param.handleStatus!= null and param.handleStatus == 20 ">and ((lawo.work_order_status in (80,100,70) OR lacr.warehouse_id=#{param.warehouseId}) AND lawo.warehouse_id =#{param.warehouseId} ) </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.warehouseId != null and param.warehouseId != '' and param.handleStatus != 20 "> and lap.business_id = #{param.warehouseId} </if>
<iftest="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<!-- <if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.customerServiceState == null "> and lawo.work_order_status in ( #{param.workOrderStatus }) and lap.types_of = '2' </if>-->
<iftest="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<iftest="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') and lap.types_of = '2' </if>
<iftest="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<iftest="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100,70) and lacr.warehouse_id=#{param.warehouseId} </if>
<iftest="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>
<iftest="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>