public async Task <IActionResult> GetConfirmDemandAndProvideSql([FromBody] ConfirmDemandAndProvideSqlRequest requestDto)
        {
            var commonReportThemeBiz = new CommonReportThemeBiz();
            var response             = await commonReportThemeBiz.GetConfirmDemandAndProvideSql(requestDto);

            if (response == null)
            {
                return(Failed(ErrorCode.DataBaseError, "无数据,请检查!"));
            }
            var conditionList = await commonReportThemeBiz.GetConditionListByThemeGuid(response.ThemeGuid);

            response.ApproveConditionInfoList = conditionList;
            return(Success(response));
        }
예제 #2
0
        /// <summary>
        ///  IT-获取单条申请
        /// </summary>
        /// <param name="requestDto"></param>
        /// <returns></returns>
        public async Task <ConfirmDemandAndProvideSqlResponse> GetConfirmDemandAndProvideSql(ConfirmDemandAndProvideSqlRequest 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.creation_date 
                                        FROM
	                                        t_utility_sms_approve AS ap
	                                        LEFT JOIN t_utility_sms_theme AS th ON ap.theme_guid = th.theme_guid 
	                                        AND ap.ENABLE =
	                                        TRUE LEFT JOIN t_utility_user AS u ON ap.approved_user_guid = u.user_guid
	                                        LEFT JOIN t_utility_user AS u2 ON ap.approving_user_guid = u2.user_guid 
                                        WHERE
	                                        th.`enable` = TRUE 
	                                        AND ap.approve_guid = @ApproveGuid 
                                        ORDER BY
	                                        ap.creation_date "    ;
                var response = await conn.QueryFirstAsync <ConfirmDemandAndProvideSqlResponse>(sqlStr, new { requestDto.ApproveGuid });

                return(response);
            }
        }