<?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="jnpf.personnels.mapper.FtbThousandFacePersonMapper">

    <select id="getEmployeeNum" resultType="java.lang.Long">
        SELECT
        COUNT(*)
        FROM
        ftb_personnels_staff_roster a
        WHERE
        a.F_WorkerStatus IN
        <foreach collection="workStatus" open="(" close=")" separator="," item="statuss">
            #{statuss}
        </foreach>
        <if test="userIds != null and userIds.size() != 0">
            and a.F_UserId IN
            <foreach collection="userIds" open="(" close=")" separator="," item="userId">
                #{userId}
            </foreach>
        </if>
        AND a.F_EnabledMark = 0
    </select>

    <select id="getTurnoverAllPeople" resultType="java.lang.Long">
        select count(*) from ftb_personnels_staff_transfer_position where
        F_EnabledMark = 0
        <if test="userIds != null and userIds.size() != 0">
            and F_UserId IN
            <foreach collection="userIds" open="(" close=")" separator="," item="userId">
                #{userId}
            </foreach>
        </if>
        and DATE_FORMAT(F_TransferDate, '%Y-%m') = DATE_FORMAT(now(), '%Y-%m')
        and (F_CheckStatus = 2 or F_IsNeedCheck = 1)
    </select>

</mapper>