<?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.example.mypulsar.dao.DeviceDao"> <!--<select id="getUsers" parameterType="int" resultType="com.shunzhi.mqtt2kanban.bean.User"> -- SELECT * FROM t_d_validcardevent SELECT * FROM user </select>--> <select id="getHWAttsWithRoomId" parameterType="java.lang.String" resultType="com.example.mypulsar.bean.Wl_Attendace"> select clint_id from WL_Attendance where belongAreaId = ${belongAreaId} and state = 1 and clint_type = 12 </select> <!-- 插入遥控器数据--> <insert id="insertCalDevBeControl" parameterType="com.example.mypulsar.bean.CalDevBeContrl" databaseId="java.lang.Long"> insert into CalDevBeContrl values (${ConDevId},${ConCode},${ConValue},${CreateTime},${CreateUserId},${State},${ModeId}) </insert> <!-- 新建联动模板--> <select id="getWL_LinkMode" parameterType="java.lang.String" resultType="com.example.mypulsar.bean.Wl_LinkModeBean"> select * from WL_LinkageMode where SchoolId = ${SchoolId} and State = 1 </select> <select id="getIotDeviceAfterRecord" resultType="com.example.mypulsar.bean.IotDevice"> select top 1 devId,code,value,time,dev_status from Iot_Device where devId = #{devId} and [value] = #{value} and dev_status = 1 and code = 'pir' and time > #{openTime} ORDER BY time asc </select> <select id="getIotDeviceRecord" resultType="com.example.mypulsar.bean.IotDevice"> select top 1 devId,code,value,time,dev_status from Iot_Device where devId = #{devId} and [value] = #{value} and dev_status = 1 and code = 'pir' ORDER BY time desc </select> <select id="getHWAtts" parameterType="java.lang.String" resultType="com.example.mypulsar.bean.Wl_Attendace"> select * from WL_Attendance where state = 1 and clint_type = 12 and school_id = 1085 </select> <select id="getTempDevice" parameterType="java.lang.String" resultType="com.example.mypulsar.bean.CalDevContrl"> select top 1 * from CalDevContrl where Status = 1 and ModelType = 9 and DevBeId like '%'+ #{beId} +'%' order by CreateTime desc </select> </mapper>