修复国标设备/设备列表中业务分组的子节点查看

This commit is contained in:
648540858
2024-10-22 17:21:08 +08:00
parent 4c497ef411
commit 53f2f36f37
7 changed files with 23 additions and 26 deletions

View File

@@ -86,9 +86,9 @@ public interface DeviceChannelMapper {
@SelectProvider(type = DeviceChannelProvider.class, method = "queryChannels")
List<DeviceChannel> queryChannels(@Param("deviceDbId") int deviceDbId, @Param("civilCode") String civilCode,
@Param("parentChannelId") String parentChannelId, @Param("query") String query,
@Param("hasSubChannel") Boolean hasSubChannel, @Param("online") Boolean online,
@Param("channelIds") List<String> channelIds);
@Param("businessGroupId") String businessGroupId, @Param("parentChannelId") String parentChannelId,
@Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel,
@Param("online") Boolean online, @Param("channelIds") List<String> channelIds);
@SelectProvider(type = DeviceChannelProvider.class, method = "queryChannelsByDeviceDbId")
List<DeviceChannel> queryChannelsByDeviceDbId(@Param("deviceDbId") int deviceDbId);

View File

@@ -154,7 +154,7 @@ public interface GroupMapper {
" SELECT " +
" wcg.device_id as gb_device_id," +
" wcg.name as gb_name," +
" wcg.business_group as gb_business_group," +
" wcg.business_group as gb_business_group_id," +
" 1 as gb_parental," +
" wcg.parent_device_id as gb_parent_id" +
" from wvp_common_group wcg" +

View File

@@ -61,7 +61,9 @@ public class DeviceChannelProvider {
StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(getBaseSelectSql());
sqlBuild.append(" where dc.device_db_id = #{deviceDbId} ");
if (params.get("parentChannelId") != null ) {
if (params.get("businessGroupId") != null ) {
sqlBuild.append(" AND coalesce(dc.gb_business_group_id, dc.business_group_id)=#{businessGroupId} AND coalesce(dc.gb_parent_id, dc.parent_id) is null");
}else if (params.get("parentChannelId") != null ) {
sqlBuild.append(" AND coalesce(dc.gb_parent_id, dc.parent_id)=#{parentChannelId}");
}
if (params.get("civilCode") != null ) {