|
@@ -11,10 +11,11 @@
|
|
|
<select id="getRoute"
|
|
|
resultType="cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectRouteDO">
|
|
|
select* from (select * from (select route.route_name, device.device_name, device.id device_id,route.id, route.item_json,route.create_time,device.dept_id, device.device_code from
|
|
|
- (select * from rq_iot_inspect_route where device_id is null) route
|
|
|
- left join rq_iot_device device on route.device_classify = device.asset_class)a where a.device_id not in (select device_id from rq_iot_inspect_route where device_id is not null)
|
|
|
+ (select * from rqiot.rq_iot_inspect_route where device_id is null and deleted=0) route
|
|
|
+ left join (select * from rqiot.rq_iot_device where deleted=0) device on route.device_classify = device.asset_class)a where a.device_id not in (select device_id from rqiot.rq_iot_inspect_route where device_id is not null)
|
|
|
union all
|
|
|
- select route_name, device_name, device_id,id,item_json,create_time,dept_id,device_code from rq_iot_inspect_route where device_id is not null)fin
|
|
|
+ select route_name, device_name, device_id,id,item_json,create_time,dept_id,device_code from rqiot.rq_iot_inspect_route where device_id is not null
|
|
|
+ and deleted=0)fin
|
|
|
<where>
|
|
|
<if test="reqVO.deviceName!=null and reqVO.deviceName!=''">
|
|
|
and fin.device_name LIKE CONCAT('%',#{reqVO.deviceName},'%')
|