完善分组通道管理

This commit is contained in:
648540858
2024-08-07 17:12:39 +08:00
parent a3f7753b84
commit 5abf5012eb
10 changed files with 122 additions and 50 deletions

View File

@@ -399,4 +399,19 @@ public interface CommonGBChannelMapper {
int updateGroup(@Param("parentId") String parentId, @Param("businessGroup") String businessGroup,
List<CommonGBChannel> channelList);
@Select("<script>" +
" select " +
" coalesce(gb_device_id, device_id) as id," +
" coalesce(gb_name, name) as label, " +
" id as db_id, " +
" gb_parent_id as parent_device_id," +
" gb_business_group_id as business_group," +
" 1 as type, " +
" true as is_leaf " +
" from wvp_device_channel " +
" where gb_parent_id = #{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<GroupTree> queryForGroupTreeByParentId(@Param("query") String query, @Param("parent") String parent);
}

View File

@@ -142,7 +142,7 @@ public class ChannelProvider {
public String queryByGbDeviceIds(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(getBaseSelectSql());
sqlBuild.append("where device_db_id in ( ");
sqlBuild.append("where id in ( ");
Collection<Integer> ids = (Collection<Integer>)params.get("deviceIds");
boolean first = true;
@@ -208,7 +208,7 @@ public class ChannelProvider {
StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(getBaseSelectSql());
sqlBuild.append(" where gb_business_group_id in ( ");
sqlBuild.append(" where gb_parent_id in ( ");
Collection<Group> ids = (Collection<Group>)params.get("groupList");
boolean first = true;
for (Group group : ids) {