<?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.StaffTemporaryNumberMapper">

    <resultMap id="BaseResultMap" type="com.ssm.manage.entity.StaffTemporaryNumber">
        <result property="id" column="id"/>
        <result property="scanTime" column="scan_time"/>
        <result property="isOne" column="is_one"/>
        <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="storeId" column="store_id"/>
        <result property="regionId" column="region_id"/>
        <result property="state" column="state"/>
        <result property="facesInformation" column="faces_information"/>
        <result property="endType" column="end_type"/>
        <result property="endId" column="end_id"/>
        <result property="endName" column="end_name"/>
        <result property="endTime" column="end_time"/>
        <result property="isBeisen" column="is_beisen"/>
        <result property="sendId" column="send_id"/>
        <result property="sendName" column="send_name"/>
        <result property="sendTime" column="send_time"/>
        <result property="isZhongkong" column="is_zhongkong"/>
        <result property="sendZhongkongId" column="send_zhongkong_id"/>
        <result property="sendZhongkongName" column="send_zhongkong_name"/>
        <result property="sendZhongkongTime" column="send_zhongkong_time"/>
        <result property="beisenDimission" column="beisen_dimission"/>
        <result property="zhongkongDimission" column="zhongkong_dimission"/>
        <result property="beisenDimissionDate" column="beisen_dimission_date"/>
        <result property="zhongkongDimissionDate" column="zhongkong_dimission_date"/>
        <result property="isUpdate" column="is_update"/>
        <result property="ruzhiTime" column="ruzhi_time"/>
        <result property="zhongkongDeptId" column="zhongkong_dept_id"/>
        <result property="zhongkongDeptNum" column="zhongkong_dept_num"/>
        <result property="zhongkongDeptName" column="zhongkong_dept_name"/>
        <result property="beisenDeptId" column="beisen_dept_id"/>
        <result property="beisenDeptNum" column="beisen_dept_num"/>
        <result property="beisenDeptName" column="beisen_dept_name"/>
        <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="zhongkongDimissionType" column="zhongkong_dimission_type"/>
        <result property="zhongkongDimissionReason" column="zhongkong_dimission_reason"/>
    </resultMap>

    <sql id="Base_Column_List">
        id
        , scan_time, is_one, staff_num, staff_name, email, mobile_phone, identity_type, identity_card, type, sex, store_id, region_id, state, faces_information, end_type, end_id, end_name, end_time, is_beisen, send_id, send_name, send_time, is_zhongkong, send_zhongkong_id, send_zhongkong_name, send_zhongkong_time, beisen_dimission, zhongkong_dimission, beisen_dimission_date, zhongkong_dimission_date, is_update, ruzhi_time, zhongkong_dept_id, zhongkong_dept_num, zhongkong_dept_name, beisen_dept_id, beisen_dept_num, beisen_dept_name, urgent_name, urgent_phone, urgent_relationship, remark, zhongkong_dimission_type, zhongkong_dimission_reason
    </sql>

    <select id="queryAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"></include>
        from staff_temporary_number
        <where>
            <if test="id != null">
                and id = #{id}
            </if>
            <if test="scanTime != null">
                and scan_time = #{scanTime}
            </if>
            <if test="isOne != null">
                and is_one = #{isOne}
            </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="storeId != null">
                and store_id = #{storeId}
            </if>
            <if test="regionId != null">
                and region_id = #{regionId}
            </if>
            <if test="state != null">
                and state = #{state}
            </if>
            <if test="facesInformation != null and facesInformation != ''">
                and faces_information = #{facesInformation}
            </if>
            <if test="endType != null">
                and end_type = #{endType}
            </if>
            <if test="endId != null">
                and end_id = #{endId}
            </if>
            <if test="endName != null and endName != ''">
                and end_name = #{endName}
            </if>
            <if test="endTime != null">
                and end_time = #{endTime}
            </if>
            <if test="isBeisen != null">
                and is_beisen = #{isBeisen}
            </if>
            <if test="sendId != null">
                and send_id = #{sendId}
            </if>
            <if test="sendName != null and sendName != ''">
                and send_name = #{sendName}
            </if>
            <if test="sendTime != null">
                and send_time = #{sendTime}
            </if>
            <if test="isZhongkong != null">
                and is_zhongkong = #{isZhongkong}
            </if>
            <if test="sendZhongkongId != null">
                and send_zhongkong_id = #{sendZhongkongId}
            </if>
            <if test="sendZhongkongName != null and sendZhongkongName != ''">
                and send_zhongkong_name = #{sendZhongkongName}
            </if>
            <if test="sendZhongkongTime != null">
                and send_zhongkong_time = #{sendZhongkongTime}
            </if>
            <if test="beisenDimission != null">
                and beisen_dimission = #{beisenDimission}
            </if>
            <if test="zhongkongDimission != null">
                and zhongkong_dimission = #{zhongkongDimission}
            </if>
            <if test="beisenDimissionDate != null">
                and beisen_dimission_date = #{beisenDimissionDate}
            </if>
            <if test="zhongkongDimissionDate != null">
                and zhongkong_dimission_date = #{zhongkongDimissionDate}
            </if>
            <if test="isUpdate != null">
                and is_update = #{isUpdate}
            </if>
            <if test="ruzhiTime != null">
                and ruzhi_time = #{ruzhiTime}
            </if>
            <if test="zhongkongDeptId != null">
                and zhongkong_dept_id = #{zhongkongDeptId}
            </if>
            <if test="zhongkongDeptNum != null and zhongkongDeptNum != ''">
                and zhongkong_dept_num = #{zhongkongDeptNum}
            </if>
            <if test="zhongkongDeptName != null and zhongkongDeptName != ''">
                and zhongkong_dept_name = #{zhongkongDeptName}
            </if>
            <if test="beisenDeptId != null">
                and beisen_dept_id = #{beisenDeptId}
            </if>
            <if test="beisenDeptNum != null and beisenDeptNum != ''">
                and beisen_dept_num = #{beisenDeptNum}
            </if>
            <if test="beisenDeptName != null and beisenDeptName != ''">
                and beisen_dept_name = #{beisenDeptName}
            </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>
            <if test="zhongkongDimissionType != null">
                and zhongkong_dimission_type = #{zhongkongDimissionType}
            </if>
            <if test="zhongkongDimissionReason != null and zhongkongDimissionReason != ''">
                and zhongkong_dimission_reason = #{zhongkongDimissionReason}
            </if>
        </where>
    </select>


</mapper>
