吉安感知网项目-后端
linwei
2026-04-22 de09889cb97fcd7e9ae3236d3cb0d9f2f752e439
drone-service/drone-system/src/main/java/org/sxkj/system/service/impl/RegionServiceImpl.java
@@ -54,9 +54,11 @@
   public Region getById(Serializable id) {
      return Optional.ofNullable(id)
         .map(val -> baseMapper.selectOne(new LambdaQueryWrapper<Region>()
            .eq(Region::getId, val)
            // 1. 处理 id = ? 部分,强制转为 bigint
            .apply("id = {0}::bigint", val)
            .or()
            .eq(Region::getCode, val)))
            // 2. 处理 code = ? 部分,强制转为 varchar
            .apply("code = {0}::varchar", val)))
         .orElse(null);
   }
@@ -138,7 +140,8 @@
      if (cnt > 0L) {
         throw new ServiceException("请先删除子节点!");
      }
      return removeById(id);
      Long idLong = Long.valueOf(id);
      return removeById(idLong);
   }
   @Override