using System.Linq;
using Edu.Model.Entity.User;

namespace Edu.Repository.User
{
    /// <summary>
    /// 每月请假时长
    /// </summary>
    public partial class RB_Attendance_LeaveTimeRepository : BaseRepository<RB_Attendance_LeaveTime>
    {
        /// <summary>
        /// 获取
        /// </summary>
        /// <param name="eid"></param>
        /// <param name="MonthStr"></param>
        /// <param name="AskforleaveType"></param>
        /// <returns></returns>
        public RB_Attendance_LeaveTime Get(int eid, string MonthStr, int AskforleaveType) {
            string where = $@" where 1=1 and {nameof(RB_Attendance_LeaveTime.EmployeeId)}={eid} and {nameof(RB_Attendance_LeaveTime.AskforleaveMonth)}='{MonthStr}' and {nameof(RB_Attendance_LeaveTime.AskforleaveType)}={AskforleaveType}";
            return Get($" select * from rb_attendance_leavetime {where}").FirstOrDefault();
        }
    }
}
