Example #1
0
        /// <summary>
        /// 数据库链接分页
        /// </summary>
        /// <param name="paramIn">入参</param>
        /// <returns>结果</returns>
        public PagerParamOut <ConString> PagerConString(PagerParamIn <ConStringCondition> paramIn)
        {
            var con        = ConnectionHelper.GetSqlSugarClient();
            int totalCount = 0;

            var where = con.Queryable <ConString>();
            if (string.IsNullOrWhiteSpace(paramIn.Data.ConName) == false)
            {
                where.Where(p => p.ConStringName.Contains(paramIn.Data.ConName));
            }

            var list = where.ToPageList(paramIn.PageNo, paramIn.PageSize, ref totalCount);

            return(new PagerParamOut <ConString>()
            {
                Success = true, Rows = list
            });
        }
Example #2
0
        /// <summary>
        /// 表设计分页
        /// </summary>
        /// <returns>结果</returns>
        public PagerParamOut <TableInfo> PagerTableModel(PagerParamIn <TablePagerCondition> paramIn)
        {
            var con = ConnectionHelper.GetSqlSugarClient();

            var where = con.Queryable <TableInfo>();
            if (string.IsNullOrWhiteSpace(paramIn?.Data?.DatabaseName) == false)
            {
                where.Where(p => p.DatabaseName == paramIn.Data.DatabaseName);
            }

            if (string.IsNullOrWhiteSpace(paramIn?.Data?.TableName) == false)
            {
                where.Where(p => p.TableDesc.Contains(paramIn.Data.TableName));
            }

            int totalCount = 0;
            var list       = where.ToPageList(paramIn.PageNo, paramIn.PageSize, ref totalCount);

            return(new PagerParamOut <TableInfo> {
                Success = true, Rows = list
            });
        }
Example #3
0
        /// <summary>
        /// 数据库任务分页
        /// </summary>
        /// <param name="paramIn">入参</param>
        /// <returns>结果</returns>
        public PagerParamOut <DBTask> PagerDBTask(PagerParamIn <DBTaskCondition> paramIn)
        {
            var con = ConnectionHelper.GetSqlSugarClient();

            var where = con.Queryable <DBTask>();
            if (string.IsNullOrWhiteSpace(paramIn?.Data?.BusinessContent) == false)
            {
                where.Where(p => p.BusinessContent.Contains(paramIn.Data.BusinessContent));
            }

            if (string.IsNullOrWhiteSpace(paramIn?.Data?.ExecuteMsg) == false)
            {
                where.Where(p => p.ExecuteMsg.Contains(paramIn.Data.ExecuteMsg));
            }

            if (paramIn.Data != null && paramIn.Data.BusinessType != 0)
            {
                where.Where(p => p.BusinessType == (BusinessType)paramIn.Data.BusinessType);
            }

            if (paramIn.Data != null && paramIn.Data.ExecuteStatus != 0)
            {
                where.Where(p => p.ExecuteStatus == paramIn.Data.ExecuteStatus);
            }

            if (string.IsNullOrWhiteSpace(paramIn.Data?.Remark))
            {
                where.Where(p => p.Remark.Contains(paramIn.Data.Remark));
            }

            int totalCount = 0;
            var data       = where.ToPageList(paramIn.PageNo, paramIn.PageSize, ref totalCount);

            return(new PagerParamOut <DBTask>()
            {
                Success = true, Rows = data, PageSize = paramIn.PageSize, PageNo = paramIn.PageNo, Total = totalCount
            });
        }
Example #4
0
 public PagerParamOut <ConString> PagerConString(PagerParamIn <ConStringCondition> paramIn)
 {
     return(new BConString().PagerConString(paramIn));
 }
Example #5
0
 public PagerParamOut <DBTask> PagerDBTask(PagerParamIn <DBTaskCondition> paramIn)
 {
     return(new BTask().PagerDBTask(paramIn));
 }
Example #6
0
 public PagerParamOut <TableInfo> PagerTableModel(PagerParamIn <TablePagerCondition> paramIn)
 {
     return(new BTable().PagerTableModel(paramIn));
 }