| | |
| | | hd.mac = vdi.mac
|
| | | AND vdi.monitor_point_id = mp.id
|
| | | AND vdi.device_tech = 1
|
| | | <if test="monitorPointId != null and monitorPointId!=''">
|
| | | <if test="monitorPointId != null">
|
| | | AND mp.id = #{monitorPointId}
|
| | | </if>
|
| | | <if test="mac != null and mac!=''">
|
| | | <if test="mac != null">
|
| | | AND hd.mac = #{mac}
|
| | | </if>
|
| | | <if test="start != null">
|
| | |
| | | FROM
|
| | | history_daily
|
| | | <where>
|
| | | <if test="mac!=null and mac!=''">
|
| | | <if test="mac!=null">
|
| | | AND mac=#{mac}
|
| | | </if>
|
| | | <if test="time!=null and time!=''">
|
| | | <if test="time!=null">
|
| | | AND time=#{time}
|
| | | </if>
|
| | | </where>
|
| | | </select>
|
| | |
|
| | | <!-- 根据设备mac地址,时间,污染因子查询一天的平均值 -->
|
| | | <select id="getDataByTimeSlot" resultType="java.util.Map">
|
| | | SELECT *
|
| | | FROM history_daily
|
| | | where mac=#{mac}
|
| | | AND time between #{startTime} and #{endTime}
|
| | | </select>
|
| | | </mapper> |