临时提交
This commit is contained in:
@@ -380,7 +380,7 @@ public interface CommonGBChannelMapper {
|
||||
" WHERE id in "+
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
|
||||
" </script>"})
|
||||
void updateBusinessGroupByChannelList(@Param("businessGroup") String businessGroup, List<CommonGBChannel> channelList);
|
||||
int updateBusinessGroupByChannelList(@Param("businessGroup") String businessGroup, List<CommonGBChannel> channelList);
|
||||
|
||||
@Update(value = {" <script>" +
|
||||
" UPDATE wvp_device_channel " +
|
||||
@@ -388,5 +388,15 @@ public interface CommonGBChannelMapper {
|
||||
" WHERE id in "+
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
|
||||
" </script>"})
|
||||
void updateParentIdByChannelList(@Param("parentId") String parentId, List<CommonGBChannel> channelList);
|
||||
int updateParentIdByChannelList(@Param("parentId") String parentId, List<CommonGBChannel> channelList);
|
||||
|
||||
@Update(value = {" <script>" +
|
||||
" UPDATE wvp_device_channel " +
|
||||
" SET gb_parent_id = #{parentId}, gb_business_group_id = #{businessGroup}" +
|
||||
" WHERE id in "+
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
|
||||
" </script>"})
|
||||
int updateGroup(@Param("parentId") String parentId, @Param("businessGroup") String businessGroup,
|
||||
List<CommonGBChannel> channelList);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.genersoft.iot.vmp.gb28181.dao;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Group;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Group;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GroupTree;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
@@ -16,6 +15,11 @@ public interface GroupMapper {
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
||||
int add(Group group);
|
||||
|
||||
@Insert("INSERT INTO wvp_common_group (device_id, name, business_group, platform_id, create_time, update_time) " +
|
||||
"VALUES (#{deviceId}, #{name}, #{businessGroup}, #{platformId}, #{createTime}, #{updateTime})")
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
||||
int addBusinessGroup(Group group);
|
||||
|
||||
@Delete("DELETE FROM wvp_common_group WHERE id=#{id}")
|
||||
int delete(@Param("id") int id);
|
||||
|
||||
@@ -61,11 +65,12 @@ public interface GroupMapper {
|
||||
" device_id," +
|
||||
" name, " +
|
||||
" parent_device_id," +
|
||||
" business_group," +
|
||||
" create_time," +
|
||||
" update_time) " +
|
||||
" VALUES " +
|
||||
" <foreach collection='groupList' index='index' item='item' separator=','> " +
|
||||
" (#{item.deviceId}, #{item.name}, #{item.parentDeviceId},#{item.createTime},#{item.updateTime})" +
|
||||
" (#{item.deviceId}, #{item.name}, #{item.parentDeviceId}, #{item.businessGroup},#{item.createTime},#{item.updateTime})" +
|
||||
" </foreach> " +
|
||||
" </script>")
|
||||
int batchAdd(List<Group> groupList);
|
||||
@@ -75,20 +80,40 @@ public interface GroupMapper {
|
||||
" device_id as id," +
|
||||
" name as label, " +
|
||||
" parent_device_id," +
|
||||
" business_group," +
|
||||
" id as db_id," +
|
||||
" 0 as type," +
|
||||
" false as is_leaf" +
|
||||
" from wvp_common_group " +
|
||||
" where " +
|
||||
" <if test='parentId != null'> parent_device_id = #{parentId} </if> " +
|
||||
" <if test='parentId == null'> parent_device_id is null </if> " +
|
||||
" <if test='platformId != null'> platform_id = #{platformId} </if> " +
|
||||
" <if test='platformId == null'> platform_id is null </if> " +
|
||||
" where 1=1 " +
|
||||
" <if test='parentId != null'> and parent_device_id = #{parentId} </if> " +
|
||||
" <if test='parentId == null'> and parent_device_id is null </if> " +
|
||||
" <if test='platformId != null'> and platform_id = #{platformId} </if> " +
|
||||
" <if test='platformId == null'> and platform_id is null </if> " +
|
||||
" <if test='query != null'> AND (device_id LIKE concat('%',#{query},'%') OR name LIKE concat('%',#{query},'%'))</if> " +
|
||||
" </script>")
|
||||
List<GroupTree> queryForTree(@Param("query") String query, @Param("parentId") String parentId,
|
||||
@Param("platformId") Integer platformId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" device_id as id," +
|
||||
" name as label, " +
|
||||
" parent_device_id," +
|
||||
" business_group," +
|
||||
" id as db_id," +
|
||||
" 0 as type," +
|
||||
" false as is_leaf" +
|
||||
" from wvp_common_group " +
|
||||
" where parent_device_id is null and business_group = #{businessGroup} and device_id != #{businessGroup}" +
|
||||
" <if test='platformId != null'> and platform_id = #{platformId} </if> " +
|
||||
" <if test='platformId == null'> and platform_id is null </if> " +
|
||||
" <if test='query != null'> AND (device_id LIKE concat('%',#{query},'%') OR name LIKE concat('%',#{query},'%'))</if> " +
|
||||
" </script>")
|
||||
List<GroupTree> queryForTreeByBusinessGroup(@Param("query") String query,
|
||||
@Param("businessGroup") String businessGroup,
|
||||
@Param("platformId") Integer platformId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" device_id as id," +
|
||||
@@ -123,5 +148,8 @@ public interface GroupMapper {
|
||||
@Delete("DELETE FROM wvp_common_group WHERE business_group = #{businessGroup}")
|
||||
int deleteByBusinessGroup(@Param("businessGroup") String businessGroup);
|
||||
|
||||
|
||||
@Update(" UPDATE wvp_common_group " +
|
||||
" SET parent_device_id=#{group.deviceId}, business_group = #{group.businessGroup}" +
|
||||
" WHERE parent_device_id = #{oldDeviceId}")
|
||||
int updateChild(@Param("oldDeviceId") String oldDeviceId, Group group);
|
||||
}
|
||||
|
||||
@@ -118,5 +118,5 @@ public interface PlatformChannelMapper {
|
||||
List<Device> queryDeviceInfoByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
||||
|
||||
@Select("SELECT pgc.platform_id from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.device_id=#{channelId}")
|
||||
List<String> queryParentPlatformByChannelId(@Param("channelId") String channelId);
|
||||
List<Integer> queryParentPlatformByChannelId(@Param("channelId") String channelId);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ public class ChannelProvider {
|
||||
StringBuilder sqlBuild = new StringBuilder();
|
||||
sqlBuild.append(getBaseSelectSql());
|
||||
|
||||
sqlBuild.append(" gb_business_group_id in ( ");
|
||||
sqlBuild.append(" where gb_business_group_id in ( ");
|
||||
Collection<Group> ids = (Collection<Group>)params.get("groupList");
|
||||
boolean first = true;
|
||||
for (Group group : ids) {
|
||||
|
||||
Reference in New Issue
Block a user