public async Task <IActionResult> GetDoctorByFirstLevelOfficeNameAsync([FromQuery] GetDoctorByFirstLevelOfficeNameRequestDto requestDto) { var officeBiz = new OfficeBiz(); var levelOneOffices = await officeBiz.GetModelByNameAsync(requestDto.OfficeName); var officeIds = new List <string>(); var officeModels = await officeBiz.GetAllAsync(); foreach (var item in levelOneOffices) { officeIds.AddRange(officeBiz.GetOfficeListByParentOfficeNode(item.OfficeGuid, officeModels)); } requestDto.OfficeIds = officeIds; var response = await new DoctorBiz().GetDoctorByFirstLevelOfficeNameAsync(requestDto); return(Success(response)); }
/// <summary> /// 根据一级科室名称获取医生分页列表 /// </summary> /// <param name="requestDto"></param> /// <returns></returns> public async Task <GetDoctorByFirstLevelOfficeNameResponseDto> GetDoctorByFirstLevelOfficeNameAsync(GetDoctorByFirstLevelOfficeNameRequestDto requestDto) { var sql = $@"SELECT doc.doctor_guid AS DoctorGuid, tbUser.user_name AS DoctorName, doc.hospital_guid AS HospitalGuid, hos.hos_name AS HospitalName, doc.office_guid AS OfficeGuid, doc.office_name AS OfficeName, jobTitle.config_name AS Title, doc.adept_tags AS AdeptTags, doc.honor AS Honor, CONCAT( picture.base_path, picture.relative_path ) AS Picture, CONCAT( hospicture.base_path, hospicture.relative_path ) AS HospitalPicture FROM t_doctor AS doc inner join t_utility_user u on doc.doctor_guid=u.user_guid LEFT JOIN t_manager_dictionary AS jobTitle ON doc.title_guid = jobTitle.dic_guid AND jobTitle.`enable` = TRUE LEFT JOIN t_utility_accessory AS picture ON accessory_guid = doc.portrait_guid AND picture.`enable` = TRUE LEFT JOIN t_utility_user AS tbUser ON tbUser.user_guid = doc.doctor_guid AND tbUser.`enable` = TRUE LEFT JOIN t_doctor_hospital AS hos ON hos.hospital_guid = doc.hospital_guid AND hos.`enable` = TRUE LEFT JOIN t_utility_accessory AS hospicture ON hospicture.accessory_guid = hos.logo_guid WHERE doc.`enable` = TRUE AND doc.`status` = 'approved' and hos.`enable`=1 and doc.office_guid in @OfficeIds ORDER BY doc.creation_date" ; return(await MySqlHelper.QueryByPageAsync <GetDoctorByFirstLevelOfficeNameRequestDto, GetDoctorByFirstLevelOfficeNameResponseDto, GetDoctorByFirstLevelOfficeNameItemDto>(sql, requestDto)); }