优化分组树,行政区划树的展示

This commit is contained in:
648540858
2024-09-26 15:57:55 +08:00
parent 97b0616039
commit c3267403ba
9 changed files with 16 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ import lombok.Data;
@Schema(description = "业务分组树")
public class GroupTree extends Group{
@Schema(description = "是否有子节点")
@Schema(description = "树节点ID")
private String treeId;
@Schema(description = "是否有子节点")

View File

@@ -10,6 +10,9 @@ import lombok.Data;
@Schema(description = "区域树")
public class RegionTree extends Region {
@Schema(description = "树节点ID")
private String treeId;
@Schema(description = "是否有子节点")
private boolean isLeaf;

View File

@@ -263,6 +263,7 @@ public interface CommonGBChannelMapper {
@Select("<script>" +
" select " +
" id," +
" concat('channel', id) as tree_id," +
" coalesce(gb_device_id, device_id) as device_id," +
" coalesce(gb_name, name) as name, " +
" coalesce(gb_parent_id, parent_id) as parent_device_id, " +
@@ -352,6 +353,7 @@ public interface CommonGBChannelMapper {
@Select("<script>" +
" select " +
" id," +
" concat('channel', id) as tree_id," +
" coalesce(gb_device_id, device_id) as device_id," +
" coalesce(gb_name, name) as name, " +
" coalesce(gb_parent_id, parent_id) as parent_device_id, " +

View File

@@ -67,6 +67,7 @@ public interface GroupMapper {
@Select(" <script>" +
" SELECT " +
" * , " +
" concat('group', id) as tree_id," +
" 0 as type," +
" false as is_leaf" +
" from wvp_common_group " +

View File

@@ -72,6 +72,7 @@ public interface RegionMapper {
@Select(" <script>" +
" SELECT " +
" *, " +
" concat('region', id) as tree_id," +
" 0 as type," +
" false as is_leaf" +
" from wvp_common_region " +

View File

@@ -96,10 +96,10 @@ public class ChannelProvider {
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) is null");
}
if (params.get("hasGroup") != null && (Boolean)params.get("hasGroup")) {
sqlBuild.append(" AND coalesce(gb_business_group_id, business_group_id) is not null");
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is not null");
}
if (params.get("hasGroup") != null && !(Boolean)params.get("hasGroup")) {
sqlBuild.append(" AND coalesce(gb_business_group_id, business_group_id) is null");
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is null");
}
return sqlBuild.toString();
}