diff options
| author | tanghao <[email protected]> | 2024-10-30 14:54:59 +0800 |
|---|---|---|
| committer | tanghao <[email protected]> | 2024-10-30 14:54:59 +0800 |
| commit | eaa23f4de63a199430bb4b5bc64273c84125a8b4 (patch) | |
| tree | a042b524cbbc8314b091fad04bfc6238576b366e | |
| parent | fc440c0d9f10ed85de5d2a792901f63842c88681 (diff) | |
fix: 新增基站相关配置
6 files changed, 219 insertions, 0 deletions
diff --git a/cn-admin/src/main/java/net/geedge/modules/knowledge/controller/CellController.java b/cn-admin/src/main/java/net/geedge/modules/knowledge/controller/CellController.java new file mode 100644 index 0000000..0606b12 --- /dev/null +++ b/cn-admin/src/main/java/net/geedge/modules/knowledge/controller/CellController.java @@ -0,0 +1,25 @@ +package net.geedge.modules.knowledge.controller; + +import net.geedge.common.utils.PageUtils; +import net.geedge.common.utils.R; +import net.geedge.modules.knowledge.service.CellService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +@RestController +@RequestMapping("/v1/cell") +public class CellController { + + @Autowired + private CellService cellService; + + @RequestMapping("/list") + public R queryCellList(@RequestParam Map<String,Object> params) { + PageUtils page = cellService.queryCellList(params); + return R.ok(page); + } +} diff --git a/cn-admin/src/main/java/net/geedge/modules/knowledge/dao/CellDao.java b/cn-admin/src/main/java/net/geedge/modules/knowledge/dao/CellDao.java new file mode 100644 index 0000000..4e376ce --- /dev/null +++ b/cn-admin/src/main/java/net/geedge/modules/knowledge/dao/CellDao.java @@ -0,0 +1,20 @@ +package net.geedge.modules.knowledge.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import net.geedge.modules.knowledge.entity.Cell; +import net.geedge.modules.knowledge.entity.KnowledgeBase; +import net.geedge.modules.knowledge.entity.Tag; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + + +@Mapper +public interface CellDao extends BaseMapper<Cell> { + + List<Cell> queryCellList(IPage<KnowledgeBase> page, @Param("params") Map<String,Object> params); + +} diff --git a/cn-admin/src/main/java/net/geedge/modules/knowledge/entity/Cell.java b/cn-admin/src/main/java/net/geedge/modules/knowledge/entity/Cell.java new file mode 100644 index 0000000..a4631db --- /dev/null +++ b/cn-admin/src/main/java/net/geedge/modules/knowledge/entity/Cell.java @@ -0,0 +1,43 @@ +package net.geedge.modules.knowledge.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + + +@Data +@TableName("cn_cell") +public class Cell { + @TableId(type = IdType.INPUT) + private String id; + + private String cellId; + + private Integer nodebId; + + private Integer azimuth; + + private String technology; + + private Integer lacTac; + + private Integer mcc; + + private Integer mnc; + + private Double latitude; + + private Double longitude; + + private Integer coverageRadius; + + private String operator; + + private String vendor; + + private String fddSpectrum; + +} diff --git a/cn-admin/src/main/java/net/geedge/modules/knowledge/service/CellService.java b/cn-admin/src/main/java/net/geedge/modules/knowledge/service/CellService.java new file mode 100644 index 0000000..516b9f9 --- /dev/null +++ b/cn-admin/src/main/java/net/geedge/modules/knowledge/service/CellService.java @@ -0,0 +1,13 @@ +package net.geedge.modules.knowledge.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import net.geedge.common.utils.PageUtils; +import net.geedge.modules.knowledge.entity.Cell; +import java.util.Map; + + +public interface CellService extends IService<Cell> { + + PageUtils queryCellList(Map<String,Object> params); + +} diff --git a/cn-admin/src/main/java/net/geedge/modules/knowledge/service/impl/CellServiceImpl.java b/cn-admin/src/main/java/net/geedge/modules/knowledge/service/impl/CellServiceImpl.java new file mode 100644 index 0000000..8999fb1 --- /dev/null +++ b/cn-admin/src/main/java/net/geedge/modules/knowledge/service/impl/CellServiceImpl.java @@ -0,0 +1,41 @@ +package net.geedge.modules.knowledge.service.impl; + +import cn.hutool.log.Log; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import net.geedge.common.utils.PageUtils; +import net.geedge.common.utils.Query; +import net.geedge.common.utils.Tool; +import net.geedge.modules.knowledge.dao.CellDao; +import net.geedge.modules.knowledge.entity.Cell; +import net.geedge.modules.knowledge.service.CellService; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +@Service("CellService") +public class CellServiceImpl extends ServiceImpl<CellDao, Cell> implements CellService { + + @Override + public PageUtils queryCellList(Map<String, Object> params) { + String ids = (String)params.get("ids"); + if(Tool.StrUtil.isNotBlank(ids)){ + params.put("ids",Arrays.asList(ids.split(","))); + } + String cellIds = (String)params.get("cellIds"); + if(Tool.StrUtil.isNotBlank(cellIds)){ + params.put("cellIds",Arrays.asList(cellIds.split(","))); + } + String nodebIds = (String)params.get("nodebIds"); + if(Tool.StrUtil.isNotBlank(nodebIds)){ + params.put("nodebIds", Arrays.asList(nodebIds.split(","))); + } + IPage page = this.page(new Query(Cell.class).getPage(params)); + List<Cell> list = this.baseMapper.queryCellList(page, params); + page.setRecords(list); + return new PageUtils(page); + } + +} diff --git a/cn-admin/src/main/resources/mapper/knowledge/CellDao.xml b/cn-admin/src/main/resources/mapper/knowledge/CellDao.xml new file mode 100644 index 0000000..bd1985f --- /dev/null +++ b/cn-admin/src/main/resources/mapper/knowledge/CellDao.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="net.geedge.modules.knowledge.dao.CellDao"> + + <resultMap id="cell" type="net.geedge.modules.knowledge.entity.Cell"> + <result property="id" column="id"></result> + <result property="cellId" column="cell_id"></result> + <result property="nodebId" column="nodeb_id"></result> + <result property="azimuth" column="azimuth"></result> + <result property="technology" column="technology"></result> + <result property="lacTac" column="lac_tac"></result> + <result property="mcc" column="mcc"></result> + <result property="mnc" column="mnc"></result> + <result property="latitude" column="latitude"></result> + <result property="longitude" column="longitude"></result> + <result property="coverageRadius" column="coverage_radius"></result> + <result property="operator" column="operator"></result> + <result property="vendor" column="vendor"></result> + <result property="fddSpectrum" column="fdd_spectrum"></result> + </resultMap> + + <select id="queryCellList" resultType="net.geedge.modules.knowledge.entity.Cell"> + select * from + cn_cell + <where> + <if test="params.ids != null and params.ids.size > 0"> + and id in + <foreach item="id" collection="params.ids" separator="," open="(" close=")" index=""> + #{id} + </foreach> + </if> + <if test="params.cellIds != null and params.cellIds.size > 0"> + and cell_id in + <foreach item="cellId" collection="params.cellIds" separator="," open="(" close=")" index=""> + #{cellId} + </foreach> + </if> + <if test="params.nodebIds != null and params.nodebIds.size > 0"> + and nodeb_id in + <foreach item="nodebId" collection="params.nodebIds" separator="," open="(" close=")" index=""> + #{nodebId} + </foreach> + </if> + <if test="params.technology != null and params.technology !=''"> + and technology = #{params.technology} + </if> + <if test="params.lacTac != null"> + and lac_tac = #{params.lacTac} + </if> + <if test="params.mcc != null"> + and mcc = #{params.mcc} + </if> + <if test="params.mnc != null"> + and mcc = #{params.mnc} + </if> + <if test="params.operator != null and params.operator !=''"> + and operator like CONCAT('%', #{params.operator}, '%') + </if> + <if test="params.vendor != null and params.vendor !=''"> + and vendor = #{params.vendor} + </if> + <if test="params.minLatitude != null"> + and latitude >= #{params.minLatitude} + </if> + <if test="params.maxLatitude != null"> + and latitude <= #{params.minLatitude} + </if> + <if test="params.minLongitude != null"> + and longitude >= #{params.minLongitude} + </if> + <if test="params.maxLongitude != null"> + and longitude <= #{params.maxLongitude} + </if> + </where> + </select> + +</mapper>
\ No newline at end of file |
