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

    <sql id="Base_Column_List">
         t.id as id,
         t.siteid as siteId,
         t.commlen as commLen,
         t.causelen as causeLen,
         t.infolen as infoLen,
         t.txtype as txType,
         t.startaddr as startAddr,
         t.endaddr as endAddr,
         t.dtime as dTime,
         s.site_name as siteName
    </sql>

    <select id="selectIecBaseConfPage" parameterType="com.huatek.busi.dto.IecBaseConfDto" resultType="com.huatek.busi.vo.IecBaseConfVo">
        SELECT
        <include refid="Base_Column_List"/>
        FROM
        iec_base_conf t 
        LEFT JOIN busi_site s ON t.siteid =  s.id
       <where>
       	and t.status = '1'
        <if test="siteId != null">
             t.siteid = #{siteId}
        </if>
        <if test="txType != null and txType != ''">
             and t.txtype = #{txType}
        </if>
       </where>
       ORDER BY t.dtime DESC
    </select>
</mapper>