/// <summary> /// 查询日志 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public static QueryResult <Logs> QueryLogs(LogsQueryFilter filter) { QueryResult <Logs> result = new QueryResult <Logs>(); result.ServicePageIndex = filter.ServicePageIndex; result.PageSize = filter.PageSize; PagingInfoEntity page = DataAccessUtil.ToPagingInfo(filter); CustomDataCommand cmd = DataCommandManager.CreateCustomDataCommandFromConfig("QueryLogs"); using (var sqlBuilder = new DynamicQuerySqlBuilder(cmd.CommandText, cmd, page, "SysNo DESC")) { sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Classes", DbType.Int32, "@Classes", QueryConditionOperatorType.Like, filter.Classes); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Section", DbType.Int32, "@Section", QueryConditionOperatorType.Like, filter.Section); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Family", DbType.Int32, "@Family", QueryConditionOperatorType.Like, filter.Family); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "RefenceSysNo", DbType.Int32, "@RefenceSysNo", QueryConditionOperatorType.Like, filter.RefenceSysNo); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Contents", DbType.String, "@Contents", QueryConditionOperatorType.Like, filter.Contents); cmd.CommandText = sqlBuilder.BuildQuerySql(); result.ResultList = cmd.ExecuteEntityList <Logs>(); result.TotalCount = Convert.ToInt32(cmd.GetParameterValue("@TotalCount")); return(result); } }
/// <summary> /// 查询日志 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public QueryResult <Logs> QueryLogs(LogsQueryFilter filter) { return(LogsMgtDA.QueryLogs(filter)); }