Commit 23b8667b7f6be60858f1149a3a5fdac9daee17c1
1 parent
5d400804
优化部分sql实现
Showing
1 changed file
with
2 additions
and
1 deletions
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java
| @@ -24,7 +24,8 @@ public interface PlatformCatalogMapper { | @@ -24,7 +24,8 @@ public interface PlatformCatalogMapper { | ||
| 24 | 24 | ||
| 25 | @Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " + | 25 | @Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " + |
| 26 | "left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " + | 26 | "left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " + |
| 27 | - "WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} group by pc.id") | 27 | + "WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " + |
| 28 | + "group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id") | ||
| 28 | List<PlatformCatalog> selectByParentId(String platformId, String parentId); | 29 | List<PlatformCatalog> selectByParentId(String platformId, String parentId); |
| 29 | 30 | ||
| 30 | @Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.id=#{id}") | 31 | @Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.id=#{id}") |