<?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.AttendanceFieldPersonnelMapper" >
    <insert id="insertList">
        insert into  ftb_attendance_field_personnel (F_Id,  F_GroupId  ,F_UserId  )
        values
        <foreach collection="fieldPersonnelList" item="item" separator=",">
            (#{item.id},#{item.groupId},#{item.userId})
        </foreach>
    </insert>
<!--    根据考勤组Id删除绑定的外勤人员-->
    <delete id="deleteByGroupId">
        DELETE FROM ftb_attendance_field_personnel
        WHERE F_GroupId = #{groupId}
    </delete>
<!--    根据考勤组Id获取外勤人员Id列表-->
    <select id="getUserIdsByGroupId" resultType="java.lang.String">
        SELECT F_UserId
        FROM ftb_attendance_field_personnel
        where F_GroupId = #{groupId}
    </select>
</mapper>