123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.zy.bms.mapper.ubi.UbiInfoStateMapper">
- <update id="updateStatus">
- UPDATE
- ubi_info_state
- SET status = 0
- WHERE
- TIMESTAMPDIFF(SECOND, update_time, NOW()) > (freq + 120)
- </update>
- <select id="listPage" resultType="com.zy.bms.pojo.vo.UbiDeviceListVo">
- SELECT
- t1.open_num,
- t1.username,
- t1.password,
- t1.sn,
- t1.create_time,
- t1.group_id,
- t2.*
- FROM
- device_base t1
- LEFT JOIN
- ubi_info_state t2 ON t1.open_num = t2.open_num
- WHERE
- t1.type = "gnss"
- <if test="io.openNum != null and io.openNum != ''">
- AND t1.open_num LIKE CONCAT('%',#{io.openNum},'%')
- </if>
- <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 t1.open_num,
- t2.*
- FROM
- device_base t1
- LEFT JOIN
- ubi_info_state t2 ON t1.open_num = t2.open_num
- WHERE
- t1.type = "gnss" AND t1.open_num = #{openNum}
- </select>
- <select id="listByGroupIdWx" resultType="com.zy.bms.pojo.vo.UbiDeviceListVo">
- SELECT
- t1.open_num,
- t2.freq,
- t2.update_time
- FROM
- device_base t1
- LEFT JOIN
- ubi_info_state t2 ON t1.open_num = t2.open_num
- WHERE
- t1.type = "gnss" AND t1.group_id = #{group}
- </select>
- </mapper>
|