12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?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.lp.LpInfoStateMapper">
- <select id="listPage" resultType="com.zy.bms.pojo.vo.LpDeviceListVo">
- SELECT
- t1.username,
- t1.password,
- t1.sn,
- t1.create_time,
- t1.group_id,
- t2.*
- FROM
- device_base t1
- LEFT JOIN lp_info_state t2 ON t1.open_num = t2.open_num
- WHERE t1.type = 'lupai'
- <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="listByUserId" resultType="com.zy.bms.entity.lp.LpInfoState">
- SELECT t2.*
- FROM device_base t1
- LEFT JOIN lp_info_state t2 ON t1.open_num = t2.open_num
- WHERE t1.group_id IN (SELECT group_id FROM user_privilege WHERE user_id = #{userId})
- </select>
- <select id="listByGroupId" resultType="com.zy.bms.entity.lp.LpInfoState">
- SELECT *
- FROM lp_info_state
- WHERE open_num IN (SELECT open_num FROM device_base WHERE type = 'lupai' AND group_id = #{groupId})
- </select>
- <update id="updateWakeAndThresh">
- UPDATE
- lp_info_state
- SET wake_int = #{entity.wakeInt},
- thresh = #{entity.thresh},
- update_location_flag = #{entity.updateLocationFlag}
- WHERE open_num = #{entity.openNum}
- </update>
- </mapper>
|