<?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.chaozhanggui.dao.system.dao.TbPlussBankCodeSxfMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussBankCodeSxf">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="bank_code" jdbcType="VARCHAR" property="bankCode" />
    <result column="cnaps_code" jdbcType="VARCHAR" property="cnapsCode" />
    <result column="cnaps_name" jdbcType="VARCHAR" property="cnapsName" />
    <result column="bank_name" jdbcType="VARCHAR" property="bankName" />
    <result column="org_code" jdbcType="VARCHAR" property="orgCode" />
    <result column="province_code" jdbcType="VARCHAR" property="provinceCode" />
    <result column="province_name" jdbcType="VARCHAR" property="provinceName" />
    <result column="city_code" jdbcType="VARCHAR" property="cityCode" />
    <result column="city_name" jdbcType="VARCHAR" property="cityName" />
  </resultMap>
  <sql id="Base_Column_List">
    id, bank_code, cnaps_code, cnaps_name, bank_name, org_code, province_code, province_name, 
    city_code, city_name
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_bank_code_sxf
    where id = #{id,jdbcType=INTEGER}
  </select>
    <select id="pageData" resultType="com.chaozhanggui.dao.system.entity.TbPlussSxfMccInfo">
      SELECT F_ID AS fId, F_mcc_code AS fMccCode, F_grandpa_txt AS fGrandpaTxt, F_father_txt AS fFatherTxt, F_mcc_txt AS fMccTxt, F_mcc_type AS fMccType
      FROM tb_pluss_sxf_mcc_info
      <where>
        F_mcc_type != '线上'
      <if test="keyWord != null and keyWord != ''">
        AND F_grandpa_txt LIKE #{keyWord}
        OR F_mcc_txt LIKE #{keyWord}
        OR F_father_txt LIKE #{keyWord}
      </if>
      </where>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_bank_code_sxf
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussBankCodeSxf">
    insert into tb_pluss_bank_code_sxf (id, bank_code, cnaps_code, 
      cnaps_name, bank_name, org_code, 
      province_code, province_name, city_code, 
      city_name)
    values (#{id,jdbcType=INTEGER}, #{bankCode,jdbcType=VARCHAR}, #{cnapsCode,jdbcType=VARCHAR}, 
      #{cnapsName,jdbcType=VARCHAR}, #{bankName,jdbcType=VARCHAR}, #{orgCode,jdbcType=VARCHAR}, 
      #{provinceCode,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, #{cityCode,jdbcType=VARCHAR}, 
      #{cityName,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussBankCodeSxf">
    insert into tb_pluss_bank_code_sxf
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bankCode != null">
        bank_code,
      </if>
      <if test="cnapsCode != null">
        cnaps_code,
      </if>
      <if test="cnapsName != null">
        cnaps_name,
      </if>
      <if test="bankName != null">
        bank_name,
      </if>
      <if test="orgCode != null">
        org_code,
      </if>
      <if test="provinceCode != null">
        province_code,
      </if>
      <if test="provinceName != null">
        province_name,
      </if>
      <if test="cityCode != null">
        city_code,
      </if>
      <if test="cityName != null">
        city_name,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="bankCode != null">
        #{bankCode,jdbcType=VARCHAR},
      </if>
      <if test="cnapsCode != null">
        #{cnapsCode,jdbcType=VARCHAR},
      </if>
      <if test="cnapsName != null">
        #{cnapsName,jdbcType=VARCHAR},
      </if>
      <if test="bankName != null">
        #{bankName,jdbcType=VARCHAR},
      </if>
      <if test="orgCode != null">
        #{orgCode,jdbcType=VARCHAR},
      </if>
      <if test="provinceCode != null">
        #{provinceCode,jdbcType=VARCHAR},
      </if>
      <if test="provinceName != null">
        #{provinceName,jdbcType=VARCHAR},
      </if>
      <if test="cityCode != null">
        #{cityCode,jdbcType=VARCHAR},
      </if>
      <if test="cityName != null">
        #{cityName,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussBankCodeSxf">
    update tb_pluss_bank_code_sxf
    <set>
      <if test="bankCode != null">
        bank_code = #{bankCode,jdbcType=VARCHAR},
      </if>
      <if test="cnapsCode != null">
        cnaps_code = #{cnapsCode,jdbcType=VARCHAR},
      </if>
      <if test="cnapsName != null">
        cnaps_name = #{cnapsName,jdbcType=VARCHAR},
      </if>
      <if test="bankName != null">
        bank_name = #{bankName,jdbcType=VARCHAR},
      </if>
      <if test="orgCode != null">
        org_code = #{orgCode,jdbcType=VARCHAR},
      </if>
      <if test="provinceCode != null">
        province_code = #{provinceCode,jdbcType=VARCHAR},
      </if>
      <if test="provinceName != null">
        province_name = #{provinceName,jdbcType=VARCHAR},
      </if>
      <if test="cityCode != null">
        city_code = #{cityCode,jdbcType=VARCHAR},
      </if>
      <if test="cityName != null">
        city_name = #{cityName,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussBankCodeSxf">
    update tb_pluss_bank_code_sxf
    set bank_code = #{bankCode,jdbcType=VARCHAR},
      cnaps_code = #{cnapsCode,jdbcType=VARCHAR},
      cnaps_name = #{cnapsName,jdbcType=VARCHAR},
      bank_name = #{bankName,jdbcType=VARCHAR},
      org_code = #{orgCode,jdbcType=VARCHAR},
      province_code = #{provinceCode,jdbcType=VARCHAR},
      province_name = #{provinceName,jdbcType=VARCHAR},
      city_code = #{cityCode,jdbcType=VARCHAR},
      city_name = #{cityName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>