临时提交

This commit is contained in:
648540858
2024-07-25 18:02:22 +08:00
parent 5a812e7f08
commit a2b00a4f4e
13 changed files with 646 additions and 78 deletions

View File

@@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.RegionTree;
import com.genersoft.iot.vmp.gb28181.dao.provider.ChannelProvider;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
@@ -305,4 +306,17 @@ public interface CommonGBChannelMapper {
@SelectProvider(type = ChannelProvider.class, method = "queryList")
List<CommonGBChannel> queryList(String query, Boolean online);
@Select("<script>" +
" select " +
" coalesce(gb_device_id, device_id) as id," +
" coalesce(gb_name, name) as label, " +
" 1 as type, " +
" true as is_leaf " +
" from wvp_device_channel " +
" where coalesce(gb_civil_code, civil_code) = #{parent} " +
" <if test='query != null'> AND (coalesce(gb_device_id, device_id) LIKE concat('%',#{query},'%') " +
" OR coalesce(gb_name, name) LIKE concat('%',#{query},'%'))</if> " +
" </script>")
List<RegionTree> queryForRegionTreeByCivilCode(@Param("query") String query, @Param("parent") String parent);
}

View File

@@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.gb28181.bean.Region;
import com.genersoft.iot.vmp.gb28181.bean.RegionTree;
import org.apache.ibatis.annotations.*;
import java.util.List;
@@ -65,11 +66,17 @@ public interface RegionMapper {
int batchAdd(List<Region> regionList);
@Select(" <script>" +
" SELECT * from wvp_common_region " +
" SELECT " +
" device_id as id," +
" name as label, " +
" parent_device_id," +
" 0 as type," +
" false as is_leaf" +
" from wvp_common_region " +
" where " +
" <if test='parentId != null'> parent_device_id = #{parentId} </if> " +
" <if test='parentId == null'> parent_device_id is null </if> " +
" <if test='query != null'> AND (device_id LIKE concat('%',#{query},'%') OR name LIKE concat('%',#{query},'%'))</if> " +
" </script>")
List<Region> queryForTree(@Param("query") String query, @Param("parentId") String parentId);
List<RegionTree> queryForTree(@Param("query") String query, @Param("parentId") String parentId);
}