baseBean sortParamMap 先注释

yun-zuoyi
wynne1005 5 years ago
parent 953e243fe8
commit 887e1d04f7

@ -150,26 +150,26 @@ public abstract class BaseBean implements Serializable {
return this.isDeleted == null ? 0 : this.isDeleted; return this.isDeleted == null ? 0 : this.isDeleted;
} }
@Transient // @Transient
@ApiParam(value = "多列排序") // @ApiParam(value = "多列排序")
@AnnoOutputColumn(hidden = true) // @AnnoOutputColumn(hidden = true)
public LinkedHashMap<String,Integer> sortParamMap; // public LinkedHashMap<String,Integer> sortParamMap;
//
//排序方式 // //排序方式
public String orderBy(){ // public String orderBy(){
StringBuffer result = new StringBuffer(" order by "); // StringBuffer result = new StringBuffer(" order by ");
//
if (sortParamMap != null && sortParamMap.size() != 0) { // if (sortParamMap != null && sortParamMap.size() != 0) {
for (String key : sortParamMap.keySet()) { // for (String key : sortParamMap.keySet()) {
packOrderByHql(result,orderByParam,ascOrDesc); // packOrderByHql(result,orderByParam,ascOrDesc);
} // }
} else if (orderByParam != null && orderByParam.trim().length() > 0) { // } else if (orderByParam != null && orderByParam.trim().length() > 0) {
packOrderByHql(result,orderByParam,ascOrDesc); // packOrderByHql(result,orderByParam,ascOrDesc);
}else{ // }else{
return ""; // return "";
} // }
return result.subSequence(0, result.length() - 1).toString(); // return result.subSequence(0, result.length() - 1).toString();
} // }
private void packOrderByHql(StringBuffer stringBuffer, String orderByParam, Integer ascOrDesc) { private void packOrderByHql(StringBuffer stringBuffer, String orderByParam, Integer ascOrDesc) {
stringBuffer.append(" ").append(orderByParam); stringBuffer.append(" ").append(orderByParam);

Loading…
Cancel
Save