/// <summary> /// 查询用户 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public static QueryResult <Users> QueryUsers(UsersQueryFilter filter) { QueryResult <Users> result = new QueryResult <Users>(); result.ServicePageIndex = filter.ServicePageIndex; result.PageSize = filter.PageSize; PagingInfoEntity page = DataAccessUtil.ToPagingInfo(filter); CustomDataCommand cmd = DataCommandManager.CreateCustomDataCommandFromConfig("QueryUsers"); using (var sqlBuilder = new DynamicQuerySqlBuilder(cmd.CommandText, cmd, page, "SysNo DESC")) { sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Status", DbType.Int32, "@Status1", QueryConditionOperatorType.NotEqual, CommonStatus.Deleted); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "SysNo", DbType.Int32, "@SysNo", QueryConditionOperatorType.Equal, filter.SysNo); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "UserID", DbType.String, "@UserID", QueryConditionOperatorType.Like, filter.UserID); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "UserName", DbType.String, "@UserName", QueryConditionOperatorType.Like, filter.UserName); sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "Status", DbType.Int32, "@Status", QueryConditionOperatorType.Equal, filter.Status); cmd.CommandText = sqlBuilder.BuildQuerySql(); result.ResultList = cmd.ExecuteEntityList <Users>(); result.TotalCount = Convert.ToInt32(cmd.GetParameterValue("@TotalCount")); return(result); } }
/// <summary> /// 查询用户 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public QueryResult <Users> QueryUsers(UsersQueryFilter filter) { return(UsersMgtDA.QueryUsers(filter)); }