|
@@ -5,7 +5,7 @@
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.usky.issue.domain.YtDeviceStatus">
|
|
|
<result column="id" property="id"/>
|
|
|
- <result column="company_code" property="companyCode"/>
|
|
|
+ <result column="company_code" property="companyCode" typeHandler="org.apache.ibatis.type.StringTypeHandler"/>
|
|
|
<result column="company_name" property="companyName"/>
|
|
|
<result column="device_code" property="deviceCode"/>
|
|
|
<result column="device_name" property="deviceName"/>
|
|
@@ -16,29 +16,31 @@
|
|
|
<result column="difference" property="difference"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <!-- 离线设备数据查询 -->
|
|
|
<select id="getDeviceStatusType" resultType="com.usky.issue.domain.YtDeviceStatus">
|
|
|
- select
|
|
|
- device_code,device_name,address,device_type,company_name,company_code,data_time
|
|
|
+ SELECT device_code,device_name,address,device_type,company_name,company_code,data_time,difference
|
|
|
from yt_device_status yds
|
|
|
<where>
|
|
|
- difference > 48
|
|
|
- AND company_code in ('10357','10356','10354','10352','10349','10350','10347','10346','10334','10188',
|
|
|
- '10343','10348','10331','10320','10320','10164','10071','10345','10144','10064','10336','10131','10205',
|
|
|
- '10340','10339','10225','10323','10320','10134','10337','10226','10214','10160','10076','10079','10078',
|
|
|
- '10215','10324','10324','10154','10106','10121','10067','10325','10323','10322','10320','10128','10314',
|
|
|
- '10315','10312','10222','10077','10146','10151','10232','10116','10114','10122','10166','10353','10358',
|
|
|
- '10359','10361','10360','10140','10362','10206','10355','10105','10338','10318','10367','10124','10365',
|
|
|
- '10363','10368','10371','10341','10375','10373','10126','10374','10376','10378')
|
|
|
+ difference > 48
|
|
|
+ AND company_code IN('10357','10356','10354','10352','10349','10350','10347','10346','10334','10188',
|
|
|
+ '10343','10348','10331','10320','10320','10164','10071','10345','10144','10064','10336','10131','10205',
|
|
|
+ '10340','10339','10225','10323','10320','10134','10337','10226','10214','10160','10076','10079','10078',
|
|
|
+ '10215','10324','10324','10154','10106','10121','10067','10325','10323','10322','10320','10128','10314',
|
|
|
+ '10315','10312','10222','10077','10146','10151','10232','10116','10114','10122','10166','10353','10358',
|
|
|
+ '10359','10361','10360','10140','10362','10206','10355','10105','10338','10318','10367','10124','10365',
|
|
|
+ '10363','10368','10371','10341','10375','10373','10126','10374','10376','10378')
|
|
|
</where>
|
|
|
ORDER BY company_code ASC
|
|
|
</select>
|
|
|
+
|
|
|
+ <!-- 离线设备数据导出 -->
|
|
|
<select id="exportData" resultType="com.usky.issue.domain.YtDeviceStatus">
|
|
|
- SELECT device_code,device_name,address,device_type,company_name,company_code,data_time
|
|
|
+ SELECT device_code,device_name,address,device_type,company_name,company_code,data_time,difference
|
|
|
FROM yt_device_status yds
|
|
|
<where>
|
|
|
device_type NOT IN ('烟感系统','电气火灾','视频监测')
|
|
|
AND difference > 48
|
|
|
- AND company_code IN ('10357','10356','10354','10352','10349','10350','10347','10346','10334','10188',
|
|
|
+ AND company_code IN('10357','10356','10354','10352','10349','10350','10347','10346','10334','10188',
|
|
|
'10343','10348','10331','10320','10320','10164','10071','10345','10144','10064','10336','10131','10205',
|
|
|
'10340','10339','10225','10323','10320','10134','10337','10226','10214','10160','10076','10079','10078',
|
|
|
'10215','10324','10324','10154','10106','10121','10067','10325','10323','10322','10320','10128','10314',
|
|
@@ -49,4 +51,25 @@
|
|
|
ORDER BY company_code ASC
|
|
|
</select>
|
|
|
|
|
|
+ <!--根据传入单位单号查询设备-->
|
|
|
+ <select id="deviceList" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ device_type AS deviceType,
|
|
|
+ COUNT(*) AS deviceTypeCounts,
|
|
|
+ COUNT(difference < 48 OR NULL) AS onlineCount,
|
|
|
+ COUNT(difference >= 48 OR NULL) AS offlineCount
|
|
|
+ FROM
|
|
|
+ yt_device_status
|
|
|
+ WHERE
|
|
|
+ company_code = #{companyCode}
|
|
|
+ GROUP BY
|
|
|
+ device_type
|
|
|
+ ORDER BY
|
|
|
+ deviceType;
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|