优化通道管理/行政区划页面逻辑

This commit is contained in:
648540858
2024-11-05 18:23:58 +08:00
parent d5eb13192e
commit 9a29f44c86
23 changed files with 237 additions and 244 deletions

View File

@@ -257,8 +257,7 @@ public interface CommonGBChannelMapper {
@SelectProvider(type = ChannelProvider.class, method = "queryList")
List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online,
@Param("hasCivilCode") Boolean hasCivilCode,
@Param("hasGroup") Boolean hasGroup);
@Param("civilCode") String civilCode, @Param("groupDeviceId") String groupDeviceId);
@Select("<script>" +
" select " +

View File

@@ -1,7 +1,6 @@
package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.Group;
import com.genersoft.iot.vmp.gb28181.bean.Region;
import com.genersoft.iot.vmp.gb28181.bean.RegionTree;
import org.apache.ibatis.annotations.*;

View File

@@ -132,17 +132,11 @@ public class ChannelProvider {
if (params.get("online") != null && !(Boolean)params.get("online")) {
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
}
if (params.get("hasCivilCode") != null && (Boolean)params.get("hasCivilCode")) {
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) is not null");
if (params.get("civilCode") != null) {
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) = #{civilCode}");
}
if (params.get("hasCivilCode") != null && !(Boolean)params.get("hasCivilCode")) {
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_parent_id, parent_id) is not null");
}
if (params.get("hasGroup") != null && !(Boolean)params.get("hasGroup")) {
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is null");
if (params.get("groupDeviceId") != null) {
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) = #{groupDeviceId}");
}
return sqlBuild.toString();
}