临时提交

This commit is contained in:
lin 2025-10-24 17:07:23 +08:00
parent d029fb7adb
commit 35a1733510
4 changed files with 25 additions and 19 deletions

View File

@ -582,11 +582,12 @@ public class ChannelProvider {
public String queryListWithChildForSy(Map<String, Object> params ){ public String queryListWithChildForSy(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder(); StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(BASE_SQL_FOR_CAMERA_DEVICE); sqlBuild.append(BASE_SQL_FOR_CAMERA_DEVICE);
sqlBuild.append(" where wdc.channel_type != 1 AND (wdc.gb_ptz_type is null || ( wdc.gb_ptz_type != 98 && wdc.gb_ptz_type != 99)) " + sqlBuild.append(" where wdc.channel_type != 1 AND (wdc.gb_ptz_type is null || ( wdc.gb_ptz_type != 98 && wdc.gb_ptz_type != 99)) ");
" AND coalesce(wdc.gb_parent_id, wdc.parent_id) in (");
sqlBuild.append(" ");
List<CameraGroup> groupList = (List<CameraGroup>)params.get("groupList"); List<CameraGroup> groupList = (List<CameraGroup>)params.get("groupList");
if (groupList != null && !groupList.isEmpty()) {
sqlBuild.append(" AND coalesce(wdc.gb_parent_id, wdc.parent_id) in (");
boolean first = true; boolean first = true;
for (CameraGroup group : groupList) { for (CameraGroup group : groupList) {
if (!first) { if (!first) {
@ -596,7 +597,7 @@ public class ChannelProvider {
first = false; first = false;
} }
sqlBuild.append(" )"); sqlBuild.append(" )");
}
if (params.get("query") != null) { if (params.get("query") != null) {
sqlBuild.append(" AND (coalesce(wdc.gb_device_id, wdc.device_id) LIKE concat('%',#{query},'%') escape '/'" + sqlBuild.append(" AND (coalesce(wdc.gb_device_id, wdc.device_id) LIKE concat('%',#{query},'%') escape '/'" +
" OR coalesce(wdc.gb_name, wdc.name) LIKE concat('%',#{query},'%') escape '/' )") " OR coalesce(wdc.gb_name, wdc.name) LIKE concat('%',#{query},'%') escape '/' )")

View File

@ -25,7 +25,7 @@ import java.util.Map;
* catalog事件 * catalog事件
*/ */
@Slf4j @Slf4j
@Component //@Component
public class CatalogEventLister implements ApplicationListener<CatalogEvent> { public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
@Autowired @Autowired

View File

@ -110,7 +110,7 @@ public class CameraChannelController {
@RequestParam(required = false) String query, @RequestParam(required = false) String query,
@RequestParam(required = false) String sortName, @RequestParam(required = false) String sortName,
@RequestParam(required = false) Boolean order, @RequestParam(required = false) Boolean order,
String groupAlias, @RequestParam(required = false) String groupAlias,
@RequestParam(required = false) String geoCoordSys, @RequestParam(required = false) String geoCoordSys,
@RequestParam(required = false) Boolean status){ @RequestParam(required = false) Boolean status){
if (ObjectUtils.isEmpty(query)) { if (ObjectUtils.isEmpty(query)) {

View File

@ -273,13 +273,18 @@ public class CameraChannelService implements CommandLineRunner {
} }
public PageInfo<CameraChannel> queryListWithChild(Integer page, Integer count, String query, String sortName, Boolean order, String groupAlias, Boolean status, String geoCoordSys) { public PageInfo<CameraChannel> queryListWithChild(Integer page, Integer count, String query, String sortName, Boolean order, String groupAlias, Boolean status, String geoCoordSys) {
List<CameraGroup> groupList = null;
// 构建组织结构信息 // 构建组织结构信息
if (groupAlias != null) {
CameraGroup group = groupMapper.queryGroupByAlias(groupAlias); CameraGroup group = groupMapper.queryGroupByAlias(groupAlias);
Assert.notNull(group, "组织结构不存在"); Assert.notNull(group, "组织结构不存在");
String groupDeviceId = group.getDeviceId(); String groupDeviceId = group.getDeviceId();
// 获取所有子节点 // 获取所有子节点
List<CameraGroup> groupList = queryAllGroupChildren(group.getId(), group.getBusinessGroup()); groupList = queryAllGroupChildren(group.getId(), group.getBusinessGroup());
groupList.add(group); groupList.add(group);
}
// 构建分页 // 构建分页
PageHelper.startPage(page, count); PageHelper.startPage(page, count);
if (query != null) { if (query != null) {