|
@@ -4,7 +4,6 @@
|
|
|
|
|
|
<select id="listPage" resultType="com.zy.bms.pojo.vo.UbiDeviceListVo">
|
|
|
SELECT
|
|
|
- t1.open_num,
|
|
|
t1.username,
|
|
|
t1.password,
|
|
|
t1.sn,
|
|
@@ -22,15 +21,10 @@
|
|
|
<if test="io.groupId != null and io.groupId > -1">
|
|
|
AND t1.group_id = #{io.groupId}
|
|
|
</if>
|
|
|
- <if test="io.status != null and io.status > -1">
|
|
|
- AND t2.status = #{io.status}
|
|
|
- </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getDetail" resultType="com.zy.bms.pojo.vo.UbiDeviceDetailVo">
|
|
|
- SELECT *
|
|
|
- FROM ubi_info_state
|
|
|
- WHERE open_num = #{openNum}
|
|
|
+ SELECT * FROM ubi_info_state WHERE open_num = #{openNum}
|
|
|
</select>
|
|
|
|
|
|
<select id="listByGroupId" resultType="com.zy.bms.entity.ubi.UbiInfoState">
|
|
@@ -41,17 +35,17 @@
|
|
|
|
|
|
<select id="listByUserId" resultType="com.zy.bms.pojo.vo.DeviceWxListVo">
|
|
|
SELECT
|
|
|
- t1.open_num,
|
|
|
- t1.group_id,
|
|
|
- t1.type,
|
|
|
- t2.update_time,
|
|
|
- IF(TIMESTAMPDIFF(SECOND, t2.update_time, NOW()) > IFNULL(t2.freq, 0) + 180,0,1) AS `status`
|
|
|
+ t1.open_num,
|
|
|
+ t1.group_id,
|
|
|
+ t1.type,
|
|
|
+ t2.update_time,
|
|
|
+ IF(TIMESTAMPDIFF(SECOND, t2.update_time, NOW()) > IFNULL(t2.freq, 0) + 180,0,1) AS `status`
|
|
|
FROM
|
|
|
- device_base t1
|
|
|
+ device_base t1
|
|
|
LEFT JOIN ubi_info_state t2 ON t1.open_num = t2.open_num
|
|
|
WHERE
|
|
|
- t1.type = 'gnss'
|
|
|
- AND t1.group_id IN (SELECT group_id FROM user_privilege WHERE user_id = #{userId})
|
|
|
+ t1.type = 'gnss'
|
|
|
+ AND t1.group_id IN (SELECT group_id FROM user_privilege WHERE user_id = #{userId})
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|