throw new JThinkRuntimeException("rowLen不能小于0!");
}
StringBuffered sqlStr = new StringBuffered(17)
.append("SELECT ");
ObjectBuffered values = null;//new ObjectBuffered();
/* 生成limit串 */
if (rowLen != -1) {
sqlStr.append(" LIMIT ").append(startIndex).append(" ").append(rowLen).append(" ");
}
/* 生成DISTINCT串 */
if (distinct) {
sqlStr.append(" DISTINCT ");
}
/* 生成返回列的串 */
if (columns != null && columns.length != 0) {
SQL columnSQL = constructSelectedColumn(columns);
sqlStr.append(columnSQL.getSQLStatement());
values = columnSQL.getValueBuffered();
}else{
sqlStr.append("*");
}
/* 生成FROM子串, 如果tableName为空,将不构建FROM子句 */
if (tableName != null && tableName.length() != 0) {
sqlStr.append(" FROM ").append(tableName);
}
/* 生成查询条件串 */
if (condition != null && condition.size() != 0) {
sqlStr.append(" WHERE ").append(condition.getConditionStatement());
ObjectBuffered objBuff = condition.getValueBuffered();
if(values!=null){
values.append(objBuff);
}else{
values = objBuff;
}