feat(organization): 添加科室管理查询过滤功能
- 修复api.js中params参数拼写错误 - 添加科室名称、类型、分类的查询表单 - 实现搜索和重置功能 - 集成分页组件并修正页码参数映射 - 在后端服务中添加查询条件过滤逻辑 - 支持按科室名称、类型、分类进行条件查询 - 实现动态排序功能并修复分页查询逻辑
This commit is contained in:
@@ -58,18 +58,6 @@ public class OrganizationAppServiceImpl implements IOrganizationAppService {
|
||||
// 创建Page对象
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user