示例#1
0
        public async Task <IActionResult> GetAskedDoctors([FromBody] GetAskedDoctorsRequestDto requestDto)
        {
            var response = await new DoctorBiz().GetAskedDoctors(requestDto);

            if (response == null)
            {
                return(Failed(ErrorCode.Empty));
            }
            return(Success(response));
        }
示例#2
0
        /// <summary>
        /// 获取问医医生列表
        /// </summary>
        /// <param name="requestDto"></param>
        /// <returns></returns>
        public async Task <GetAskedDoctorsResponseDto> GetAskedDoctors(GetAskedDoctorsRequestDto requestDto)
        {
            string keywordWhere = string.Empty;

            if (!string.IsNullOrWhiteSpace(requestDto.HospitalGuid))
            {
                keywordWhere = $"AND doc.hospital_guid = @HospitalGuid";
            }
            if (!string.IsNullOrWhiteSpace(requestDto.OfficeName))
            {
                keywordWhere = $"AND doc.office_name = @OfficeName";
            }
            if (!string.IsNullOrWhiteSpace(requestDto.AdeptName))
            {
                keywordWhere         = $"AND doc.adept_tags like @AdeptName";
                requestDto.AdeptName = $"%{requestDto.AdeptName}%";
            }
            var sql      = $@"SELECT
	                        doc.doctor_guid AS DoctorGuid,
	                        tbUser.user_name AS DoctorName,
	                        doc.hospital_guid AS HospitalGuid,
	                        doc.hospital_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
	                        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' {keywordWhere} ORDER BY doc.creation_date";
            var response = await MySqlHelper.QueryByPageAsync <GetAskedDoctorsRequestDto, GetAskedDoctorsResponseDto, GetAskedDoctorsItemDto>(sql, requestDto);

            return(response);
        }