| 1234567891011121314151617181920212223242526 |
- <?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.gbd.demp.data.exchange.mapper.HistoryDataMapper">
- <select id="getHistoryData" resultType="com.gbd.demp.data.exchange.entity.HistoryData">
- SELECT id, device_id, sensor_id, data_value, report_time, status
- FROM t_history_data
- where 1=1
- <choose>
- <when test="historyData.startTimeFrom != null and historyData.startTimeFrom !='' and historyData.startTimeTo!= null and historyData.startTimeTo !=''">
- And report_time > #{historyData.startTimeFrom} And report_time < #{historyData.startTimeTo}
- </when>
- <otherwise>
- and report_time>date_sub(now(),INTERVAL 30 MINUTE)
- </otherwise>
- </choose>
- <if test="switchValue==false">
- and status <![CDATA[ <> ]]> '06'
- </if>
- and device_id=#{historyData.deviceId}
- and sensor_id=#{historyData.sensorId}
- order by report_time
- </select>
- </mapper>
|