<?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.TransformerEvaluateDataMapper">
  <resultMap id="BaseResultMap" type="com.huatek.busi.entity.TransformerEvaluateData">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="main_tree_id" jdbcType="VARCHAR" property="mainTreeId" />
   <!--  <result column="transformer_id" jdbcType="VARCHAR" property="transformerId" /> -->
    <result column="h2" jdbcType="VARCHAR" property="h2" />
    <result column="ch4" jdbcType="VARCHAR" property="ch4" />
    <result column="c2h2" jdbcType="VARCHAR" property="c2h2" />
    <result column="c2h4" jdbcType="VARCHAR" property="c2h4" />
    <result column="c2h6" jdbcType="VARCHAR" property="c2h6" />
    <result column="co" jdbcType="VARCHAR" property="co" />
    <result column="co2" jdbcType="VARCHAR" property="co2" />
    <result column="zj" jdbcType="VARCHAR" property="zj" />
    <result column="water_in_oil" jdbcType="VARCHAR" property="waterInOil" />
    <result column="oill_medium" jdbcType="VARCHAR" property="oillMedium" />
    <result column="oil_breakdown_voltage" jdbcType="VARCHAR" property="oilBreakdownVoltage" />
    <result column="furfural" jdbcType="VARCHAR" property="furfural" />
    <result column="degree_cardboard" jdbcType="VARCHAR" property="degreeCardboard" />
    <result column="polarizatio_index" jdbcType="VARCHAR" property="polarizatioIndex" />
    <result column="partial_discharge" jdbcType="VARCHAR" property="partialDischarge" />
    <result column="insulation_resistance" jdbcType="VARCHAR" property="insulationResistance" />
    <result column="insulation_resistance_absorption_ratio" jdbcType="VARCHAR" property="insulationResistanceAbsorptionRatio" />
    <result column="phase_difference_dc_resistance" jdbcType="VARCHAR" property="phaseDifferenceDcResistance" />
    <result column="line_difference_dc_resistance" jdbcType="VARCHAR" property="lineDifferenceDcResistance" />
    <result column="winding_insulation_dielectric_loss" jdbcType="VARCHAR" property="windingInsulationDielectricLoss" />
    <result column="core_insulation_resistance" jdbcType="VARCHAR" property="coreInsulationResistance" />
    <result column="end_screen_insulation_resistance" jdbcType="VARCHAR" property="endScreenInsulationResistance" />
    <result column="casing_dielectric_loss" jdbcType="VARCHAR" property="casingDielectricLoss" />
    <result column="casing_h2" jdbcType="VARCHAR" property="casingH2" />
    <result column="casing_ch4" jdbcType="VARCHAR" property="casingCh4" />
    <result column="casing_c2h2" jdbcType="VARCHAR" property="casingC2h2" />
    <result column="water_content_of_insulating_paper" jdbcType="VARCHAR" property="waterContentOfInsulatingPaper" />
    <result column="noload_current_and_noload_loss_rate" jdbcType="VARCHAR" property="noloadCurrentAndNoloadLossRate" />
    <result column="short_circuit_impedance_change_rate" jdbcType="VARCHAR" property="shortCircuitImpedanceChangeRate" />
    <result column="vibration_sound_level" jdbcType="VARCHAR" property="vibrationSoundLevel" />
    <result column="dc_leakage_current_winding" jdbcType="VARCHAR" property="dcLeakageCurrentWinding" />
    <result column="create_user" jdbcType="VARCHAR" property="createUser" />
    <result column="create_name" jdbcType="VARCHAR" property="createName" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="modified_name" jdbcType="VARCHAR" property="modifiedName" />
    <result column="modified_user" jdbcType="VARCHAR" property="modifiedUser" />
    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
    <result column="status" jdbcType="VARCHAR" property="status" />
  </resultMap>
  <sql id="Base_Column_List">
    id, main_tree_id,  h2, ch4, c2h2, c2h4, c2h6, co, co2, zj, water_in_oil, 
    oill_medium, oil_breakdown_voltage, furfural, degree_cardboard, polarizatio_index, 
    partial_discharge, insulation_resistance, insulation_resistance_absorption_ratio, 
    phase_difference_dc_resistance, line_difference_dc_resistance, winding_insulation_dielectric_loss, 
    core_insulation_resistance, end_screen_insulation_resistance, casing_dielectric_loss, 
    casing_h2, casing_ch4, casing_c2h2, water_content_of_insulating_paper, noload_current_and_noload_loss_rate, 
    short_circuit_impedance_change_rate , vibration_sound_level, dc_leakage_current_winding, 
    create_user, create_name, create_time, modified_name, modified_user, modified_time, 
    status
  </sql>
  <select id="selectByMainTreeId" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from transformer_evaluate_data t
    where t.main_tree_id = #{mainTreeId}
    and t.status = "1"
    order by t.create_time desc
  </select>
  
   <select id="page"  resultType="com.huatek.busi.vo.TransformerEvaluateDataVo2">
    select 
   		id, main_tree_id as mainTreeId ,  h2, ch4, c2h2, c2h4, c2h6, co, co2, zj,
   		t.create_name AS createName,
		t.create_time AS createTime,
		t.modified_name AS modifiedName,
		t.modified_time AS modifiedTime
    from transformer_evaluate_data t
    where  t.status = "1"
    and  t.main_tree_id = #{mainTreeId}
    <if test="startTime != null" >
   		 and create_time <![CDATA[>=]]> #{startTime}
    </if>
    <if test="endTime != null">
    	and create_time <![CDATA[<=]]> #{endTime}
    </if>
    order by t.create_time desc
  </select>
  
</mapper>