<?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.brilliance.isc.mda.dao.PilotBchMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.PilotBch">
        <result property="accBch" column="accbch" jdbcType="VARCHAR"/>
        <result property="branchInr" column="branchinr" jdbcType="VARCHAR"/>
        <result property="isPilot" column="ispilot" jdbcType="CHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        accbch,branchinr,ispilot
    </sql>

    <select id="selectPilotBch" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from pilotbch
        where accBch = #{accBch,jdbcType=VARCHAR}
    </select>

    <select id="selectAllPilotBch" resultMap="BaseResultMap">
        select
            <include refid="Base_Column_List" />
        from pilotbch
    </select>

   <delete id="deleteAllPilotBch">
       delete from pilotbch where 1=1
   </delete>

    <insert id="insert">
        insert into pilotbch (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{accBch,jdbcType=VARCHAR},
            #{branchInr,jdbcType=VARCHAR},
            #{isPilot,jdbcType=VARCHAR}
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into pilotbch
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="accbch != null">accbch,</if>
            <if test="branchinr != null">branchinr,</if>
            <if test="ispilot != null">ispilot,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="accbch != null">#{accbch,jdbcType=VARCHAR},</if>
            <if test="branchinr != null">#{branchinr,jdbcType=VARCHAR},</if>
            <if test="ispilot != null">#{ispilot,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
</mapper>