<?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.ssm.manage.mapper.StaffTemporaryUpdateMapper">

    <resultMap id="BaseResultMap" type="com.ssm.manage.entity.StaffTemporaryUpdate">
        <result property="id" column="id"/>
        <result property="staffNum" column="staff_num"/>
        <result property="staffName" column="staff_name"/>
        <result property="email" column="email"/>
        <result property="mobilePhone" column="mobile_phone"/>
        <result property="identityType" column="identity_type"/>
        <result property="identityCard" column="identity_card"/>
        <result property="type" column="type"/>
        <result property="sex" column="sex"/>
        <result property="facesInformation" column="faces_information"/>
        <result property="urgentName" column="urgent_name"/>
        <result property="urgentPhone" column="urgent_phone"/>
        <result property="urgentRelationship" column="urgent_relationship"/>
        <result property="remark" column="remark"/>
        <result property="blackId" column="black_id"/>
        <result property="staffTemporaryId" column="staff_temporary_id"/>
        <result property="updateId" column="update_id"/>
        <result property="updateName" column="update_name"/>
        <result property="updateDate" column="update_date"/>
        <result property="ruzhiTime" column="ruzhi_time"/>
    </resultMap>

    <sql id="Base_Column_List">
        id
        , staff_num, staff_name, email, mobile_phone, identity_type,
            identity_card, type, sex, faces_information, urgent_name,
            urgent_phone, urgent_relationship, remark,
            black_id,staff_temporary_id,update_id,update_name,update_date
            ,ruzhi_time
    </sql>

    <select id="queryAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"></include>
        from staff_temporary_update
        <where>
            <if test="id != null">
                and id = #{id}
            </if>
            <if test="staffNum != null and staffNum != ''">
                and staff_num = #{staffNum}
            </if>
            <if test="staffName != null and staffName != ''">
                and staff_name = #{staffName}
            </if>
            <if test="email != null and email != ''">
                and email = #{email}
            </if>
            <if test="mobilePhone != null and mobilePhone != ''">
                and mobile_phone = #{mobilePhone}
            </if>
            <if test="identityType != null">
                and identity_type = #{identityType}
            </if>
            <if test="identityCard != null and identityCard != ''">
                and identity_card = #{identityCard}
            </if>
            <if test="type != null">
                and type = #{type}
            </if>
            <if test="sex != null">
                and sex = #{sex}
            </if>
            <if test="facesInformation != null and facesInformation != ''">
                and faces_information = #{facesInformation}
            </if>
            <if test="urgentName != null and urgentName != ''">
                and urgent_name = #{urgentName}
            </if>
            <if test="urgentPhone != null and urgentPhone != ''">
                and urgent_phone = #{urgentPhone}
            </if>
            <if test="urgentRelationship != null and urgentRelationship != ''">
                and urgent_relationship = #{urgentRelationship}
            </if>
            <if test="remark != null and remark != ''">
                and remark = #{remark}
            </if>
        </where>
    </select>

    <delete id="delectByIdcards">
        delete from staff_temporary_update where identity_card in
        <foreach collection="delectStaffTemporaryIdcard" item="idcard" separator="," open="(" close=")">
            #{idcard}
        </foreach>
    </delete>


</mapper>
