<?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.TransformerRunStatusThresholdMapper">
  <resultMap id="BaseResultMap" type="com.huatek.busi.vo.TransformerRunStatusThresholdVo">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="site_id" jdbcType="VARCHAR" property="siteId" />
    <result column="main_tree_id" jdbcType="VARCHAR" property="mainTreeId" />
    <result column="work_status" jdbcType="VARCHAR" property="workStatus" />
    <result column="coolingwater_inlet_pressure" jdbcType="VARCHAR" property="coolingwaterInletPressure" />
    <result column="coolingwater_outlet_pressure" jdbcType="VARCHAR" property="coolingwaterOutletPressure" />
    <result column="coolingwater_inlet_temperature" jdbcType="VARCHAR" property="coolingwaterInletTemperature" />
    <result column="coolingwater_outlet_temperature" jdbcType="VARCHAR" property="coolingwaterOutletTemperature" />
    <result column="winding_temperature" jdbcType="VARCHAR" property="windingTemperature" />
    <result column="Circulating_oil_inlet_pressure" jdbcType="VARCHAR" property="circulatingOilInletPressure" />
    <result column="Circulating_oil_outlet_pressure" jdbcType="VARCHAR" property="circulatingOilOutletPressure" />
    <result column="circulating_oil_inlet_temperature" jdbcType="VARCHAR" property="circulatingOilInletTemperature" />
    <result column="circulating_oil_out_temperature" jdbcType="VARCHAR" property="circulatingOilOutletTemperature" />
    <result column="oilpillow_oillevel" jdbcType="VARCHAR" property="oilpillowOillevel" />
    <result column="transformer_Ontology_oillevel" jdbcType="VARCHAR" property="transformerOntologyOillevel" />
    <result column="oil_temperature" jdbcType="VARCHAR" property="oilTemperature" />
    <result column="top_oil_temperature" jdbcType="VARCHAR" property="topOilTemperature" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="creator" jdbcType="VARCHAR" property="creator" />
    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
    <result column="modifier" jdbcType="VARCHAR" property="modifier" />
  </resultMap>
  <sql id="Base_Column_List">
    id, site_id, main_tree_id, work_status, coolingwater_inlet_pressure, coolingwater_outlet_pressure, 
    coolingwater_inlet_temperature, coolingwater_outlet_temperature, winding_temperature, 
    Circulating_oil_inlet_pressure,Circulating_oil_outlet_pressure,circulating_oil_inlet_temperature,circulating_oil_out_temperature,oilpillow_oillevel, transformer_Ontology_oillevel, 
    oil_temperature, top_oil_temperature, created_time, creator, modified_time, modifier
  </sql>
  <select id="queryRunStatusThreshold" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from transformer_runing_status_threshold
    <where> 
	    <if test="siteId != null and siteId != ''">
	         site_id=#{siteId}
	    </if> 
	    <if test="mainTreeId != null and mainTreeId != ''">
	        and  main_tree_id=#{mainTreeId}
	    </if>
	    <if test="workStatus != null and workStatus != ''">
	        and work_status=#{workStatus}
	    </if>
    </where>  
  </select>
  
   <select id="queryRunStatusThresholdByMainTreeId" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from transformer_runing_status_threshold
    where main_tree_id=#{mainTreeId}
  </select>
</mapper>