public List <RoomInformationSearchMiddle> SearchRoominfoByinfoNum(RoomInformationByInfoSearchViewModel roomInformationByInfoSearchViewModel) { var predicate = SearchinfoByinfo(roomInformationByInfoSearchViewModel); var result = DbSet2.Where(D => D.Id.ToString().Contains(roomInformationByInfoSearchViewModel.FloorId)).Join(DbSet.Where(predicate).Include(c => c.DataBase_Type) , a => a.Id.ToString(), D => D.DataBase_Type.Parentid, (a, D) => new RoomInformationSearchMiddle { Id = D.Id, RoomNum = D.RoomNum, RoomCapacity = D.RoomCapacity, RoomDescription = D.RoomDescription, RoomEquipmentCode = D.RoomEquipmentCode, RoomEquipmentName = D.RoomEquipmentName, Sort = D.Sort, RoomStatus = D.RoomStatus, Status = D.Status, IsDelete = D.IsDelete, CreateUser = D.CreateUser, UpdateUser = D.UpdateUser, CreateDate = D.CreateDate, UpdateDate = D.UpdateDate, DataBase_TypeId = D.DataBase_TypeId.ToString(), AreaName = D.DataBase_Type.Name, FloorName = a.Name, Property = a.Property, PropertyPhone = a.PropertyPhone, Website = "http://172.30.10.202:5006/MobileServer/login.html" }).OrderByDescending(a => a.CreateDate).ToList(); return(result); }
public ActionResult <MeetingRoom_Information> Manage_RoomInfoSearchAll(RoomInformationByInfoSearchViewModel roomInformationByInfoSearchViewModel) { RoomInformationSearchResModel roomInformationSearchResModel = new RoomInformationSearchResModel(); var Result = _RoomInformationService.SearchRoominfoByinformation(roomInformationByInfoSearchViewModel); int count = _RoomInformationService.SearchRoominfoByinformationNum(roomInformationByInfoSearchViewModel); roomInformationSearchResModel.Room_info = Result; roomInformationSearchResModel.TotalNum = count; roomInformationSearchResModel.isSuccess = true; roomInformationSearchResModel.baseViewModel.Message = "查询成功"; roomInformationSearchResModel.baseViewModel.ResponseCode = 200; _ILogger.Information("根据会议室信息,查询成功"); return(Ok(roomInformationSearchResModel)); }
//根据条件查询会议室信息 private Expression <Func <MeetingRoom_Information, bool> > SearchinfoByinfo(RoomInformationByInfoSearchViewModel roomInformationByInfoSearchViewModel) { var predicate = WhereExtension.True <MeetingRoom_Information>();//初始化where表达式 predicate = predicate.And(a => a.IsDelete == "0"); predicate = predicate.And(a => a.Id.ToString().Contains(roomInformationByInfoSearchViewModel.Id.ToString())); predicate = predicate.And(a => a.DataBase_TypeId.ToString().Contains(roomInformationByInfoSearchViewModel.AreaAll)); predicate = predicate.And(a => a.RoomEquipmentName.Contains(roomInformationByInfoSearchViewModel.RoomEquipmentName)); if (roomInformationByInfoSearchViewModel.RoomCapacityLeast != null && roomInformationByInfoSearchViewModel.RoomCapacityMost != null) { predicate = predicate.And(a => Convert.ToInt32(a.RoomCapacity) >= roomInformationByInfoSearchViewModel.RoomCapacityLeast && Convert.ToInt32(a.RoomCapacity) <= roomInformationByInfoSearchViewModel.RoomCapacityMost); } return(predicate); }
/// <summary> /// 根据会议室条件查询会议室信息数量 /// </summary> /// <param name="roomInformationSearchViewModel"></param> /// <returns></returns> public int SearchRoominfoByinformationNum(RoomInformationByInfoSearchViewModel roomInformationByInfoSearchViewModel) { List <RoomInformationSearchMiddle> meetingroom_information = _IRoomInformationRepository.SearchRoominfoByinfoNum(roomInformationByInfoSearchViewModel); return(meetingroom_information.Count); }
/// <summary> /// 根据会议室条件查询会议室信息 /// </summary> /// <param name="roomInformationSearchViewModel"></param> /// <returns></returns> public List <RoomInformationSearchMiddle> SearchRoominfoByinformation(RoomInformationByInfoSearchViewModel roomInformationByInfoSearchViewModel) { List <RoomInformationSearchMiddle> meetingroom_information = _IRoomInformationRepository.SearchRoomInfoByinfo(roomInformationByInfoSearchViewModel); return(meetingroom_information); }