<?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.CableCurrentResultMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.huatek.busi.entity.BusiCableCurrentResult">
        <id column="id" property="id" />
        <result column="mea_temp" property="meaTemp" />
        <result column="ambient_temp" property="ambientTemp" />
        <result column="rated_voltage" property="ratedVoltage" />
        <result column="external_diameter_cc" property="externalDiameterCC" />
        <result column="external_diameter_ci" property="externalDiameterCI" />
        <result column="diameter" property="diameter" />
        <result column="insulation_thick" property="insulationThick" />
        <result column="cables_Number" property="cablesNumber" />
        <result column="conductivity" property="conductivity" />
        <result column="resistance_temp_coefficient" property="resistanceTempCoefficient" />
        <result column="dielectric_loss_factor" property="dielectricLossFactor" />
        <result column="dielectric_constant" property="dielectricConstant" />
        <result column="external_diameter_dc" property="externalDiameterDC" />
        <result column="pumping_duration" property="pumpingDuration" />
        <result column="electric_power_duration" property="electricPowerDuration" />
        <result column="flag" property="flag" />
        <result column="t2" property="t2" />
        <result column="t3" property="t3" />
        <result column="pumping_current" property="pumpingCurrent" />
        <result column="electric_power_current" property="electricPowerCurrent" />
        <result column="temp_diff" property="tempDiff" />
        <result column="r" property="r" />
        <result column="wd" property="wd" />
        <result column="t1" property="t1" />
        <result column="t4" property="t4" />
        <result column="λ1" property="λ1" />
        <result column="λ2" property="λ2" />
        <result column="cc" property="cc" />
        <result column="create_time" property="createTime" />
    </resultMap>


    <select id="selectListPage" parameterType="com.huatek.busi.dto.cablecurrent.CableCurrentPageDto" resultType="com.huatek.busi.vo.cablecurrent.CableCurrentPageVo">
        SELECT
        t.id,
        t.pumping_current as pumpingCurrent,
        t.electric_power_current as electricPowerCurrent,
        t.pumping_duration as pumpingDuration,
        t.electric_power_duration as electricPowerDuration,
        t.flag,
        t.type,
        t.name,
        t.create_time as createTime
        FROM
        busi_cable_current_result t
        <where>

        <if test="startDate != null and startDate != ''"><!-- 开始时间检索 -->
            and t.create_time <![CDATA[ >= ]]> #{startDate}
        </if>
        <if test="endDate != null and endDate != ''"><!-- 开始时间检索 -->
          AND t.create_time <![CDATA[ <= ]]> #{endDate}
        </if>
        </where>
        order by t.create_time desc
    </select>
</mapper>
