protected String createSQLOrderby(Flipper flipper) {
        if (flipper == null || flipper.getSort() == null) return "";
        final String sort = flipper.getSort();
        if (sort.isEmpty() || sort.indexOf(';') >= 0 || sort.indexOf('\n') >= 0) return "";
        String sql = this.sortOrderbySqls.get(sort);
        if (sql != null) return sql;
        final StringBuilder sb = new StringBuilder();
        sb.append(" ORDER BY ");
        if (isNoAlias()) {
            sb.append(sort);
        } else {
            boolean flag = false;
            for (String item : sort.split(",")) {
                if (item.isEmpty()) continue;
                String[] sub = item.split("\\s+");
                if (flag) sb.append(',');
                if (sub.length < 2 || sub[1].equalsIgnoreCase("ASC")) {
                    sb.append(getSQLColumn("a", sub[0])).append(" ASC");
                } else {
                    sb.append(getSQLColumn("a", sub[0])).append(" DESC");
                }
                flag = true;
            }
        }
        sql = sb.toString();
        this.sortOrderbySqls.put(sort, sql);
        return sql;
    }
protected String createSQLOrderby ( Flipper flipper ) { if ( flipper == null || flipper . getSort ( ) == null ) return "" ; final String sort = flipper . getSort ( ) ; if ( sort . isEmpty ( ) || sort . indexOf ( ';' ) >= 0 || sort . indexOf ( '\n' ) >= 0 ) return "" ; String sql = this . sortOrderbySqls . get ( sort ) ; if ( sql != null ) return sql ; final StringBuilder sb = new StringBuilder ( ) ; sb . append ( " ORDER BY " ) ; if ( isNoAlias ( ) ) { sb . append ( sort ) ; } else { boolean flag = false ; for ( String item : sort . split ( "," ) ) { if ( item . isEmpty ( ) ) continue ; String [ ] sub = item . split ( "\\s+" ) ; if ( flag ) sb . append ( ',' ) ; if ( sub . length < 2 || sub [ 1 ] . equalsIgnoreCase ( "ASC" ) ) { sb . append ( getSQLColumn ( "a" , sub [ 0 ] ) ) . append ( " ASC" ) ; } else { sb . append ( getSQLColumn ( "a" , sub [ 0 ] ) ) . append ( " DESC" ) ; } flag = true ; } } sql = sb . toString ( ) ; this . sortOrderbySqls . put ( sort , sql ) ; return sql ; }
根据Flipper获取ORDER BY的SQL语句，不存在Flipper或sort字段返回空字符串

@param flipper 翻页对象

@return String