<?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.attendance.mapper.AttendanceFixedClassMapper" >
<!--    校验该班次有无在固定排班使用-->
    <select id="getUseBYShiftNameId" resultType="java.lang.Integer">
        SELECT COUNT(0) FROM ftb_attendance_fixed_class
        WHERE F_ShiftNameId = #{shiftNameId}
    </select>
    <!--    校验该班次有无在排班使用-->
    <select id="getRuleUseBYShiftNameId" resultType="java.lang.Integer">
        SELECT COUNT(0) FROM ftb_attendance_daily_rule
        WHERE F_ShiftId = #{shiftNameId}
    </select>
    <!--    校验该班次有无在快速排班使用-->
    <select id="getQuickUseBYShiftNameId" resultType="java.lang.Integer">
        SELECT COUNT(n.F_Id) FROM ftb_attendance_quick_template_item_new n
        LEFT JOIN ftb_attendance_quick_template t ON n.F_TemplateId = t.F_Id
        WHERE n.F_ShiftNameId = #{shiftNameId} AND t.F_DeleteMark = 0
    </select>
</mapper>