snaker-core/src/main/java/org/snaker/engine/helper/StringHelper.java
public static String buildPageOrder(String order, String orderby) {
		if(isEmpty(orderby) || isEmpty(order)) return "";
		String[] orderByArray = StringUtils.split(orderby, ',');
		String[] orderArray = StringUtils.split(order, ',');
		if(orderArray.length != orderByArray.length) throw new SnakerException("分页多重排序参数中,排序字段与排序方向的个数不相等");
		StringBuilder orderStr = new StringBuilder(30);
		orderStr.append(" order by ");

		for (int i = 0; i < orderByArray.length; i++) {
			orderStr.append(orderByArray[i]).append(" ").append(orderArray[i]).append(" ,");
		}
		orderStr.deleteCharAt(orderStr.length() - 1);
		return orderStr.toString();
	}
public static String buildPageOrder(String order, String orderby) {
		if(isEmpty(orderby) || isEmpty(order)) return "";
		String[] orderByArray = StringUtils.split(orderby, ',');
		String[] orderArray = StringUtils.split(order, ',');
		if(orderArray.length != orderByArray.length) throw new SnakerException("分页多重排序参数中,排序字段与排序方向的个数不相等");
		StringBuilder orderStr = new StringBuilder(30);
		orderStr.append(" order by ");

		for (int i = 0; i < orderByArray.length; i++) {
			orderStr.append(orderByArray[i]).append(" ").append(orderArray[i]).append(" ,");
		}
		orderStr.deleteCharAt(orderStr.length() - 1);
		return orderStr.toString();
	}
public static String buildPageOrder ( String order , String orderby ) { if ( isEmpty ( orderby ) || isEmpty ( order ) ) return "" ; String [ ] orderByArray = StringUtils . split ( orderby , ' ' ) ; String [ ] orderArray = StringUtils . split ( order , ' ' ) ; if ( orderArray . length != orderByArray . length ) throw new SnakerException ( "分页多重排序参数中,排序字段与排序方向的个数不相等"); StringBuilder orderStr = new StringBuilder ( 30 ) ; orderStr . append ( " order by " ) ; for ( int i = 0 ; i < orderByArray . length ; i ++ ) { orderStr . append ( orderByArray [ i ] ) . append ( " " ) . append ( orderArray [ i ] ) . append ( " ," ) ; } orderStr . deleteCharAt ( orderStr . length ( ) - 1 ) ; return orderStr . toString ( ) ; }
构造排序条件
@param order 排序方向
@param orderby 排序字段
@return 组装好的排序sql
构造排序条件