|
@@ -17,7 +17,8 @@
|
|
|
r.id,
|
|
|
r.item_json,
|
|
|
r.create_time,
|
|
|
- d.dept_id,d.device_code
|
|
|
+ d.dept_id,d.device_code,
|
|
|
+ d.brand_name
|
|
|
FROM
|
|
|
rq_iot_inspect_route r
|
|
|
LEFT JOIN rq_iot_device d
|
|
@@ -32,10 +33,13 @@
|
|
|
SELECT 1 FROM rq_iot_inspect_route i
|
|
|
WHERE i.device_id = d.id
|
|
|
)
|
|
|
- AND d.id IS NOT NULL and r.deleted=0 and d.deleted=0 and p.deleted=0
|
|
|
+ AND d.id IS NOT NULL and r.deleted=0 and d.deleted=0 and p.deleted=0 and r.brand is null
|
|
|
union all
|
|
|
- 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
|
|
|
+ select route_name, device_name, device_id,id,item_json,create_time,dept_id,device_code,brand_name from rqiot.rq_iot_inspect_route
|
|
|
+ where device_id is not null and deleted=0
|
|
|
+ union all
|
|
|
+ select li.route_name,de.device_name,de.id device_id, li.id, li.item_json, li.create_time, de.dept_id, de.device_code,li.brand_name from rq_iot_inspect_route li left join rq_iot_device de on li.brand=de.brand where li.brand is not null and li.deleted=0 and de.deleted=0
|
|
|
+ )fin
|
|
|
<where>
|
|
|
<if test="reqVO.deviceName!=null and reqVO.deviceName!=''">
|
|
|
and fin.device_name LIKE CONCAT('%',#{reqVO.deviceName},'%')
|
|
@@ -46,6 +50,12 @@
|
|
|
<if test="reqVO.routeName!=null and reqVO.routeName!=''">
|
|
|
and fin.route_name LIKE CONCAT('%',#{reqVO.routeName},'%')
|
|
|
</if>
|
|
|
+ <if test="reqVO.brandName!=null and reqVO.brandName!=''">
|
|
|
+ and fin.brand_name LIKE CONCAT('%',#{reqVO.brandName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="reqVO.deptId!=null and reqVO.deptId!=''">
|
|
|
+ and fin.dept_id LIKE CONCAT('%',#{reqVO.deptId},'%')
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
</mapper>
|