public virtual void ToInfo() { Queue.Sql = new StringBuilder(); var strSelectSql = Visit.Select(Queue.ExpSelect); var strWhereSql = Visit.Where(Queue.ExpWhere); var strOrderBySql = Visit.OrderBy(Queue.ExpOrderBy); if (string.IsNullOrWhiteSpace(strSelectSql)) { strSelectSql = "*"; } if (!string.IsNullOrWhiteSpace(strWhereSql)) { strWhereSql = "WHERE " + strWhereSql; } if (!string.IsNullOrWhiteSpace(strOrderBySql)) { strOrderBySql = "ORDER BY " + strOrderBySql; } Queue.Sql.AppendFormat("SELECT {0} FROM {1} {2} {3} rownum <=1", strSelectSql, Query.DbProvider.KeywordAegis(TableName), strWhereSql, strOrderBySql); }
public virtual Queue ToEntity() { Queue.Sql = new StringBuilder(); var strSelectSql = Visit.Select(Queue.ExpSelect); var strWhereSql = Visit.Where(Queue.ExpWhere); var strOrderBySql = Visit.OrderBy(Queue.ExpOrderBy); if (string.IsNullOrWhiteSpace(strSelectSql)) { strSelectSql = "*"; } if (!string.IsNullOrWhiteSpace(strWhereSql)) { strWhereSql = "WHERE " + strWhereSql; } if (!string.IsNullOrWhiteSpace(strOrderBySql)) { strOrderBySql = "ORDER BY " + strOrderBySql; } Queue.Sql.AppendFormat("SELECT TOP 1 {0} FROM {1} {2} {3}", strSelectSql, QueueManger.DbProvider.KeywordAegis(Queue.Name), strWhereSql, strOrderBySql); return(Queue); }
protected override SqlCaluse OrderBy(UnaryExpression exp, SqlCaluse sqlCaluse) { ExpressionVisit.OrderBy(exp.Operand, sqlCaluse); return(sqlCaluse); }