<?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.BusiOutlineTransformerExperimentDataMapper">

    <sql id="Base_Column_List">
            id as id,
            equipment_id as equipmentId,
            site_id as siteId,
            jueyuandianzu_hv_xsb as jueyuandianzuHvXsb,
            jueyuandianzu_hv_jhzs as jueyuandianzuHvJhzs,
            jueyuandianzu_mv_xsb as jueyuandianzuMvXsb,
            jueyuandianzu_mv_jhzs as jueyuandianzuMvJhzs,
            jueyuandianzu_lv_xsb as jueyuandianzuLvXsb,
            jueyuandianzu_lv_jhzs as jueyuandianzuLvJhzs,
            create_time as createTime,
            status as status,
            xishoubi_qz as xishoubiQz,
            jihuazhishu_qz as jihuazhishuQz,
            jueyuandianzuhv_Cx as jueyuandianzuhvCx,
            jueyuandianzulv_Cx as jueyuandianzulvCx,
            jueyuandianzu_Cx as jueyuandianzuCx,
            cx_qz as cxQz,
            jueyuandianzuhv_tang as jueyuandianzuhvTang,
            jueyuandianzulv_tang as jueyuandianzulvTang,
            jueyuandianzu_tang as jueyuandianzuTang,
            tang_qz as tangQz,
            txd as txd,
            jjd as jjd,
            tgdrA_tano as tgdraTano,
            tgdrB_tano as tgdrbTano,
            tgdrC_tano as tgdrcTano,
            tgdrO_tano as tgdroTano,
            tgdrjzsha_tano as tgdrjzshaTano,
            tgdrjzshb_tano as tgdrjzshbTano,
            tgdrjzshc_tano as tgdrjzshcTano,
            tgdrA_Cx as tgdraCx,
            tgdrB_Cx as tgdrbCx,
            tgdrC_Cx as tgdrcCx,
            tgdrO_Cx as tgdroCx,
            tgdrjzsha_Cx as tgdrjzshaCx,
            tgdrjzshb_Cx as tgdrjzshbCx,
            tgdrjzshc_Cx as tgdrjzshcCx,
            kzdl as kzdl,
            kzsh as kzsh,
            hv_rl as hvRl,
            hv_edfj as hvEdfj,
            hv_zzfj as hvZzfj,
            mfsy as mfsy,
            sjcd as sjcd,
            wssy as wssy,
            wssy_jw as wssyJw,
            wssy_yw as wssyYw,
            wssy_yx as wssyYx,
            wssy_yq as wssyYq,
            wssy_qing as wssyQing,
            wssy_yyht as wssyYyht,
            wssy_eyht as wssyEyht,
            wssy_ting as wssyTing,
            jyysy_dq as jyysyDq,
            jyysy_sf as jyysySf,
            jyysy_jz as jyysyJz,
            gyrz_fj as gyrzFj,
            gyrz_AO as gyrzAo,
            gyrz_BO as gyrzBo,
            gyrz_CO as gyrzCo,
            max_bphl as maxBphl,
            hv_lv as hvLv,
            lv_hv as lvHv,
            tx_hv as txHv,
            jj_hv as jjHv,
            drl_zq as drlZq,
            tgδ_zq as tgZq,
            hv_dl as hvDl,
            lv_dl as lvDl,
            hldzA as hldza,
            hldzB as hldzb,
            hldzC as hldzc,
            hldz_bz as hldzBz,
            hzsjA as hzsja,
            hzsjB as hzsjb,
            hzsjC as hzsjc,
            hzsj_bz as hzsjBz,
            fz_oneA as fzOnea,
            fz_oneB as fzOneb,
            fz_oneC as fzOnec,
            fz_oneBZ as fzOnebz,
            fz_twoA as fzTwoa,
            fz_twoB as fzTwob,
            fz_twoC as fzTwoc,
            fz_twoBZ as fzTwobz,
            btq_timeA as btqTimea,
            btq_timeB as btqTimeb,
            btq_timeC as btqTimec,
            btq_timeBZ as btqTimebz,
            water as water,
            experiment_date_time as experimentDateTime,
            h2 as h2,
            ch4 as ch4,
            c2h2 as c2h2,
            c2h4 as c2h4,
            c2h6 as c2h6,
            zt as zt,
            co as co,
            co2 as co2,
            co_jdcq as coJdcq,
            co2_jdcqsl as co2Jdcqsl,
            co_xdcqsl as coXdcqsl,
            co2_xdcqsl as co2Xdcqsl,
            zt_jdcq as ztJdcq,
            zt_xdcqsl as ztXdcqsl,
            yz_water as yzWater,
            y_medium as yMedium,
            yjc_voltage as yjcVoltage,
            kq_content as kqContent,
            zb_jhd as zbJhd,
            jhzs as jhzs,
            jffdl as jffdl,
            jydz as jydz,
            jydz_xsb as jydzXsb,
            rzzldz_xjc as rzzldzXjc,
            rzzldz_xianjc as rzzldzXianjc,
            rz_jyjz as rzJyjz,
            txjd_dz as txjdDz,
            mpjy_dz as mpjyDz,
            tg_js as tgJs,
            tg_h2 as tgH2,
            tg_h4 as tgH4,
            tg_h2h2 as tgH2h2,
            jyz_hsl as jyzHsl,
            kzdl_dzsh as kzdlDzsh,
            dlzk_bhl as dlzkBhl,
            txjd_dl as txjdDl,
            zd_sj as zdSj,
            rzzl_xldl as rzzlXldl,
            byq_bt as byqBt,
            lq_xt as lqXt,
            fj_kg as fjKg,
            fdl_bhzz as fdlBhzz,
            tg as tg,
            qx_xz as qxXz,
            qx_cs as qxCs,
            ysp_sybh as yspSybh,
            yz_sybh as yzSybh,
            kq_sybh as kqSybh,
            jyz_sybh as jyzSybh,
            lxsy_sybh as lxsySybh,
            zdxsy_sybh as zdxsySybh,
            ysp_bz as yspBz,
            yz_bz as yzBz,
            kq_bz as kqBz,
            jyz_bz as jyzBz,
            lxsy_bz as lxsyBz,
            zdxsy_bz as zdxsyBz,
            description1 as description1,
            description2 as description2,
            description3 as description3,
            description4 as description4,
            description5 as description5,
            description6 as description6,
            create_id as createId,
            create_name as createName
    </sql>

    <select id="selectBusiOutlineTransformerExperimentDataPage" parameterType="com.huatek.busi.dto.BusiOutlineTransformerExperimentDataDto" resultType="com.huatek.busi.vo.BusiOutlineTransformerExperimentDataVo">
        SELECT
        <include refid="Base_Column_List"/>
        FROM
        busi_outline_transformer_experiment_data t
        WHERE 1=1
        <if test="equipmentId != null and equipmentId != ''">
             and t.equipment_id  LIKE CONCAT(CONCAT('%',#{equipmentId}),'%')
        </if>
        <if test="siteId != null and siteId != ''">
             and t.site_id = #{siteId}
        </if>
    </select>

	<delete id="batchDel">
		 delete from busi_outline_transformer_experiment_data where id in 
        <foreach item="item" index="index" collection="idList"
		      open="(" separator="," close=")">
		        #{item}
		  </foreach>
	</delete>
	
	<select id="findBusiOutlineDataByEquip" parameterType="java.lang.String" resultType="com.huatek.busi.entity.BusiOutlineTransformerExperimentData">
	    SELECT
        <include refid="Base_Column_List"/>
        FROM
        busi_outline_transformer_experiment_data t
        WHERE t.equipment_id = #{equipmentId}
        AND t.site_id = #{siteId}
        ORDER BY experiment_date_time DESC
        limit 1
	</select>
	
</mapper>