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

    <resultMap id="BaseResultMap" type="com.ssm.manage.entity.RlStaff">
        <result property="staffNum" column="staff_num"/>
        <result property="staffName" column="staff_name"/>
        <result property="sex" column="sex"/>
        <result property="mobilePhone" column="mobile_phone"/>
        <result property="qq" column="QQ"/>
        <result property="wechat" column="wechat"/>
        <result property="joinedDate" column="joined_date"/>
        <result property="leaveDate" column="leave_date"/>
        <result property="reinstateDate" column="reinstate_date"/>
        <result property="password" column="password"/>
        <result property="identityCard" column="identity_card"/>
        <result property="state" column="state"/>
        <result property="job" column="job"/>
        <result property="grade" column="grade"/>
        <result property="brandNumber" column="brand_number"/>
        <result property="briefIntroduction" column="brief_introduction"/>
        <result property="goodAt" column="good_at"/>
        <result property="popularity" column="popularity"/>
        <result property="userState" column="user_state"/>
        <result property="roleNum" column="role_num"/>
        <result property="roleName" column="role_name"/>
        <result property="storeId" column="store_id"/>
        <result property="storeName" column="store_name"/>
        <result property="row" column="row"/>
        <result property="monthTask" column="month_task"/>
        <result property="baseSalary" column="base_salary"/>
        <result property="id" column="id"/>
        <result property="monthLowerFour" column="month_lower_four"/>
        <result property="monthLowerFourRatio" column="month_lower_four_ratio"/>
        <result property="rechargeAchi" column="recharge_achi"/>
        <result property="courseAchi" column="course_achi"/>
        <result property="cashAchi" column="cash_achi"/>
        <result property="source" column="source"/>
        <result property="type" column="type"/>
        <result property="deptName" column="dept_name"/>
        <result property="storeCodeBefore" column="store_code_before"/>
        <result property="storeNameBefore" column="store_name_before"/>
        <result property="postId" column="post_id"/>
        <result property="postNum" column="post_num"/>
        <result property="postName" column="post_name"/>
        <result property="wordTypeNum" column="word_type_num"/>
        <result property="wordTypeName" column="word_type_name"/>
        <result property="wordTypeId" column="word_type_id"/>
        <result property="roleId" column="role_id"/>
        <result property="inputId" column="input_id"/>
        <result property="inputBy" column="input_by"/>
        <result property="inputDate" column="input_date"/>
        <result property="modifyId" column="modify_id"/>
        <result property="modifyBy" column="modify_by"/>
        <result property="modifyDate" column="modify_date"/>
    </resultMap>

    <sql id="Base_Column_List">
        staff_num
        , staff_name, sex, mobile_phone, QQ, wechat, joined_date, leave_date, reinstate_date, password, identity_card, state, job, grade, brand_number, brief_introduction, good_at, popularity, user_state, role_num, role_name, store_id, store_name, row, month_task, base_salary, id, month_lower_four, month_lower_four_ratio, recharge_achi, course_achi, cash_achi, source, type, dept_name, store_code_before, store_name_before, post_id, post_num, post_name, word_type_num, word_type_name, word_type_id, role_id, input_id, input_by, input_date, modify_id, modify_by, modify_date
    </sql>

    <select id="queryAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"></include>
        from rl_staff
        <where>
            <if test="staffNum != null and staffNum != ''">
                and staff_num = #{staffNum}
            </if>
            <if test="staffName != null and staffName != ''">
                and staff_name = #{staffName}
            </if>
            <if test="sex != null">
                and sex = #{sex}
            </if>
            <if test="mobilePhone != null and mobilePhone != ''">
                and mobile_phone = #{mobilePhone}
            </if>
            <if test="qq != null and qq != ''">
                and QQ = #{qq}
            </if>
            <if test="wechat != null and wechat != ''">
                and wechat = #{wechat}
            </if>
            <if test="joinedDate != null">
                and joined_date = #{joinedDate}
            </if>
            <if test="leaveDate != null">
                and leave_date = #{leaveDate}
            </if>
            <if test="reinstateDate != null">
                and reinstate_date = #{reinstateDate}
            </if>
            <if test="password != null and password != ''">
                and password = #{password}
            </if>
            <if test="identityCard != null and identityCard != ''">
                and identity_card = #{identityCard}
            </if>
            <if test="state != null">
                and state = #{state}
            </if>
            <if test="job != null">
                and job = #{job}
            </if>
            <if test="grade != null">
                and grade = #{grade}
            </if>
            <if test="brandNumber != null and brandNumber != ''">
                and brand_number = #{brandNumber}
            </if>
            <if test="briefIntroduction != null and briefIntroduction != ''">
                and brief_introduction = #{briefIntroduction}
            </if>
            <if test="goodAt != null and goodAt != ''">
                and good_at = #{goodAt}
            </if>
            <if test="popularity != null">
                and popularity = #{popularity}
            </if>
            <if test="userState != null">
                and user_state = #{userState}
            </if>
            <if test="roleNum != null and roleNum != ''">
                and role_num = #{roleNum}
            </if>
            <if test="roleName != null and roleName != ''">
                and role_name = #{roleName}
            </if>
            <if test="storeId != null">
                and store_id = #{storeId}
            </if>
            <if test="storeName != null and storeName != ''">
                and store_name = #{storeName}
            </if>
            <if test="row != null">
                and row = #{row}
            </if>
            <if test="monthTask != null and monthTask != ''">
                and month_task = #{monthTask}
            </if>
            <if test="baseSalary != null">
                and base_salary = #{baseSalary}
            </if>
            <if test="id != null">
                and id = #{id}
            </if>
            <if test="monthLowerFour != null">
                and month_lower_four = #{monthLowerFour}
            </if>
            <if test="monthLowerFourRatio != null">
                and month_lower_four_ratio = #{monthLowerFourRatio}
            </if>
            <if test="rechargeAchi != null">
                and recharge_achi = #{rechargeAchi}
            </if>
            <if test="courseAchi != null">
                and course_achi = #{courseAchi}
            </if>
            <if test="cashAchi != null">
                and cash_achi = #{cashAchi}
            </if>
            <if test="source != null">
                and source = #{source}
            </if>
            <if test="type != null">
                and type = #{type}
            </if>
            <if test="deptName != null">
                and dept_name = #{deptName}
            </if>
            <if test="storeCodeBefore != null">
                and store_code_before = #{storeCodeBefore}
            </if>
            <if test="storeNameBefore != null and storeNameBefore != ''">
                and store_name_before = #{storeNameBefore}
            </if>
            <if test="postId != null">
                and post_id = #{postId}
            </if>
            <if test="postNum != null and postNum != ''">
                and post_num = #{postNum}
            </if>
            <if test="postName != null and postName != ''">
                and post_name = #{postName}
            </if>
            <if test="wordTypeNum != null and wordTypeNum != ''">
                and word_type_num = #{wordTypeNum}
            </if>
            <if test="wordTypeName != null and wordTypeName != ''">
                and word_type_name = #{wordTypeName}
            </if>
            <if test="wordTypeId != null">
                and word_type_id = #{wordTypeId}
            </if>
            <if test="roleId != null">
                and role_id = #{roleId}
            </if>
            <if test="inputId != null">
                and input_id = #{inputId}
            </if>
            <if test="inputBy != null and inputBy != ''">
                and input_by = #{inputBy}
            </if>
            <if test="inputDate != null">
                and input_date = #{inputDate}
            </if>
            <if test="modifyId != null">
                and modify_id = #{modifyId}
            </if>
            <if test="modifyBy != null and modifyBy != ''">
                and modify_by = #{modifyBy}
            </if>
            <if test="modifyDate != null">
                and modify_date = #{modifyDate}
            </if>
        </where>
    </select>


</mapper>
