using Edu.Model.Entity.Scroll; using Edu.Model.ViewModel.Scroll; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Edu.Repository.Scroll { /// /// 学员预约主表仓储层 /// public class RB_Plan_AppointmentRepository : BaseRepository { /// /// 获取学员预约列表 /// /// /// public List GetPlanAppointmentListRepository(RB_Plan_Appointment_ViewModel query) { StringBuilder builder = new StringBuilder(); builder.AppendFormat(@" SELECT A.* FROM RB_Plan_Appointment AS A WHERE 1=1 "); if (query != null) { if (query.Group_Id > 0) { builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Plan_Appointment_ViewModel.Group_Id), query.Group_Id); } if (!string.IsNullOrEmpty(query.QDate)) { builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Plan_Appointment_ViewModel.Date), query.QDate); } } return Get(builder.ToString()).ToList(); } } }