临时提交
This commit is contained in:
@@ -101,7 +101,7 @@ public class CommonGBChannel {
|
||||
@Schema(description = "国标-虚拟组织所属的业务分组ID")
|
||||
private String gbBusinessGroupId;
|
||||
|
||||
@Schema(description = "国标-摄像机结构类型,标识摄像机类型: 1-球机; 2-半球; 3-固定枪机; 4-遥控枪机;5-遥控半球;6-多目设备的全景/拼接通道;7-多目设备的分割通道")
|
||||
@Schema(description = "国标-摄像机结构类型,标识摄像机类型: 1-球机; 2-半球; 3-固定枪机; 4-遥控枪机;5-遥控半球;6-多目设备的全景/拼接通道;7-多目设备的分割通道; 99-移动设备(非标)")
|
||||
private Integer gbPtzType;
|
||||
|
||||
// 2016
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.gb28181.dao.provider.ChannelProvider;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
|
||||
import com.genersoft.iot.vmp.web.custom.bean.CameraChannel;
|
||||
import com.genersoft.iot.vmp.web.custom.bean.CameraGroup;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -607,10 +608,15 @@ public interface CommonGBChannelMapper {
|
||||
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryListForSy")
|
||||
List<CameraChannel> queryListForSy(@Param("query") String query, @Param("sortName") String sortName, @Param("order") String order,
|
||||
@Param("groupDeviceId") String groupDeviceId, @Param("online") Boolean online, @Param("containMobileDevice") Boolean containMobileDevice);
|
||||
List<CameraChannel> queryListForSy(@Param("groupDeviceId") String groupDeviceId, @Param("online") Boolean online);
|
||||
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryGbChannelByChannelDeviceIdAndGbDeviceId")
|
||||
CommonGBChannel queryGbChannelByChannelDeviceIdAndGbDeviceId(String deviceId, String deviceCode);
|
||||
CommonGBChannel queryGbChannelByChannelDeviceIdAndGbDeviceId(@Param("channelDeviceId") String channelDeviceId, @Param("gbDeviceId") String gbDeviceId);
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryListByDeviceIds")
|
||||
List<CameraChannel> queryListByDeviceIds(List<String> deviceIds);
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryListWithChildForSy")
|
||||
List<CameraChannel> queryListWithChildForSy(@Param("query") String query, @Param("sortName") String sortName, @Param("order") String order, @Param("groupList") List<CameraGroup> groupList, @Param("status") Boolean status);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Group;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GroupTree;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||
import com.genersoft.iot.vmp.web.custom.bean.CameraGroup;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Mapper
|
||||
@@ -120,6 +122,9 @@ public interface GroupMapper {
|
||||
@Select("SELECT * from wvp_common_group WHERE business_group = #{businessGroup} ")
|
||||
List<Group> queryByBusinessGroup(@Param("businessGroup") String businessGroup);
|
||||
|
||||
@Select("SELECT * from wvp_common_group WHERE business_group = #{businessGroup} ")
|
||||
Map<Integer, CameraGroup> queryByBusinessGroupForMap(@Param("businessGroup") String businessGroup);
|
||||
|
||||
@Delete("DELETE FROM wvp_common_group WHERE business_group = #{businessGroup}")
|
||||
int deleteByBusinessGroup(@Param("businessGroup") String businessGroup);
|
||||
|
||||
@@ -291,7 +296,7 @@ public interface GroupMapper {
|
||||
void deletePlatformGroup(@Param("groupId") int groupId);
|
||||
|
||||
@Select("SELECT * from wvp_common_group WHERE alias = #{alias} ")
|
||||
Group queryGroupByAlias(@Param("alias") String alias);
|
||||
CameraGroup queryGroupByAlias(@Param("alias") String alias);
|
||||
|
||||
@Select("SELECT * from wvp_common_group WHERE alias = #{alias} and business_group = #{businessGroup}")
|
||||
Group queryGroupByAliasAndBusinessGroup(@Param("alias") String alias, @Param("deviceId") String businessGroup);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.gb28181.dao.provider;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Group;
|
||||
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
|
||||
import com.genersoft.iot.vmp.web.custom.bean.CameraGroup;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -194,7 +195,7 @@ public class ChannelProvider {
|
||||
" coalesce(wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
|
||||
" coalesce(wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
|
||||
" from wvp_device_channel wdc\n" +
|
||||
" left join wvp_device wd on wdc.data_type = 1 wd.id = wdc.data_device_id"
|
||||
" left join wvp_device wd on wdc.data_type = 1 AND wd.id = wdc.data_device_id"
|
||||
;
|
||||
|
||||
public String queryByDeviceId(Map<String, Object> params ){
|
||||
@@ -536,55 +537,88 @@ public class ChannelProvider {
|
||||
|
||||
public String queryListForSy(Map<String, Object> params ){
|
||||
StringBuilder sqlBuild = new StringBuilder();
|
||||
sqlBuild.append(BASE_SQL);
|
||||
sqlBuild.append(" where channel_type = 0 ");
|
||||
if (params.get("query") != null) {
|
||||
sqlBuild.append(" AND (coalesce(gb_device_id, device_id) LIKE concat('%',#{query},'%') escape '/'" +
|
||||
" OR coalesce(gb_name, name) LIKE concat('%',#{query},'%') escape '/' )")
|
||||
;
|
||||
}
|
||||
sqlBuild.append(BASE_SQL_FOR_CAMERA_DEVICE);
|
||||
sqlBuild.append(" where wdc.channel_type = 0 AND (wdc.gb_ptz_type is null || wdc.gb_ptz_type != 99) AND coalesce(gb_parent_id, parent_id) = #{groupDeviceId}");
|
||||
if (params.get("online") != null && (Boolean)params.get("online")) {
|
||||
sqlBuild.append(" AND coalesce(gb_status, status) = 'ON'");
|
||||
}
|
||||
if (params.get("online") != null && !(Boolean)params.get("online")) {
|
||||
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
|
||||
}
|
||||
if (params.get("containMobileDevice") != null && !(Boolean)params.get("containMobileDevice")) {
|
||||
sqlBuild.append(" AND gb_ptz_type != 99");
|
||||
|
||||
return sqlBuild.toString();
|
||||
}
|
||||
|
||||
public String queryListWithChildForSy(Map<String, Object> params ){
|
||||
StringBuilder sqlBuild = new StringBuilder();
|
||||
sqlBuild.append(BASE_SQL_FOR_CAMERA_DEVICE);
|
||||
sqlBuild.append(" where wdc.channel_type = 0 AND (wdc.gb_ptz_type is null || wdc.gb_ptz_type != 99) " +
|
||||
"AND coalesce(gb_parent_id, parent_id) = #{groupDeviceId} " +
|
||||
"AND coalesce(gb_parent_id, parent_id) in (");
|
||||
|
||||
sqlBuild.append(" ");
|
||||
List<CameraGroup> groupList = (List<CameraGroup>)params.get("groupList");
|
||||
boolean first = true;
|
||||
for (CameraGroup group : groupList) {
|
||||
if (!first) {
|
||||
sqlBuild.append(",");
|
||||
}
|
||||
sqlBuild.append(group.getId());
|
||||
first = false;
|
||||
}
|
||||
if (params.get("groupDeviceId") != null) {
|
||||
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) = #{groupDeviceId}");
|
||||
}else {
|
||||
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is null");
|
||||
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 '/' )")
|
||||
;
|
||||
}
|
||||
|
||||
if (params.get("online") != null && (Boolean)params.get("online")) {
|
||||
sqlBuild.append(" AND coalesce(gb_status, status) = 'ON'");
|
||||
}
|
||||
if (params.get("online") != null && !(Boolean)params.get("online")) {
|
||||
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
|
||||
}
|
||||
|
||||
|
||||
if (params.get("sortName") != null) {
|
||||
if (params.get("order") == null) {
|
||||
sqlBuild.append(" order by #{sortName} ");
|
||||
}else {
|
||||
sqlBuild.append(" order by #{sortName} #{order}");
|
||||
}
|
||||
|
||||
}
|
||||
return sqlBuild.toString();
|
||||
}
|
||||
|
||||
public String queryGbChannelByChannelDeviceIdAndGbDeviceId(Map<String, Object> params ){
|
||||
StringBuilder sqlBuild = new StringBuilder();
|
||||
sqlBuild.append(BASE_SQL_FOR_CAMERA_DEVICE);
|
||||
sqlBuild.append(" where channel_type = 0 ");
|
||||
if (params.get("query") != null) {
|
||||
sqlBuild.append(" AND (coalesce(gb_device_id, device_id) LIKE concat('%',#{query},'%') escape '/'" +
|
||||
" OR coalesce(gb_name, name) LIKE concat('%',#{query},'%') escape '/' )")
|
||||
;
|
||||
sqlBuild.append(" where coalesce(wdc.gb_device_id, wdc.device_id) = #{channelDeviceId}");
|
||||
if (params.get("gbDeviceId") != null) {
|
||||
sqlBuild.append(" AND wdc.data_type = 1 and wd.device_id = #{gbDeviceId}");
|
||||
}
|
||||
if (params.get("online") != null && (Boolean)params.get("online")) {
|
||||
sqlBuild.append(" AND coalesce(gb_status, status) = 'ON'");
|
||||
}
|
||||
if (params.get("online") != null && !(Boolean)params.get("online")) {
|
||||
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
|
||||
}
|
||||
if (params.get("containMobileDevice") != null && !(Boolean)params.get("containMobileDevice")) {
|
||||
sqlBuild.append(" AND gb_ptz_type != 99");
|
||||
}
|
||||
if (params.get("groupDeviceId") != null) {
|
||||
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) = #{groupDeviceId}");
|
||||
}else {
|
||||
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is null");
|
||||
}
|
||||
|
||||
return sqlBuild.toString();
|
||||
}
|
||||
|
||||
|
||||
public String queryListByDeviceIds(Map<String, Object> params ){
|
||||
StringBuilder sqlBuild = new StringBuilder();
|
||||
sqlBuild.append(BASE_SQL_FOR_CAMERA_DEVICE);
|
||||
sqlBuild.append(" where coalesce(wdc.gb_device_id, wdc.device_id) in");
|
||||
|
||||
List<String> deviceIds = (List<String>)params.get("deviceIds");
|
||||
boolean first = true;
|
||||
for (String deviceId : deviceIds) {
|
||||
if (!first) {
|
||||
sqlBuild.append(",");
|
||||
}
|
||||
sqlBuild.append(deviceId);
|
||||
first = false;
|
||||
}
|
||||
sqlBuild.append(" )");
|
||||
return sqlBuild.toString() ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ public interface IGroupService {
|
||||
|
||||
void add(Group group);
|
||||
|
||||
List<Group> queryAllChildren(Integer id);
|
||||
|
||||
void update(Group group);
|
||||
|
||||
Group queryGroupByDeviceId(String regionDeviceId);
|
||||
|
||||
@@ -90,7 +90,8 @@ public class GroupServiceImpl implements IGroupService {
|
||||
groupManager.addBusinessGroup(group);
|
||||
}
|
||||
|
||||
private List<Group> queryAllChildren(Integer id) {
|
||||
@Override
|
||||
public List<Group> queryAllChildren(Integer id) {
|
||||
List<Group> children = groupManager.getChildren(id);
|
||||
if (ObjectUtils.isEmpty(children)) {
|
||||
return children;
|
||||
|
||||
Reference in New Issue
Block a user