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