Compare commits
2 Commits
1ac9b5ae0b
...
76c324b0df
| Author | SHA1 | Date | |
|---|---|---|---|
| 76c324b0df | |||
| a65e8dd2cc |
@@ -58,18 +58,6 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
|||||||
// 创建Page对象
|
// 创建Page对象
|
||||||
Page<Organization> page = new Page<>(pageNo, pageSize);
|
Page<Organization> page = new Page<>(pageNo, pageSize);
|
||||||
|
|
||||||
// 处理动态排序(仅当排序字段有效时才添加排序条件)
|
|
||||||
if (sortField != null && !sortField.isEmpty()) {
|
|
||||||
// 校验排序字段是否为Organization实体中的有效字段(防止非法字段)
|
|
||||||
if (isValidField(Organization.class, sortField)) {
|
|
||||||
// 驼峰转下划线处理
|
|
||||||
String underlineField = camelToUnderline(sortField);
|
|
||||||
// 默认为升序,若指定desc则按降序
|
|
||||||
boolean isAsc = sortOrder == null || "asc".equalsIgnoreCase(sortOrder);
|
|
||||||
queryWrapper.last("ORDER BY " + underlineField + " " + (isAsc ? "ASC" : "DESC"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 执行分页查询
|
// 执行分页查询
|
||||||
page = organizationService.page(page, queryWrapper);
|
page = organizationService.page(page, queryWrapper);
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -57,6 +58,7 @@ public class OrganizationDto {
|
|||||||
private Integer displayOrder;
|
private Integer displayOrder;
|
||||||
|
|
||||||
/** 子集合 */
|
/** 子集合 */
|
||||||
|
@ToString.Exclude
|
||||||
private List<OrganizationDto> children = new ArrayList<>();
|
private List<OrganizationDto> children = new ArrayList<>();
|
||||||
|
|
||||||
/** 挂号科室标记 */
|
/** 挂号科室标记 */
|
||||||
|
|||||||
Reference in New Issue
Block a user