<?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.miaxis.wx.mapper.WxExtractBankMapper">

    <resultMap type="WxExtractBank" id="WxExtractBankResult">
        <result property="id"    column="id"    />
        <result property="openid"    column="openid"    />
        <result property="encTrueName"    column="enc_true_name"    />
        <result property="bankCode"    column="bank_code"    />
        <result property="encBankNo"    column="enc_bank_no"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectWxExtractBankVo">
        select * from wx_extract_bank
    </sql>

    <select id="selectWxExtractBankList" parameterType="WxExtractBank" resultMap="WxExtractBankResult">
        <include refid="selectWxExtractBankVo"/>
        <where>
            <if test="openid != null  and openid != ''"> and openid = #{openid}</if>
            <if test="encTrueName != null  and encTrueName != ''"> and enc_true_name like concat('%', #{encTrueName}, '%')</if>
            <if test="bankCode != null "> and bank_code = #{bankCode}</if>
            <if test="encBankNo != null  and encBankNo != ''"> and enc_bank_no = #{encBankNo}</if>
        </where>
    </select>

</mapper>
