|
@@ -112,43 +112,43 @@
|
|
|
|
|
|
<select id="getDistrictFaultOrder" resultType="Map">
|
|
|
SELECT count(e.id) AS quantity,
|
|
|
- e.district AS item
|
|
|
+ e.province AS item
|
|
|
FROM (
|
|
|
SELECT b.id,
|
|
|
- a.district
|
|
|
+ a.province
|
|
|
FROM (SELECT sn, id FROM t_alarm_msg t WHERE is_delete = 0 AND t.fault_status = 0) b
|
|
|
- INNER JOIN (SELECT sn, district FROM t_device d WHERE is_delete=0 and district is not null
|
|
|
+ INNER JOIN (SELECT sn, province FROM t_device d WHERE is_delete=0 and province is not null
|
|
|
<if test="province != null and province!=''">
|
|
|
AND d.province = #{province}
|
|
|
</if>
|
|
|
) a ON b.sn = a.sn
|
|
|
) e
|
|
|
GROUP BY item
|
|
|
- order by quantity asc
|
|
|
+ order by quantity desc
|
|
|
</select>
|
|
|
|
|
|
<select id="getDistrictDeviceOrder" resultType="Map">
|
|
|
SELECT count(1) AS quantity,
|
|
|
- district AS item
|
|
|
+ province AS item
|
|
|
FROM t_device
|
|
|
- WHERE is_delete = 0 and district is not null
|
|
|
+ WHERE is_delete = 0 and province is not null
|
|
|
<if test="province != null and province!=''">
|
|
|
AND province = #{province}
|
|
|
</if>
|
|
|
GROUP BY item
|
|
|
- order by quantity
|
|
|
+ order by quantity desc
|
|
|
</select>
|
|
|
|
|
|
<select id="getDistrictDeviceOrderSix" resultType="Map">
|
|
|
SELECT count(1) AS quantity,
|
|
|
- district AS item
|
|
|
+ province AS item
|
|
|
FROM t_device
|
|
|
WHERE is_delete = 0
|
|
|
<if test="province != null and province!=''">
|
|
|
AND province = #{province}
|
|
|
</if>
|
|
|
GROUP BY item
|
|
|
- order by quantity limit 6
|
|
|
+ order by quantity desc limit 6
|
|
|
</select>
|
|
|
|
|
|
<select id="getSceneFaultGroup" resultType="Map">
|