<?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.community.huiju.dao.TaFaceMapper" >

    <select id="selectByPrimaryKey" resultType="com.community.huiju.model.TaFace">
        select
        id, community_id,ta_user_verify_id,face_img,create_user, create_date, update_user,
        update_date
        from ta_face
        where id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
        delete from ta_face
        where id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insert" parameterType="com.community.huiju.model.TaFace" >
        insert into ta_face (id, community_id, ta_user_verify_id,face_img, create_user, create_date,
        update_user, update_date)
        values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER},#{taUserVerifyId,jdbcType=INTEGER},#{faceImg,jdbcType=VARCHAR},#{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP},
        #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective"  parameterType="com.community.huiju.model.TaFace" >
        insert into ta_face
        <trim prefix="(" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                id,
            </if>
            <if test="communityId != null" >
                community_id,
            </if>
            <if test="taUserVerifyId != null" >
                ta_user_verify_id,
            </if>
            <if test="faceImg != null" >
                face_img,
            </if>
            <if test="createUser != null" >
                create_user,
            </if>
            <if test="createDate != null" >
                create_date,
            </if>
            <if test="updateUser != null" >
                update_user,
            </if>
            <if test="updateDate != null" >
                update_date,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                #{id,jdbcType=INTEGER},
            </if>
            <if test="communityId != null" >
                #{communityId,jdbcType=INTEGER},
            </if>
            <if test="taUserVerifyId != null" >
                #{taUserVerifyId,jdbcType=INTEGER},
            </if>
            <if test="faceImg != null" >
                #{faceImg,jdbcType=VARCHAR},
            </if>
            <if test="createUser != null" >
                #{createUser,jdbcType=INTEGER},
            </if>
            <if test="createDate != null" >
                #{createDate,jdbcType=TIMESTAMP},
            </if>
            <if test="updateUser != null" >
                #{updateUser,jdbcType=INTEGER},
            </if>
            <if test="updateDate != null" >
                #{updateDate,jdbcType=TIMESTAMP},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaFace">
        update ta_face
        <set >
            <if test="communityId != null" >
                community_id = #{communityId,jdbcType=INTEGER},
            </if>
            <if test="taUserVerifyId != null" >
                ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
            </if>
            <if test="faceImg != null" >
                face_img = #{faceImg,jdbcType=VARCHAR},
            </if>
            <if test="createUser != null" >
                create_user = #{createUser,jdbcType=INTEGER},
            </if>
            <if test="createDate != null" >
                create_date = #{createDate,jdbcType=TIMESTAMP},
            </if>
            <if test="updateUser != null" >
                update_user = #{updateUser,jdbcType=INTEGER},
            </if>
            <if test="updateDate != null" >
                update_date = #{updateDate,jdbcType=TIMESTAMP},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>

    <select id="getByUserVerifyId" resultType="com.community.huiju.model.TaFace" parameterType="java.lang.Integer">
        select
        id, community_id,ta_user_verify_id,face_img,create_user, create_date, update_user,
        update_date
        from ta_face
        where ta_user_verify_id = #{userVerifyId,jdbcType=INTEGER}
    </select>

    <select id="getById" resultType="com.community.huiju.model.TaFace"  parameterType="java.lang.Integer" >
        select
        id, community_id,ta_user_verify_id,face_img,create_user, create_date, update_user,
        update_date
        from ta_face
        where id = #{id,jdbcType=INTEGER}
    </select>

</mapper>