<?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">
<!--suppress ALL -->
<mapper namespace="com.xhpc.common.iccard.mapper.XhpcIcCardInfoMapper">
  <resultMap id="BaseResultMap" type="com.xhpc.common.domain.XhpcIcCardInfo">
    <id column="id" jdbcType="INTEGER" property="id"/>
    <result column="t_iccard_info_id" jdbcType="VARCHAR" property="tIccardInfoId"/>
    <result column="use_status" jdbcType="BIGINT" property="useStatus"/>
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
    <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
    <result column="grant_operator_id" jdbcType="VARCHAR" property="grantOperatorId"/>
    <result column="user_id" jdbcType="INTEGER" property="userId"/>
    <result column="user_account" jdbcType="VARCHAR" property="userAccount"/>
    <result column="user_type" jdbcType="BIGINT" property="userType"/>
    <result column="user_name" jdbcType="VARCHAR" property="userName"/>
    <result column="user_id_card" jdbcType="VARCHAR" property="userIdCard"/>
    <result column="user_age" jdbcType="BIGINT" property="userAge"/>
    <result column="user_sex" jdbcType="BIGINT" property="userSex"/>
    <result column="user_phone" jdbcType="VARCHAR" property="userPhone"/>
    <result column="user_vehicle" jdbcType="VARCHAR" property="userVehicle"/>
    <result column="del_flag" jdbcType="BIGINT" property="delFlag"/>
  </resultMap>
  <sql id="Base_Column_List">
    id
    , t_iccard_info_id, use_status, create_time, tenant_id, grant_operator_id, user_id,
    user_account, user_type, user_name, user_id_card, user_age, user_sex, user_phone, 
    user_vehicle, del_flag
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List"/>
    from xhpc_ic_card_info
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete
    from xhpc_ic_card_info
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xhpc.common.domain.XhpcIcCardInfo"
          useGeneratedKeys="true">
    insert into xhpc_ic_card_info (t_iccard_info_id, use_status, create_time,
                                   tenant_id, grant_operator_id, user_id,
                                   user_account, user_type, user_name,
                                   user_id_card, user_age, user_sex,
                                   user_phone, user_vehicle, del_flag)
    values (#{tIccardInfoId,jdbcType=VARCHAR}, #{useStatus,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
            #{tenantId,jdbcType=VARCHAR}, #{grantOperatorId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},
            #{userAccount,jdbcType=VARCHAR}, #{userType,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR},
            #{userIdCard,jdbcType=VARCHAR}, #{userAge,jdbcType=BIGINT}, #{userSex,jdbcType=BIGINT},
            #{userPhone,jdbcType=VARCHAR}, #{userVehicle,jdbcType=VARCHAR}, #{delFlag,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.xhpc.common.domain.XhpcIcCardInfo"
          useGeneratedKeys="true">
    insert into xhpc_ic_card_info
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="tIccardInfoId != null">
        t_iccard_info_id,
      </if>
      <if test="useStatus != null">
        use_status,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="tenantId != null">
        tenant_id,
      </if>
      <if test="grantOperatorId != null">
        grant_operator_id,
      </if>
      <if test="userId != null">
        user_id,
      </if>
      <if test="userAccount != null">
        user_account,
      </if>
      <if test="userType != null">
        user_type,
      </if>
      <if test="userName != null">
        user_name,
      </if>
      <if test="userIdCard != null">
        user_id_card,
      </if>
      <if test="userAge != null">
        user_age,
      </if>
      <if test="userSex != null">
        user_sex,
      </if>
      <if test="userPhone != null">
        user_phone,
      </if>
      <if test="userVehicle != null">
        user_vehicle,
      </if>
      <if test="delFlag != null">
        del_flag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="tIccardInfoId != null">
        #{tIccardInfoId,jdbcType=VARCHAR},
      </if>
      <if test="useStatus != null">
        #{useStatus,jdbcType=BIGINT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tenantId != null">
        #{tenantId,jdbcType=VARCHAR},
      </if>
      <if test="grantOperatorId != null">
        #{grantOperatorId,jdbcType=VARCHAR},
      </if>
      <if test="userId != null">
        #{userId,jdbcType=INTEGER},
      </if>
      <if test="userAccount != null">
        #{userAccount,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        #{userType,jdbcType=BIGINT},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="userIdCard != null">
        #{userIdCard,jdbcType=VARCHAR},
      </if>
      <if test="userAge != null">
        #{userAge,jdbcType=BIGINT},
      </if>
      <if test="userSex != null">
        #{userSex,jdbcType=BIGINT},
      </if>
      <if test="userPhone != null">
        #{userPhone,jdbcType=VARCHAR},
      </if>
      <if test="userVehicle != null">
        #{userVehicle,jdbcType=VARCHAR},
      </if>
      <if test="delFlag != null">
        #{delFlag,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.xhpc.common.domain.XhpcIcCardInfo">
    update xhpc_ic_card_info
    <set>
      <if test="tIccardInfoId != null">
        t_iccard_info_id = #{tIccardInfoId,jdbcType=VARCHAR},
      </if>
      <if test="useStatus != null">
        use_status = #{useStatus,jdbcType=BIGINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tenantId != null">
        tenant_id = #{tenantId,jdbcType=VARCHAR},
      </if>
      <if test="grantOperatorId != null">
        grant_operator_id = #{grantOperatorId,jdbcType=VARCHAR},
      </if>
      <if test="userId != null">
        user_id = #{userId,jdbcType=INTEGER},
      </if>
      <if test="userAccount != null">
        user_account = #{userAccount,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        user_type = #{userType,jdbcType=BIGINT},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="userIdCard != null">
        user_id_card = #{userIdCard,jdbcType=VARCHAR},
      </if>
      <if test="userAge != null">
        user_age = #{userAge,jdbcType=BIGINT},
      </if>
      <if test="userSex != null">
        user_sex = #{userSex,jdbcType=BIGINT},
      </if>
      <if test="userPhone != null">
        user_phone = #{userPhone,jdbcType=VARCHAR},
      </if>
      <if test="userVehicle != null">
        user_vehicle = #{userVehicle,jdbcType=VARCHAR},
      </if>
      <if test="delFlag != null">
        del_flag = #{delFlag,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.xhpc.common.domain.XhpcIcCardInfo">
    update xhpc_ic_card_info
    set t_iccard_info_id  = #{tIccardInfoId,jdbcType=VARCHAR},
        use_status        = #{useStatus,jdbcType=BIGINT},
        create_time       = #{createTime,jdbcType=TIMESTAMP},
        tenant_id         = #{tenantId,jdbcType=VARCHAR},
        grant_operator_id = #{grantOperatorId,jdbcType=VARCHAR},
        user_id           = #{userId,jdbcType=INTEGER},
        user_account      = #{userAccount,jdbcType=VARCHAR},
        user_type         = #{userType,jdbcType=BIGINT},
        user_name         = #{userName,jdbcType=VARCHAR},
        user_id_card      = #{userIdCard,jdbcType=VARCHAR},
        user_age          = #{userAge,jdbcType=BIGINT},
        user_sex          = #{userSex,jdbcType=BIGINT},
        user_phone        = #{userPhone,jdbcType=VARCHAR},
        user_vehicle      = #{userVehicle,jdbcType=VARCHAR},
        del_flag          = #{delFlag,jdbcType=BIGINT}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>