临时提交

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,21 +582,22 @@ public class ChannelProvider {
public String queryListWithChildForSy(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder();
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)) " +
" AND coalesce(wdc.gb_parent_id, wdc.parent_id) in (");
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(" ");
List<CameraGroup> groupList = (List<CameraGroup>)params.get("groupList");
boolean first = true;
for (CameraGroup group : groupList) {
if (!first) {
sqlBuild.append(",");
if (groupList != null && !groupList.isEmpty()) {
sqlBuild.append(" AND coalesce(wdc.gb_parent_id, wdc.parent_id) in (");
boolean first = true;
for (CameraGroup group : groupList) {
if (!first) {
sqlBuild.append(",");
}
sqlBuild.append("'" + group.getDeviceId() + "'");
first = false;
}
sqlBuild.append("'" + group.getDeviceId() + "'");
first = false;
sqlBuild.append(" )");
}
sqlBuild.append(" )");
if (params.get("query") != null) {
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 '/' )")

View File

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

View File

@@ -110,7 +110,7 @@ public class CameraChannelController {
@RequestParam(required = false) String query,
@RequestParam(required = false) String sortName,
@RequestParam(required = false) Boolean order,
String groupAlias,
@RequestParam(required = false) String groupAlias,
@RequestParam(required = false) String geoCoordSys,
@RequestParam(required = false) Boolean status){
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) {
List<CameraGroup> groupList = null;
// 构建组织结构信息
CameraGroup group = groupMapper.queryGroupByAlias(groupAlias);
Assert.notNull(group, "组织结构不存在");
String groupDeviceId = group.getDeviceId();
// 获取所有子节点
List<CameraGroup> groupList = queryAllGroupChildren(group.getId(), group.getBusinessGroup());
groupList.add(group);
if (groupAlias != null) {
CameraGroup group = groupMapper.queryGroupByAlias(groupAlias);
Assert.notNull(group, "组织结构不存在");
String groupDeviceId = group.getDeviceId();
// 获取所有子节点
groupList = queryAllGroupChildren(group.getId(), group.getBusinessGroup());
groupList.add(group);
}
// 构建分页
PageHelper.startPage(page, count);
if (query != null) {