|
@ -11,6 +11,7 @@ |
|
|
<result column="device_ip" jdbcType="VARCHAR" property="deviceIp"/> |
|
|
<result column="device_ip" jdbcType="VARCHAR" property="deviceIp"/> |
|
|
<result column="success_rate" jdbcType="VARCHAR" property="successRate"/> |
|
|
<result column="success_rate" jdbcType="VARCHAR" property="successRate"/> |
|
|
<result column="lost_rate" jdbcType="VARCHAR" property="lostRate"/> |
|
|
<result column="lost_rate" jdbcType="VARCHAR" property="lostRate"/> |
|
|
|
|
|
<result column="success_rate" jdbcType="VARCHAR" property="successRate"/> |
|
|
|
|
|
|
|
|
<result column="direction" jdbcType="VARCHAR" property="direction"/> |
|
|
<result column="direction" jdbcType="VARCHAR" property="direction"/> |
|
|
<result column="manufacturer" jdbcType="VARCHAR" property="production"/> |
|
|
<result column="manufacturer" jdbcType="VARCHAR" property="production"/> |
|
@ -187,6 +188,43 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getStatusList" parameterType="com.zc.business.domain.Status" resultMap="BaseResultMap"> |
|
|
|
|
|
SELECT COALESCE |
|
|
|
|
|
(d.child_type,d.device_type ) AS type, |
|
|
|
|
|
s.time, |
|
|
|
|
|
ROUND( avg( s.success_rate ), 2 ) success_rate |
|
|
|
|
|
FROM |
|
|
|
|
|
status s |
|
|
|
|
|
LEFT JOIN dc_device d ON s.device_id = d.id |
|
|
|
|
|
<where> |
|
|
|
|
|
<if test="status.time != null"> |
|
|
|
|
|
AND s.time BETWEEN #{status.startTime,jdbcType=DATE} AND #{status.time,jdbcType=DATE} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="status.type != null"> |
|
|
|
|
|
AND (d.device_type in |
|
|
|
|
|
<foreach item="typeItem" collection="status.types" open="(" separator="," close=")"> |
|
|
|
|
|
#{typeItem} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
or d.child_type in |
|
|
|
|
|
<foreach item="typeItem" collection="status.types" open="(" separator="," close=")"> |
|
|
|
|
|
#{typeItem} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="status.deviceId != null"> |
|
|
|
|
|
AND s.device_id = #{status.deviceId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="status.useState != null and status.useState != 0"> |
|
|
|
|
|
AND d.use_state = #{status.useState} |
|
|
|
|
|
</if> |
|
|
|
|
|
GROUP BY |
|
|
|
|
|
d.child_type, |
|
|
|
|
|
d.device_type, |
|
|
|
|
|
DAY (s.time) |
|
|
|
|
|
</where> |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="listStatusBySection" parameterType="com.zc.business.domain.Status" resultMap="BaseResultMap"> |
|
|
<select id="listStatusBySection" parameterType="com.zc.business.domain.Status" resultMap="BaseResultMap"> |
|
|
select s.id, s.device_no, s.device_name, s.device_status,s.time, |
|
|
select s.id, s.device_no, s.device_name, s.device_status,s.time, |
|
|
d.device_ip,s.success_rate,s.lost_rate,d.direction,e.manufacturer,e.model,d.facilities_type,m.section_id,d.remark,COALESCE(d.child_type, |
|
|
d.device_ip,s.success_rate,s.lost_rate,d.direction,e.manufacturer,e.model,d.facilities_type,m.section_id,d.remark,COALESCE(d.child_type, |
|
|