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

        <!-- 查询本月生日的员工 -->
        <select id="getStaffBirthdayList" resultType="jnpf.model.personnels.vo.mcp.StaffBirthdayVO">
            SELECT
            r.F_UserId as userId,
            birthday.F_Value AS birthday,
            r.F_Phone AS phone
            FROM ftb_personnels_staff_roster r
            INNER JOIN (
            SELECT F_RosterId, F_Value
            FROM ftb_personnels_staff_registration_form_data
            WHERE F_FormFieldId = 'birthday'
            AND F_Value IS NOT NULL
            AND F_Value != ''
            ) birthday ON r.F_Id = birthday.F_RosterId
            WHERE r.F_EnabledMark = 0
            <if test="userIds != null and userIds.size() != 0">
                AND r.F_UserId IN
                <foreach item="userId" collection="userIds" separator="," open="(" close=")">
                    #{userId}
                </foreach>
            </if>
            AND DATE_FORMAT(birthday.F_Value, '%m-%d') BETWEEN #{startBirthdayTime} AND #{endBirthdayTime}
            ORDER BY DATE_FORMAT(birthday.F_Value, '%m-%d')
        </select>

        <!-- 查询入职半月还未签署合同的员工 -->
        <select id="getListNotSignedContractHalfMonth" resultType="jnpf.model.personnels.vo.mcp.StaffNotSignContractVO">
            SELECT
                r.F_UserId as userId,
                r.F_Name as name,
                r.F_Phone as phone,
                DATE_FORMAT(r.F_ActualStartDate, '%Y-%m-%d') as actualStartDate
            FROM ftb_personnels_staff_roster r
            WHERE r.F_EnabledMark = 0
              AND r.F_WorkerStatus != '305'
              AND r.F_ContractStatus IN (500, 501)
              AND r.F_ActualStartDate IS NOT NULL
              AND DATEDIFF(CURDATE(), r.F_ActualStartDate) &gt;= 15
            ORDER BY r.F_ActualStartDate
        </select>

        </mapper>
