Commit 9b6fabf3 authored by 高建强's avatar 高建强

item:修改三维查询及日志级别

parent b6f2857e
...@@ -1860,7 +1860,7 @@ ...@@ -1860,7 +1860,7 @@
LIMIT ${start},${length} LIMIT ${start},${length}
</select> </select>
<select id="retrieve3AllCount" resultType="long"> <select id="retrieve3AllCount" resultType="long">
SELECT COUNT(1) FROM ( SELECT count(1) FROM (
SELECT SELECT
concat('fireCar-', car.id) AS id, concat('fireCar-', car.id) AS id,
concat(car.id) AS originId, concat(car.id) AS originId,
...@@ -1874,6 +1874,7 @@ ...@@ -1874,6 +1874,7 @@
'消防车' AS typeName, '消防车' AS typeName,
'fireEquipment' AS typeCode, 'fireEquipment' AS typeCode,
car.`name` AS label, car.`name` AS label,
car.`name` AS protectObjName,
'' AS routeName, '' AS routeName,
'' AS areaId, '' AS areaId,
'' AS person, '' AS person,
...@@ -1887,25 +1888,26 @@ ...@@ -1887,25 +1888,26 @@
LEFT JOIN wl_equipment_category AS cat ON equ.category_id = cat.id LEFT JOIN wl_equipment_category AS cat ON equ.category_id = cat.id
UNION ALL UNION ALL
SELECT SELECT
concat( 'riskSource-', r.id ) AS id, concat('riskSource-', r.id) AS id,
concat( r.id ) AS originId, concat(r.id) AS originId,
r.name, r.`name`,
r.code, r.`code`,
'riskSource' AS type, 'riskSource' AS type,
r.org_code as orgCode, r.org_code AS orgCode,
rl.LEVEL AS LEVEL, rl.`level` AS level,
rl.name AS levelStr, rl.`name` AS levelStr,
r.is_indoor AS isIndoor, r.is_indoor AS isIndoor,
'风险点' AS typeName, '风险点' AS typeName,
'riskSource' AS typeCode, 'riskSource' AS typeCode,
r.name AS label, r.`name` AS label,
'' AS routeName, r.`name` AS protectObjName,
'' AS person, '' AS routeName,
r.rpn AS title, '' AS areaId,
CONCAT( 'riskSource-', r.id ) AS `key`, '' AS person,
r.id AS riskSourceId, r.rpn AS title,
null AS areaId, CONCAT('riskSource-', r.id) AS `key`,
'' AS room r.id AS riskSourceId,
'' AS room
FROM FROM
f_risk_source r f_risk_source r
LEFT JOIN f_risk_level rl ON rl.id = r.risk_level_id LEFT JOIN f_risk_level rl ON rl.id = r.risk_level_id
...@@ -1916,50 +1918,10 @@ ...@@ -1916,50 +1918,10 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
concat( 'patrol-', p.id ) AS id,
concat( p.id ) AS originId,
p.name,
p.point_no AS CODE,
'patrol' AS type,
p.org_code as orgCode,
p.status AS level,
CONCAT( 'level_', p.status ) AS levelStr,
p.is_indoor AS isIndoor,
'巡检点' AS typeName,
'patrol' AS typeCode,
p.name AS label,
p.route_name AS routeName,
p.charge_person_id AS person,
CASE
WHEN p.status = '0' THEN
'未执行'
WHEN p.status = '1' THEN
'合格'
WHEN p.status = '2' THEN
'不合格'
WHEN p.status = '3' THEN
'漏检'
END AS title,
concat( 'patrol-', p.id ) AS `key`,
p.risk_source_id AS riskSourceId,
p.area_id AS areaId,
r.name AS room
FROM
p_point p
LEFT JOIN f_risk_source r ON r.id = p.risk_source_id
<where>
is_delete = FALSE
<if test="areaId != null">
AND p.area_id = #{areaId}
</if>
</where>
UNION ALL
SELECT
concat('video-', vi.id) AS id, concat('video-', vi.id) AS id,
concat(vi.id) AS originId, concat(vi.id) AS originId,
vi.name, vi.`name`,
vi.code, vi.`code`,
'video' AS type, 'video' AS type,
vi.org_code AS orgCode, vi.org_code AS orgCode,
'' AS level, '' AS level,
...@@ -1967,42 +1929,84 @@ ...@@ -1967,42 +1929,84 @@
'' AS isIndoor, '' AS isIndoor,
'摄像头' AS typeName, '摄像头' AS typeName,
'video' AS typeCode, 'video' AS typeCode,
vi.`name` AS label, vi.`name` AS label,
'' AS routeName, vi.`name` AS protectObjName,
'' AS person, '' AS routeName,
vi.`name` AS title, vi.belongAreaId AS areaId,
concat('video-', vi.id) AS `key`, '' AS person,
'' AS riskSourceId, vi.`name` AS title,
vi.belongAreaId as areaId, concat('video-', vi.id) AS `key`,
vi.address AS room '' AS riskSourceId,
vi.address AS room
FROM FROM
wl_video AS vi wl_video AS vi
<where> <where>
<if test="areaId != null"> <if test="areaId != null and areaId !=0">
vi.belongAreaId = #{areaId} vi.belongAreaId = #{areaId}
</if> </if>
</where> </where>
UNION ALL UNION ALL
SELECT SELECT
concat( 'fireEquipment-', m.id ) AS id, concat('patrol-', p.id) AS id,
concat( m.id ) AS originId, concat(p.id) AS originId,
det.name, p.`name`,
m.CODE AS CODE, p.point_no AS CODE,
'fireEquipment' AS type, 'patrol' AS type,
m.org_code as orgCode, p.org_code AS orgCode,
NULL AS LEVEL, p.`status` AS level,
concat( 'level_', NULL ) AS levelStr, CONCAT('level_', p.STATUS) AS levelStr,
NULL AS isIndoor, p.is_indoor AS isIndoor,
'消防设备' AS typeName, '巡检点' AS typeName,
'fireEquipment' AS typeCode, 'patrol' AS typeCode,
det.name AS label, p.`name` AS label,
'' AS routeName, p.`name` AS protectObjName,
'' AS person, p.route_name AS routeName,
det.name AS title, p.area_id AS areaId,
concat( 'fireEquipment-', m.id ) AS `key`, p.charge_person_id AS person,
'' AS riskSourceId, CASE
m.area_id AS areaId, WHEN p.`status` = '0' THEN
str.full_name AS room '未执行'
WHEN p.`status` = '1' THEN
'合格'
WHEN p.`status` = '2' THEN
'不合格'
WHEN p.`status` = '3' THEN
'漏检'
END AS title,
concat('patrol-', p.id) AS `key`,
p.risk_source_id AS riskSourceId,
r.full_name AS room
FROM
p_point p
LEFT JOIN wl_warehouse_structure r ON r.id = p.risk_source_id
<where>
is_delete = FALSE
<if test="areaId != null and areaId !=0">
AND p.area_id = #{areaId}
</if>
</where>
UNION ALL
SELECT
concat('fireEquipment-', m.id) AS id,
concat(m.id) AS originId,
det.`name`,
m.`code` AS `code`,
'fireEquipment' AS type,
m.org_code AS orgCode,
'' AS level,
concat('level_', '') AS levelStr,
'' AS isIndoor,
'消防设备' AS typeName,
'fireEquipment' AS typeCode,
det.`name` AS label,
det.`name` AS protectObjName,
'' AS routeName,
m.area_id AS areaId,
'' AS person,
det.`name` AS title,
concat('fireEquipment-', m.id) AS `key`,
risk.id AS riskSourceId,
str.full_name AS room
FROM FROM
wl_equipment_specific m wl_equipment_specific m
LEFT JOIN wl_equipment_detail AS det ON m.equipment_detail_id = det.id LEFT JOIN wl_equipment_detail AS det ON m.equipment_detail_id = det.id
...@@ -2010,11 +2014,12 @@ ...@@ -2010,11 +2014,12 @@
LEFT JOIN wl_equipment_category AS cat ON equ.category_id = cat.id LEFT JOIN wl_equipment_category AS cat ON equ.category_id = cat.id
LEFT JOIN wl_stock_detail AS sto ON sto.qr_code = m.qr_code LEFT JOIN wl_stock_detail AS sto ON sto.qr_code = m.qr_code
LEFT JOIN wl_warehouse_structure AS str ON sto.warehouse_structure_id = str.source_id LEFT JOIN wl_warehouse_structure AS str ON sto.warehouse_structure_id = str.source_id
LEFT JOIN f_risk_source AS risk ON str.source_id = risk.source_id
<where> <where>
<if test="areaId != null"> <if test="areaId != null and areaId !=0">
m.area_id = #{areaId} m.area_id = #{areaId}
</if> </if>
<if test="equipmentId != null"> <if test="equipmentId != null and equipmentId != 0">
AND equ.id = #{equipmentId} AND equ.id = #{equipmentId}
</if> </if>
</where> </where>
...@@ -2030,7 +2035,7 @@ ...@@ -2030,7 +2035,7 @@
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
AND tmp.typeCode = #{type} AND tmp.typeCode = #{type}
</if> </if>
<if test="riskSourceId != null"> <if test="riskSourceId != null and riskSourceId != ''">
AND tmp.riskSourceId = #{riskSourceId} AND tmp.riskSourceId = #{riskSourceId}
</if> </if>
<if test="orgCode!=null"> <if test="orgCode!=null">
...@@ -2120,7 +2125,7 @@ ...@@ -2120,7 +2125,7 @@
FROM FROM
wl_video AS vi wl_video AS vi
<where> <where>
<if test="areaId != null"> <if test="areaId != null and areaId !=0">
vi.belongAreaId = #{areaId} vi.belongAreaId = #{areaId}
</if> </if>
</where> </where>
...@@ -2160,7 +2165,7 @@ ...@@ -2160,7 +2165,7 @@
LEFT JOIN wl_warehouse_structure r ON r.id = p.risk_source_id LEFT JOIN wl_warehouse_structure r ON r.id = p.risk_source_id
<where> <where>
is_delete = FALSE is_delete = FALSE
<if test="areaId != null"> <if test="areaId != null and areaId !=0">
AND p.area_id = #{areaId} AND p.area_id = #{areaId}
</if> </if>
</where> </where>
...@@ -2195,16 +2200,16 @@ ...@@ -2195,16 +2200,16 @@
LEFT JOIN wl_warehouse_structure AS str ON sto.warehouse_structure_id = str.source_id LEFT JOIN wl_warehouse_structure AS str ON sto.warehouse_structure_id = str.source_id
LEFT JOIN f_risk_source AS risk ON str.source_id = risk.source_id LEFT JOIN f_risk_source AS risk ON str.source_id = risk.source_id
<where> <where>
<if test="areaId != null"> <if test="areaId != null and areaId !=0">
m.area_id = #{areaId} m.area_id = #{areaId}
</if> </if>
<if test="equipmentId != null"> <if test="equipmentId != null and equipmentId != 0">
AND equ.id = #{equipmentId} AND equ.id = #{equipmentId}
</if> </if>
</where> </where>
GROUP BY GROUP BY
m.code) as tmp m.code) as tmp
<where> <where>
<if test="inputText!=null and inputText != ''"> <if test="inputText!=null and inputText != ''">
AND ( AND (
tmp.code LIKE '%${inputText}%' tmp.code LIKE '%${inputText}%'
...@@ -2214,7 +2219,7 @@ ...@@ -2214,7 +2219,7 @@
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
AND tmp.typeCode = #{type} AND tmp.typeCode = #{type}
</if> </if>
<if test="riskSourceId != null"> <if test="riskSourceId != null and riskSourceId != ''">
AND tmp.riskSourceId = #{riskSourceId} AND tmp.riskSourceId = #{riskSourceId}
</if> </if>
<if test="orgCode!=null"> <if test="orgCode!=null">
......
...@@ -32,15 +32,15 @@ ...@@ -32,15 +32,15 @@
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" /> <logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
--> -->
<!--myibatis log configure--> <!--myibatis log configure-->
<logger name="com.apache.ibatis" level="DEBUG"/> <logger name="com.apache.ibatis" level="ERROR"/>
<logger name="org.mybatis" level="DEBUG" /> <logger name="org.mybatis" level="ERROR" />
<logger name="java.sql.Connection" level="DEBUG"/> <logger name="java.sql.Connection" level="ERROR"/>
<logger name="java.sql.Statement" level="DEBUG"/> <logger name="java.sql.Statement" level="ERROR"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/> <logger name="java.sql.PreparedStatement" level="ERROR"/>
<logger name="org.springframework" level="DEBUG"/> <logger name="org.springframework" level="ERROR"/>
<!-- 日志输出级别 --> <!-- 日志输出级别 -->
<root level="DEBUG"> <root level="ERROR">
<appender-ref ref="FILE" /> <appender-ref ref="FILE" />
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />
</root> </root>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment