<?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.chinaweal.aiccs.aiccs.claim.mapper.TSSupEntAddrMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.chinaweal.aiccs.aiccs.claim.entity.TSSupEntAddr">
        <id column="ENTBASEADDRID" property="entbaseaddrid" />
        <result column="PRIPID" property="pripid" />
        <result column="ADDRESS" property="address" />
        <result column="ADDRTYPE" property="addrtype" />
        <result column="AREAID" property="areaid" />
        <result column="AREANAME" property="areaname" />
        <result column="MARKETID" property="marketid" />
        <result column="MARKETNAME" property="marketname" />
        <result column="LOCALADM" property="localadm" />
        <result column="LASTINSPECTDATE" property="lastinspectdate" />
        <result column="INSSTARTDATE" property="insstartdate" />
        <result column="INSENDDATE" property="insenddate" />
        <result column="REALBUSINESS" property="realbusiness" />
        <result column="FOUNDPROB" property="foundprob" />
        <result column="LAUPTIME" property="lauptime" />
        <result column="AREA_CODE" property="areaCode" />
        <result column="ISVALID" property="isvalid" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ENTBASEADDRID, PRIPID, ADDRESS, ADDRTYPE, AREAID, AREANAME, MARKETID, MARKETNAME, LOCALADM, LASTINSPECTDATE, INSSTARTDATE, INSENDDATE, REALBUSINESS, FOUNDPROB, LAUPTIME, AREA_CODE, ISVALID
    </sql>

    <select id="findTSSupEntAddrModel" resultMap="BaseResultMap" parameterType="java.lang.String">
        select
        <include refid="Base_Column_List"/>
        from TSSupEntAddr
        where pripid = #{pripid,jdbcType=CHAR}
    </select>

    <select id="findTSSupEntAddrList" parameterType="com.chinaweal.aiccs.aiccs.claim.entity.TSSupEntAddr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from TSSupEntAddr where 1=1
        <if test="entbaseaddrid != null">
            AND entbaseaddrid = #{entbaseaddrid}
        </if>
        <if test="pripid != null">
            AND pripid = #{pripid}
        </if>
        <if test="areaid != null">
            AND areaid = #{areaid}
        </if>
        <if test="areaname != null">
            AND areaname = #{areaname}
        </if>
        <if test="marketid != null">
            AND marketid = #{marketid}
        </if>
        <if test="marketname != null">
            AND marketname = #{marketname}
        </if>
        <if test="localadm != null">
            AND localadm = #{localadm}
        </if>
        <if test="lastinspectdate != null">
            AND lastinspectdate = #{lastinspectdate}
        </if>
        <if test="insstartdate != null">
            AND insstartdate = #{insstartdate}
        </if>
        <if test="insenddate != null">
            AND insenddate = #{insenddate}
        </if>
        <if test="foundprob != null">
            AND foundprob = #{foundprob}
        </if>
        <if test="lauptime != null">
            AND lauptime = #{lauptime}
        </if>
        <if test="address != null">
            AND address = #{address}
        </if>
    </select>

    <select id="findTSSupEntAddrListByPripid" parameterType="com.chinaweal.aiccs.aiccs.claim.entity.TSSupEntAddr" resultMap="BaseResultMap">
        select address
        from TSSUPENTADDR  WHERE pripid = #{pripid,jdbcType=CHAR}
    </select>

</mapper>
