public List <FlowAuthAuthorEntity> GetFlowAuthAuthorList(FlowAuthAuthorQuery query) { List <FlowAuthAuthorEntity> list = new List <FlowAuthAuthorEntity>(); StringBuilder sqlCommandText = new StringBuilder(); sqlCommandText.Append("SELECT AuthorAuthID,JournalID,ActionID,AuthorID,AddDate FROM dbo.FlowAuthAuthor WITH(NOLOCK)"); string whereSQL = FlowAuthAuthorQueryToSQLWhere(query); string orderBy = FlowAuthAuthorQueryToSQLOrder(query); if (!string.IsNullOrEmpty(whereSQL)) { sqlCommandText.Append(" WHERE " + whereSQL); } if (!string.IsNullOrEmpty(orderBy)) { sqlCommandText.Append(" ORDER BY " + orderBy); } DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString()); using (IDataReader dr = db.ExecuteReader(cmd)) { list = MakeFlowAuthAuthorList(dr); } return(list); }
/// <summary> /// 将查询实体转换为Order语句 /// <param name="query">查询实体</param> /// <returns>获取Order语句,不包含Order</returns> /// </summary> public string FlowAuthAuthorQueryToSQLOrder(FlowAuthAuthorQuery query) { return(" AuthorAuthID DESC"); }
/// <summary> /// 将查询实体转换为Where语句 /// <param name="query">查询实体</param> /// <returns>获取Where语句,不包含Where</returns> /// </summary> public string FlowAuthAuthorQueryToSQLWhere(FlowAuthAuthorQuery query) { StringBuilder sbWhere = new StringBuilder(" JournalID = " + query.JournalID + " AND ActionID = " + query.ActionID); return(sbWhere.ToString()); }
/// <summary> /// 分页获取符合查询条件的数据 /// </summary> /// <param name="flowAuthAuthorQuery">FlowAuthAuthorQuery查询实体对象</param> /// <returns>Pager<FlowAuthAuthorEntity></returns> public List <FlowAuthAuthorEntity> GetFlowAuthAuthorList(FlowAuthAuthorQuery flowAuthAuthorQuery) { return(FlowAuthAuthorDataAccess.Instance.GetFlowAuthAuthorList(flowAuthAuthorQuery)); }
/// <summary> /// 分页获取符合查询条件的数据 /// </summary> /// <param name="flowAuthAuthorQuery">FlowAuthAuthorQuery查询实体对象</param> /// <returns>Pager<FlowAuthAuthorEntity></returns> public List <FlowAuthAuthorEntity> GetFlowAuthAuthorList(FlowAuthAuthorQuery flowAuthAuthorQuery) { return(FlowAuthAuthorBusProvider.GetFlowAuthAuthorList(flowAuthAuthorQuery)); }