fix: 添加deleted字段过滤,确保树形数据正确
This commit is contained in:
parent
372b5ead26
commit
e6308b937f
@ -86,6 +86,12 @@ public class DemandType implements Serializable {
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除:0-未删除,1-已删除
|
||||
*/
|
||||
@TableField("deleted")
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 子分类列表(不存储在数据库)
|
||||
*/
|
||||
|
||||
@ -49,6 +49,7 @@ public class ConfigService {
|
||||
public List<DemandType> getDemandTypesTree() {
|
||||
List<DemandType> allTypes = demandTypeMapper.selectList(
|
||||
new LambdaQueryWrapper<DemandType>()
|
||||
.eq(DemandType::getDeleted, 0) // 过滤已删除的
|
||||
.orderByAsc(DemandType::getSortOrder)
|
||||
);
|
||||
// 构建树形结构
|
||||
@ -83,6 +84,7 @@ public class ConfigService {
|
||||
public List<DemandType> getEnabledDemandTypes() {
|
||||
List<DemandType> allTypes = demandTypeMapper.selectList(
|
||||
new LambdaQueryWrapper<DemandType>()
|
||||
.eq(DemandType::getDeleted, 0) // 过滤已删除的
|
||||
.eq(DemandType::getIsEnabled, 1)
|
||||
.orderByAsc(DemandType::getSortOrder)
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user