resultMap修正

This commit is contained in:
2025-11-25 13:08:23 +08:00
parent 61d63be941
commit 5d14957eba
8 changed files with 116 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ package org.xyzh.common.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@@ -53,6 +54,41 @@ public class BaseDTO implements Serializable{
*/
private boolean deleted;
private List<OrderType> orderTypes;
public static class OrderType {
private String field;
private String order;
// 无参构造函数Jackson反序列化需要
public OrderType() {
}
public OrderType(String field, String order) {
this.field = field;
this.order = order;
}
public String getField() {
return field;
}
public void setField(String field) {
this.field = field;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
if("ASC".equals(order.toUpperCase()) || "DESC".equals(order.toUpperCase())) {
this.order = order.toUpperCase();
}else{
throw new IllegalArgumentException("order must be ASC or DESC");
}
}
}
public BaseDTO() {
@@ -174,6 +210,14 @@ public class BaseDTO implements Serializable{
this.deleted = deleted;
}
public List<OrderType> getOrderTypes() {
return orderTypes;
}
public void setOrderTypes(List<OrderType> orderTypes) {
this.orderTypes = orderTypes;
}
@Override
public String toString(){
return "BaseDTO { id=" + id + ", createTime=" + createTime + ", updateTime=" + updateTime + ", deleteTime=" + deleteTime + ", deleted=" + deleted + " }";