예제 #1
0
        /// <summary>
        /// 获取用户挂号分页数据
        /// </summary>
        /// <param name="requestDto"></param>
        /// <param name="userID"></param>
        /// <returns></returns>
        public async Task <GetAppointmentMemberPageListResponseDto> GetAppointmentMemberPageListAsync(GetAppointmentMemberRequestDto requestDto, string userID)
        {
            var sqlWhere = string.Empty;

            //筛选当前登录用户挂号记录数据
            sqlWhere = $" and a.user_guid='{userID}' ";
            if (requestDto.AppointmentRequestStatus.HasValue)
            {
                sqlWhere = $"{sqlWhere} and a.`status`='{requestDto.AppointmentRequestStatus.Value.ToString()}'";
            }
            var sql = $@"SELECT
	                        a.appointment_guid,
	                        a.appointment_no,
	                        a.`status`,
	                        a.appointment_time,
                            a.appointment_deadline,
	                        a.patient_name,
	                        b.hos_name,
	                        b.location,
	                        b.contact_number,
	                        b.longitude,
	                        b.latitude,
	                        d.user_name,
	                        c.office_name 
                        FROM
	                        t_consumer_doctor_appointment a
	                        LEFT JOIN t_doctor_hospital b ON a.hospital_guid = b.hospital_guid
	                        LEFT JOIN t_doctor c ON a.doctor_guid = c.doctor_guid
	                        LEFT JOIN t_utility_user d ON c.doctor_guid = d.user_guid
	                        WHERE 1=1 {sqlWhere} and a.`enable`=1 ORDER BY a.`status`,a.appointment_time "    ;

            return(await MySqlHelper.QueryByPageAsync <GetAppointmentMemberRequestDto, GetAppointmentMemberPageListResponseDto, GetAppointmentMemberItemDto>(sql, requestDto));
        }
예제 #2
0
        public async Task <IActionResult> GetAppointmentMemberAsync([FromQuery] GetAppointmentMemberRequestDto requestDto)
        {
            var response = await new DoctorAppointmentBiz().GetAppointmentMemberPageListAsync(requestDto, UserID);

            return(Success(response));
        }