<?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.usoft.fin.grpc.dal.mapper.CreditApplyUserinfoMapper">
  <resultMap id="BaseResultMap" type="com.usoft.fin.grpc.dal.entity.CreditApplyUserinfo">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="credit_apply_code" jdbcType="VARCHAR" property="creditApplyCode" />
    <result column="en_business_main" jdbcType="VARCHAR" property="enBusinessMain" />
    <result column="en_business_type" jdbcType="VARCHAR" property="enBusinessType" />
    <result column="en_area_province" jdbcType="VARCHAR" property="enAreaProvince" />
    <result column="en_area_city" jdbcType="VARCHAR" property="enAreaCity" />
    <result column="en_area_district" jdbcType="VARCHAR" property="enAreaDistrict" />
    <result column="en_address" jdbcType="VARCHAR" property="enAddress" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="user_phone" jdbcType="VARCHAR" property="userPhone" />
    <result column="user_area_province" jdbcType="VARCHAR" property="userAreaProvince" />
    <result column="user_area_city" jdbcType="VARCHAR" property="userAreaCity" />
    <result column="user_area_district" jdbcType="VARCHAR" property="userAreaDistrict" />
    <result column="user_address" jdbcType="VARCHAR" property="userAddress" />
    <result column="en_name" jdbcType="VARCHAR" property="enName" />
  </resultMap>
  <sql id="Base_Column_List">
    id, code, credit_apply_code, en_business_main, en_business_type, en_area_province, 
    en_area_city, en_area_district, en_address, user_name, user_phone, user_area_province, 
    user_area_city, user_area_district, user_address, en_name
  </sql>
  <sql id="Table_Base_Column_List">
    t_credit_apply_userinfo.id, t_credit_apply_userinfo.code, t_credit_apply_userinfo.credit_apply_code, 
    t_credit_apply_userinfo.en_business_main, t_credit_apply_userinfo.en_business_type, 
    t_credit_apply_userinfo.en_area_province, t_credit_apply_userinfo.en_area_city, t_credit_apply_userinfo.en_area_district, 
    t_credit_apply_userinfo.en_address, t_credit_apply_userinfo.user_name, t_credit_apply_userinfo.user_phone, 
    t_credit_apply_userinfo.user_area_province, t_credit_apply_userinfo.user_area_city, 
    t_credit_apply_userinfo.user_area_district, t_credit_apply_userinfo.user_address, 
    t_credit_apply_userinfo.en_name
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_credit_apply_userinfo
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from t_credit_apply_userinfo
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.usoft.fin.grpc.dal.entity.CreditApplyUserinfo">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_credit_apply_userinfo (code, credit_apply_code, en_business_main, 
      en_business_type, en_area_province, en_area_city, 
      en_area_district, en_address, user_name, 
      user_phone, user_area_province, user_area_city, 
      user_area_district, user_address, en_name
      )
    values (#{code,jdbcType=VARCHAR}, #{creditApplyCode,jdbcType=VARCHAR}, #{enBusinessMain,jdbcType=VARCHAR}, 
      #{enBusinessType,jdbcType=VARCHAR}, #{enAreaProvince,jdbcType=VARCHAR}, #{enAreaCity,jdbcType=VARCHAR}, 
      #{enAreaDistrict,jdbcType=VARCHAR}, #{enAddress,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, 
      #{userPhone,jdbcType=VARCHAR}, #{userAreaProvince,jdbcType=VARCHAR}, #{userAreaCity,jdbcType=VARCHAR}, 
      #{userAreaDistrict,jdbcType=VARCHAR}, #{userAddress,jdbcType=VARCHAR}, #{enName,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.usoft.fin.grpc.dal.entity.CreditApplyUserinfo">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_credit_apply_userinfo
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="code != null">
        code,
      </if>
      <if test="creditApplyCode != null">
        credit_apply_code,
      </if>
      <if test="enBusinessMain != null">
        en_business_main,
      </if>
      <if test="enBusinessType != null">
        en_business_type,
      </if>
      <if test="enAreaProvince != null">
        en_area_province,
      </if>
      <if test="enAreaCity != null">
        en_area_city,
      </if>
      <if test="enAreaDistrict != null">
        en_area_district,
      </if>
      <if test="enAddress != null">
        en_address,
      </if>
      <if test="userName != null">
        user_name,
      </if>
      <if test="userPhone != null">
        user_phone,
      </if>
      <if test="userAreaProvince != null">
        user_area_province,
      </if>
      <if test="userAreaCity != null">
        user_area_city,
      </if>
      <if test="userAreaDistrict != null">
        user_area_district,
      </if>
      <if test="userAddress != null">
        user_address,
      </if>
      <if test="enName != null">
        en_name,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="creditApplyCode != null">
        #{creditApplyCode,jdbcType=VARCHAR},
      </if>
      <if test="enBusinessMain != null">
        #{enBusinessMain,jdbcType=VARCHAR},
      </if>
      <if test="enBusinessType != null">
        #{enBusinessType,jdbcType=VARCHAR},
      </if>
      <if test="enAreaProvince != null">
        #{enAreaProvince,jdbcType=VARCHAR},
      </if>
      <if test="enAreaCity != null">
        #{enAreaCity,jdbcType=VARCHAR},
      </if>
      <if test="enAreaDistrict != null">
        #{enAreaDistrict,jdbcType=VARCHAR},
      </if>
      <if test="enAddress != null">
        #{enAddress,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="userPhone != null">
        #{userPhone,jdbcType=VARCHAR},
      </if>
      <if test="userAreaProvince != null">
        #{userAreaProvince,jdbcType=VARCHAR},
      </if>
      <if test="userAreaCity != null">
        #{userAreaCity,jdbcType=VARCHAR},
      </if>
      <if test="userAreaDistrict != null">
        #{userAreaDistrict,jdbcType=VARCHAR},
      </if>
      <if test="userAddress != null">
        #{userAddress,jdbcType=VARCHAR},
      </if>
      <if test="enName != null">
        #{enName,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.usoft.fin.grpc.dal.entity.CreditApplyUserinfo">
    update t_credit_apply_userinfo
    <set>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="creditApplyCode != null">
        credit_apply_code = #{creditApplyCode,jdbcType=VARCHAR},
      </if>
      <if test="enBusinessMain != null">
        en_business_main = #{enBusinessMain,jdbcType=VARCHAR},
      </if>
      <if test="enBusinessType != null">
        en_business_type = #{enBusinessType,jdbcType=VARCHAR},
      </if>
      <if test="enAreaProvince != null">
        en_area_province = #{enAreaProvince,jdbcType=VARCHAR},
      </if>
      <if test="enAreaCity != null">
        en_area_city = #{enAreaCity,jdbcType=VARCHAR},
      </if>
      <if test="enAreaDistrict != null">
        en_area_district = #{enAreaDistrict,jdbcType=VARCHAR},
      </if>
      <if test="enAddress != null">
        en_address = #{enAddress,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="userPhone != null">
        user_phone = #{userPhone,jdbcType=VARCHAR},
      </if>
      <if test="userAreaProvince != null">
        user_area_province = #{userAreaProvince,jdbcType=VARCHAR},
      </if>
      <if test="userAreaCity != null">
        user_area_city = #{userAreaCity,jdbcType=VARCHAR},
      </if>
      <if test="userAreaDistrict != null">
        user_area_district = #{userAreaDistrict,jdbcType=VARCHAR},
      </if>
      <if test="userAddress != null">
        user_address = #{userAddress,jdbcType=VARCHAR},
      </if>
      <if test="enName != null">
        en_name = #{enName,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.usoft.fin.grpc.dal.entity.CreditApplyUserinfo">
    update t_credit_apply_userinfo
    set code = #{code,jdbcType=VARCHAR},
      credit_apply_code = #{creditApplyCode,jdbcType=VARCHAR},
      en_business_main = #{enBusinessMain,jdbcType=VARCHAR},
      en_business_type = #{enBusinessType,jdbcType=VARCHAR},
      en_area_province = #{enAreaProvince,jdbcType=VARCHAR},
      en_area_city = #{enAreaCity,jdbcType=VARCHAR},
      en_area_district = #{enAreaDistrict,jdbcType=VARCHAR},
      en_address = #{enAddress,jdbcType=VARCHAR},
      user_name = #{userName,jdbcType=VARCHAR},
      user_phone = #{userPhone,jdbcType=VARCHAR},
      user_area_province = #{userAreaProvince,jdbcType=VARCHAR},
      user_area_city = #{userAreaCity,jdbcType=VARCHAR},
      user_area_district = #{userAreaDistrict,jdbcType=VARCHAR},
      user_address = #{userAddress,jdbcType=VARCHAR},
      en_name = #{enName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>