Example #1
0
        /// <summary>
        ///  运营-获取单条申请以及发送列表
        /// </summary>
        /// <param name="requestDto"></param>
        /// <returns></returns>
        public async Task <GetOneApproveWithListResponseDto> GetOneApproveWithList(GetOneApproveWithListRequestDto requestDto)
        {
            using (var conn = MySqlHelper.GetConnection())
            {
                var sqlStr   = @"SELECT
	                                        th.theme_guid,
	                                        th.name,
	                                        th.demand,
                                            th.condition_demand,
	                                        th.sqlstr,
	                                        ap.approve_guid,
	                                        ap.apply_user_guid,
	                                        u.user_name AS ApplyUserName,
	                                        ap.sql_writer_guid,
	                                        u2.user_name AS SQLWriterName,
	                                        ap.creation_date 
                                        FROM
	                                        t_report_approve AS ap
	                                        LEFT JOIN t_report_theme AS th ON ap.theme_guid = th.theme_guid 
	                                        AND ap.ENABLE =
	                                        TRUE LEFT JOIN t_utility_user AS u ON ap.apply_user_guid = u.user_guid
	                                        LEFT JOIN t_utility_user AS u2 ON ap.sql_writer_guid = u2.user_guid 
                                        WHERE
	                                        th.`enable` = TRUE 
	                                        AND ap.approve_guid = @ApproveGuid  "    ;
                var response = await conn.QueryFirstAsync <GetOneApproveWithListResponseDto>(sqlStr, new { requestDto.ApproveGuid });

                return(response);
            }
        }
        public async Task <IActionResult> GetOneApproveWithList([FromBody] GetOneApproveWithListRequestDto requestDto)
        {
            var response = await new CommonReportThemeBiz().GetOneApproveWithList(requestDto);

            if (response == null)
            {
                return(Failed(ErrorCode.DataBaseError, "无数据,请检查!"));
            }
            return(Success(response));
        }