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

    <sql id="Base_Column_List">
            id as id,
            h2 as h2,
            ch4 as ch4,
            c2h6 as c2h6,
            c2h4 as c2h4,
            c2h2 as c2h2,
            co as co,
            co2 as co2,
            h2o as h2o,
            total_hydrocarbon as totalHydrocarbon,
            correct_time as correctTime,
            site_id as siteId,
            equipment_id as equipmentId,
            sub_equipment_id as subEquipmentId,
            main_equipment_id as mainEquipmentId
    </sql>
    
    <select id="findBySubEquipmentId" resultType = "com.huatek.busi.entity.BusiTransformerCorrect" >
    	SELECT
			*
		FROM
			`busi_transformer_correct` t
		WHERE
			t.site_id = #{siteId}
		AND t.sub_equipment_id  = #{subEquipmentId}
		ORDER BY
			t.correct_time DESC
		LIMIT 1
    </select>
    
    
</mapper>