| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?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.xunmei.iot.mapper.IotCommonSensorMapper">
- <select id="selectPageData" resultType="com.xunmei.iot.vo.sensor.SensorPageVo">
- select s.id, org_id, org_name, device_name, category_id, infos as info,device_code, update_time from iot_sensor s
- <where>
- <if test="request.orgId!= null">
- and s.org_id=#{request.orgId}
- </if>
- <if test="request.orgPath!= null">
- and s.org_path like CONCAT(#{request.orgPath}, '%')
- </if>
- <if test="request.deviceName != null and request.deviceName!= ''">
- and s.device_name like CONCAT('%',#{request.deviceName},'%')
- </if>
- <if test="request.startTime!= null">
- and s.state_update_time >=#{request.startTime}
- </if>
- <if test="request.endTime!= null">
- and s.state_update_time <![CDATA[<=]]> #{request.endTime}
- </if>
- </where>
- </select>
- <select id="selectSensorLogDataPage" resultType="com.xunmei.iot.vo.sensor.SensorPageVo">
- select s.id, org_id, org_name, device_name, category_id, infos as info,device_code, update_time from iot_sensor_log s
- <where>
- <if test="request.orgId!= null">
- and s.org_id=#{request.orgId}
- </if>
- <if test="request.orgPath!= null">
- and s.org_path like CONCAT(#{request.orgPath}, '%')
- </if>
- <if test="request.deviceName != null and request.deviceName!= ''">
- and s.device_name like CONCAT('%',#{request.deviceName},'%')
- </if>
- <if test="request.deviceCode != null and request.deviceCode!= ''">
- and s.device_code =#{request.deviceCode}
- </if>
- <if test="request.startTime!= null">
- and s.state_update_time >=#{request.startTime}
- </if>
- <if test="request.endTime!= null">
- and s.state_update_time <![CDATA[<=]]> #{request.endTime}
- </if>
- </where>
- order by s.state_update_time desc
- </select>
- </mapper>
|