using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using Edu.Model.ViewModel.User;
using Edu.Model.Entity.User;
using Edu.Common.Enum.User;

namespace Edu.Repository.User
{
    /// <summary>
    /// 打卡方式扩展方法
    /// </summary>
    public partial class Rb_attendance_wayRepository: BaseRepository<RB_Attendance_Way>
    {
        /// <summary>
        /// 根据员工id获取公司打卡方式
        /// </summary>
        /// <param name="empId">员工id</param>
        /// <returns></returns>
        public List<RB_Attendance_Way_Extend> GetWayByEmployeeId(int empId)
        {
            return Get<RB_Attendance_Way_Extend>($@"SELECT * from rb_attendance_way aw where aw.Attendance_Id = (SELECT a.Id from rb_attendance a where a.RB_BranchId =  (SELECT e.RB_Branch_id from rb_employee e where e.EmployeeId= {empId}))").ToList();
        }
    }
}
