<?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.huatek.busi.mapper.HwTemperIncreaseRateMapper">

	<sql id="Base_Column_List">
		id as id,
		site_id as siteId,
		sensor_id as sensorId,
		main_tree_id as mainTreeId,
		sub_tree_id as subTreeId,
		type as type,
		max_tmp_avg as maxTmpAvg,
		min_tmp_avg as minTmpAvg,
		avg_tmp_avg as avgTmpAvg,
		max_tmp_increase as maxTmpIncrease,
		min_tmp_increase as minTmpIncrease,
		avg_tmp_increase as avgTmpIncrease,
		d_time as dTime,
		create_time as createTime
	</sql>

	<delete id="deleteItem">
		delete from hw_temper_increase_rate where main_tree_id = #{mainTreeId} and sensor_id = #{sensorCode} and d_time = #{day}
	</delete>

	<select id="getItem" resultType="com.huatek.busi.entity.HwTemperIncreaseRate">
		select
			<include refid="Base_Column_List"/>
		from
			hw_temper_increase_rate
		where
			main_tree_id = #{mainTreeId} and sensor_id = #{sensorCode} and d_time = #{day}
	</select>
</mapper>