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

    <sql id="Base_Column_List">
            id as id,
            d_time as dTime,
            air_temperature as airTemperature,
            air_pressure as airPressure,
            humidity as humidity,
            precipitation as precipitation,
            precipitation_intensity as precipitationIntensity,
            radiation_intensity as radiationIntensity,
            equipment_id as equipmentId,
            main_equipment_id as mainEquipmentId,
            sub_equipment_id as subEquipmentId,
            main_equipment_code as mainEquipmentCode,
            sub_equipment_code as subEquipmentCode
    </sql>

    <select id="selectSubstationMicMidPage" parameterType="com.huatek.busi.dto.SubstationMicMidDto" resultType="com.huatek.busi.vo.SubstationMicMidVo">
        SELECT
        <include refid="Base_Column_List"/>
        FROM
        substation_mic_mid t
        WHERE 1=1
        <if test="id != null and id != ''">
             and t.id = #{id}
        </if>
        <if test="dTime != null">
             and t.d_time = #{dTime}
        </if>
        <if test="airTemperature != null">
             and t.air_temperature = #{airTemperature}
        </if>
        <if test="airPressure != null">
             and t.air_pressure = #{airPressure}
        </if>
        <if test="humidity != null">
             and t.humidity = #{humidity}
        </if>
        <if test="precipitation != null">
             and t.precipitation = #{precipitation}
        </if>
        <if test="precipitationIntensity != null">
             and t.precipitation_intensity = #{precipitationIntensity}
        </if>
        <if test="radiationIntensity != null">
             and t.radiation_intensity = #{radiationIntensity}
        </if>
        <if test="equipmentId != null and equipmentId != ''">
             and t.equipment_id = #{equipmentId}
        </if>
        <if test="mainEquipmentId != null and mainEquipmentId != ''">
             and t.main_equipment_id = #{mainEquipmentId}
        </if>
        <if test="subEquipmentId != null and subEquipmentId != ''">
             and t.sub_equipment_id = #{subEquipmentId}
        </if>
        <if test="mainEquipmentCode != null and mainEquipmentCode != ''">
             and t.main_equipment_code = #{mainEquipmentCode}
        </if>
        <if test="subEquipmentCode != null and subEquipmentCode != ''">
             and t.sub_equipment_code = #{subEquipmentCode}
        </if>
    </select>

</mapper>