<?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.card.mapper.TIccardClientUsersMapper">
    <resultMap id="BaseResultMap" type="com.xhpc.card.pojo.TIccardClientUsers">
        <id column="usersID" jdbcType="INTEGER" property="usersid"/>
        <result column="usersName" jdbcType="VARCHAR" property="usersname"/>
        <result column="usersPwd" jdbcType="VARCHAR" property="userspwd"/>
        <result column="usersPhone" jdbcType="VARCHAR" property="usersphone"/>
        <result column="usersEmail" jdbcType="VARCHAR" property="usersemail"/>
        <result column="usersAdress" jdbcType="VARCHAR" property="usersadress"/>
        <result column="usersLevel" jdbcType="TINYINT" property="userslevel"/>
        <result column="usersCorp" jdbcType="INTEGER" property="userscorp"/>
        <result column="corpNo" jdbcType="VARCHAR" property="corpno"/>
        <result column="corpName" jdbcType="VARCHAR" property="corpname"/>
        <result column="usersTime" jdbcType="TIMESTAMP" property="userstime"/>
        <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
        <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
    </resultMap>
    <sql id="Base_Column_List">
        usersID
        , usersName, usersPwd, usersPhone, usersEmail, usersAdress, usersLevel, usersCorp,
    corpNo, corpName, usersTime, tenant_id, del_flag
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_iccard_client_users
        where usersID = #{usersid,jdbcType=INTEGER}
    </select>
    <select id="selectByCondition" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from t_iccard_client_users
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
        delete
        from t_iccard_client_users
        where usersID = #{usersid,jdbcType=INTEGER}
    </delete>
    <insert id="insert" keyColumn="usersID" keyProperty="usersid" parameterType="com.xhpc.card.pojo.TIccardClientUsers"
            useGeneratedKeys="true">
        insert into t_iccard_client_users (usersName, usersPwd, usersPhone,
                                           usersEmail, usersAdress, usersLevel,
                                           usersCorp, corpNo, corpName,
                                           usersTime, tenant_id, del_flag)
        values (#{usersname,jdbcType=VARCHAR}, #{userspwd,jdbcType=VARCHAR}, #{usersphone,jdbcType=VARCHAR},
                #{usersemail,jdbcType=VARCHAR}, #{usersadress,jdbcType=VARCHAR}, #{userslevel,jdbcType=TINYINT},
                #{userscorp,jdbcType=INTEGER}, #{corpno,jdbcType=VARCHAR}, #{corpname,jdbcType=VARCHAR},
                #{userstime,jdbcType=TIMESTAMP}, #{tenantId,jdbcType=VARCHAR}, #{delFlag,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" keyColumn="usersID" keyProperty="usersid"
            parameterType="com.xhpc.card.pojo.TIccardClientUsers" useGeneratedKeys="true">
        insert into t_iccard_client_users
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="usersname != null">
                usersName,
            </if>
            <if test="userspwd != null">
                usersPwd,
            </if>
            <if test="usersphone != null">
                usersPhone,
            </if>
            <if test="usersemail != null">
                usersEmail,
            </if>
            <if test="usersadress != null">
                usersAdress,
            </if>
            <if test="userslevel != null">
                usersLevel,
            </if>
            <if test="userscorp != null">
                usersCorp,
            </if>
            <if test="corpno != null">
                corpNo,
            </if>
            <if test="corpname != null">
                corpName,
            </if>
            <if test="userstime != null">
                usersTime,
            </if>
            <if test="tenantId != null">
                tenant_id,
            </if>
            <if test="delFlag != null">
                del_flag,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="usersname != null">
                #{usersname,jdbcType=VARCHAR},
            </if>
            <if test="userspwd != null">
                #{userspwd,jdbcType=VARCHAR},
            </if>
            <if test="usersphone != null">
                #{usersphone,jdbcType=VARCHAR},
            </if>
            <if test="usersemail != null">
                #{usersemail,jdbcType=VARCHAR},
            </if>
            <if test="usersadress != null">
                #{usersadress,jdbcType=VARCHAR},
            </if>
            <if test="userslevel != null">
                #{userslevel,jdbcType=TINYINT},
            </if>
            <if test="userscorp != null">
                #{userscorp,jdbcType=INTEGER},
            </if>
            <if test="corpno != null">
                #{corpno,jdbcType=VARCHAR},
            </if>
            <if test="corpname != null">
                #{corpname,jdbcType=VARCHAR},
            </if>
            <if test="userstime != null">
                #{userstime,jdbcType=TIMESTAMP},
            </if>
            <if test="tenantId != null">
                #{tenantId,jdbcType=VARCHAR},
            </if>
            <if test="delFlag != null">
                #{delFlag,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.xhpc.card.pojo.TIccardClientUsers">
        update t_iccard_client_users
        <set>
            <if test="usersname != null">
                usersName = #{usersname,jdbcType=VARCHAR},
            </if>
            <if test="userspwd != null">
                usersPwd = #{userspwd,jdbcType=VARCHAR},
            </if>
            <if test="usersphone != null">
                usersPhone = #{usersphone,jdbcType=VARCHAR},
            </if>
            <if test="usersemail != null">
                usersEmail = #{usersemail,jdbcType=VARCHAR},
            </if>
            <if test="usersadress != null">
                usersAdress = #{usersadress,jdbcType=VARCHAR},
            </if>
            <if test="userslevel != null">
                usersLevel = #{userslevel,jdbcType=TINYINT},
            </if>
            <if test="userscorp != null">
                usersCorp = #{userscorp,jdbcType=INTEGER},
            </if>
            <if test="corpno != null">
                corpNo = #{corpno,jdbcType=VARCHAR},
            </if>
            <if test="corpname != null">
                corpName = #{corpname,jdbcType=VARCHAR},
            </if>
            <if test="userstime != null">
                usersTime = #{userstime,jdbcType=TIMESTAMP},
            </if>
            <if test="tenantId != null">
                tenant_id = #{tenantId,jdbcType=VARCHAR},
            </if>
            <if test="delFlag != null">
                del_flag = #{delFlag,jdbcType=INTEGER},
            </if>
        </set>
        where usersID = #{usersid,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.xhpc.card.pojo.TIccardClientUsers">
        update t_iccard_client_users
        set usersName   = #{usersname,jdbcType=VARCHAR},
            usersPwd    = #{userspwd,jdbcType=VARCHAR},
            usersPhone  = #{usersphone,jdbcType=VARCHAR},
            usersEmail  = #{usersemail,jdbcType=VARCHAR},
            usersAdress = #{usersadress,jdbcType=VARCHAR},
            usersLevel  = #{userslevel,jdbcType=TINYINT},
            usersCorp   = #{userscorp,jdbcType=INTEGER},
            corpNo      = #{corpno,jdbcType=VARCHAR},
            corpName    = #{corpname,jdbcType=VARCHAR},
            usersTime   = #{userstime,jdbcType=TIMESTAMP},
            tenant_id   = #{tenantId,jdbcType=VARCHAR},
            del_flag    = #{delFlag,jdbcType=INTEGER}
        where usersID = #{usersid,jdbcType=INTEGER}
    </update>
</mapper>