From c25a99d60bef3d3bbd59fee895bd658928fd00db Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期三, 10 一月 2024 16:17:29 +0800 Subject: [PATCH] 修复空指针异常 --- src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java index c8d81a8..5f6d784 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java @@ -32,7 +32,7 @@ int batchAdd(List<StreamPushItem> streamPushItems); @Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select gb_stream_id from wvp_gb_stream where app=#{app} AND stream=#{stream})") - int delByAppAndStream(String app, String stream); + int delByAppAndStream(@Param("app") String app, @Param("stream") String stream); @Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}") int delByPlatformId(String platformId); @@ -46,26 +46,26 @@ "WHERE " + "gs.app =#{app} " + "AND gs.stream =#{stream} ") - List<ParentPlatform> selectByAppAndStream(String app, String stream); + List<ParentPlatform> selectByAppAndStream(@Param("app") String app, @Param("stream") String stream); @Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " + "LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " + "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}") - StreamProxyItem selectOne(String app, String stream, String platformId); + StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId); @Select("select gs.* \n" + "from wvp_gb_stream gs\n" + " left join wvp_platform_gb_stream pgs\n" + " on gs.gb_stream_id = pgs.gb_stream_id\n" + "where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}") - List<GbStream> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId); + List<GbStream> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); @Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" + "from wvp_gb_stream gs\n" + " left join wvp_platform_gb_stream pgs\n" + " on gs.gb_stream_id = pgs.gb_stream_id\n" + "where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}") - List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId); + List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); @Select("<script> " + "SELECT " + @@ -82,7 +82,7 @@ "AND pp.server_gb_id IN" + "<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + "</script> ") - List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms); + List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("app") String app, @Param("stream") String stream, @Param("platforms") List<String> platforms); @Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select id from wvp_gb_stream where app=#{app} AND stream=#{stream}) AND platform_id=#{platformId}") int delByAppAndStreamAndPlatform(String app, String stream, String platformId); @@ -101,8 +101,11 @@ "#{item.gbStreamId} " + "</foreach>" + "</script>") - void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId); + void delByAppAndStreamsByPlatformId(@Param("gbStreams") List<GbStream> gbStreams, @Param("platformId") String platformId); - @Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId} and catalog_id=#{catalogId}") - int delByPlatformAndCatalogId(String platformId, String catalogId); + @Delete("<script> "+ + "DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}" + + " <if test='catalogId != null' > and catalog_id=#{catalogId}</if>" + + "</script>") + int delByPlatformAndCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId); } -- Gitblit v1.8.0