wukai 1 рік тому
батько
коміт
254ed34519

+ 49 - 65
dayun-admin/src/main/java/com/jjt/biz/controller/IndexController.java

@@ -1,7 +1,10 @@
 package com.jjt.biz.controller;
 
-import com.jjt.biz.domain.BluetoothInfo;
+import com.jjt.biz.domain.*;
 import com.jjt.biz.service.IBluetoothInfoService;
+import com.jjt.biz.service.IDeviceInfoService;
+import com.jjt.biz.service.IVenueInfoService;
+import com.jjt.biz.service.IWifiInfoService;
 import com.jjt.common.annotation.Log;
 import com.jjt.common.core.controller.BaseController;
 import com.jjt.common.core.domain.AjaxResult;
@@ -12,87 +15,68 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 蓝牙信息Controller
- * 
+ *
  * @author ruoyi
  * @date 2023-07-06
  */
 @RestController
 @RequestMapping("/index")
-public class IndexController extends BaseController
-{
-    @Autowired
+public class IndexController extends BaseController {
+    @Resource
     private IBluetoothInfoService bluetoothInfoService;
+    @Resource
+    private IDeviceInfoService deviceInfoService;
+    @Resource
+    private IWifiInfoService wifiInfoService;
+    @Resource
+    private IVenueInfoService venueInfoService;
 
     /**
-     * 查询蓝牙信息列表
+     * 首页信息
      */
-    @PreAuthorize("@ss.hasPermi('biz:bluetoothINfo:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(BluetoothInfo bluetoothInfo)
-    {
-        startPage();
-        List<BluetoothInfo> list = bluetoothInfoService.selectBluetoothInfoList(bluetoothInfo);
-        return getDataTable(list);
+    @GetMapping("/info")
+    public Map<String, Object> info() {
+        Map<String, Object> map = new HashMap<>(16);
+        List deviceInfos = deviceInfoService.selectDeviceInfoList(new DeviceInfo());
+        map.put("deviceNO", deviceInfos.size());
+        WifiInfo wifiInfo = new WifiInfo();
+        wifiInfo.setIsIllegal("Y");
+        List wifiInfos = wifiInfoService.selectWifiInfoList(wifiInfo);
+        map.put("wifiNO", wifiInfos.size());
+        BluetoothInfo bluetoothInfo = new BluetoothInfo();
+        bluetoothInfo.setIsIllegal("Y");
+        List bluetoothInfos = bluetoothInfoService.selectBluetoothInfoList(bluetoothInfo);
+        map.put("bluetoothNO", bluetoothInfos.size());
+        List venueInfos = venueInfoService.selectVenueInfoList(new VenueInfo());
+        map.put("venueNO", venueInfos.size());
+        return map;
     }
 
     /**
-     * 导出蓝牙信息列表
+     * 首页信息
      */
-    @PreAuthorize("@ss.hasPermi('biz:bluetoothINfo:export')")
-    @Log(title = "蓝牙信息", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, BluetoothInfo bluetoothInfo)
-    {
-        List<BluetoothInfo> list = bluetoothInfoService.selectBluetoothInfoList(bluetoothInfo);
-        ExcelUtil<BluetoothInfo> util = new ExcelUtil<BluetoothInfo>(BluetoothInfo.class);
-        util.exportExcel(response, list, "蓝牙信息数据");
-    }
-
-    /**
-     * 获取蓝牙信息详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('biz:bluetoothINfo:query')")
-    @GetMapping(value = "/{bInfoId}")
-    public AjaxResult getInfo(@PathVariable("bInfoId") Long bInfoId)
-    {
-        return success(bluetoothInfoService.selectBluetoothInfoByBInfoId(bInfoId));
-    }
-
-    /**
-     * 新增蓝牙信息
-     */
-    @PreAuthorize("@ss.hasPermi('biz:bluetoothINfo:add')")
-    @Log(title = "蓝牙信息", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody BluetoothInfo bluetoothInfo)
-    {
-        return toAjax(bluetoothInfoService.insertBluetoothInfo(bluetoothInfo));
-    }
-
-    /**
-     * 修改蓝牙信息
-     */
-    @PreAuthorize("@ss.hasPermi('biz:bluetoothINfo:edit')")
-    @Log(title = "蓝牙信息", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody BluetoothInfo bluetoothInfo)
-    {
-        return toAjax(bluetoothInfoService.updateBluetoothInfo(bluetoothInfo));
-    }
-
-    /**
-     * 删除蓝牙信息
-     */
-    @PreAuthorize("@ss.hasPermi('biz:bluetoothINfo:remove')")
-    @Log(title = "蓝牙信息", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{bInfoIds}")
-    public AjaxResult remove(@PathVariable Long[] bInfoIds)
-    {
-        return toAjax(bluetoothInfoService.deleteBluetoothInfoByBInfoIds(bInfoIds));
+    @GetMapping("/top")
+    public List<TopVO> top() {
+        List<TopVO> list = venueInfoService.selectTop10();
+//        list.add(new TopVO("东安湖体育公园游泳跳水馆", 87, 84));
+//        list.add(new TopVO("东安湖体育公园多功能体育馆", 33, 80));
+//        list.add(new TopVO("凤凰山体育公园", 99, 89));
+//        list.add(new TopVO("高新体育中心体育馆", 75, 74));
+//        list.add(new TopVO("简阳文体中心游泳馆", 65, 78));
+//        list.add(new TopVO("简阳文体中心体育馆", 2, 23));
+//        list.add(new TopVO("四川大学望江校区体育馆", 78, 41));
+//        list.add(new TopVO("电子科技大学清水河校区体育馆", 49, 41));
+//        list.add(new TopVO("西南财大光华校区体育馆", 25, 60));
+//        list.add(new TopVO("西南交通大学犀浦校区体育馆", 32, 83));
+        return list;
     }
 }

+ 109 - 73
dayun-admin/src/main/java/com/jjt/biz/domain/BluetoothInfo.java

@@ -1,6 +1,8 @@
 package com.jjt.biz.domain;
 
 import java.util.Date;
+
+import com.alibaba.druid.support.monitor.annotation.MTable;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -9,172 +11,206 @@ import com.jjt.common.core.domain.BaseEntity;
 
 /**
  * 蓝牙信息对象 bluetooth_info
- * 
+ *
  * @author ruoyi
  * @date 2023-07-06
  */
-public class BluetoothInfo extends BaseEntity
-{
+public class BluetoothInfo extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 信息ID */
+    /**
+     * 信息ID
+     */
     private Long bInfoId;
 
-    /** 设备ID */
+    /**
+     * 设备ID
+     */
     @Excel(name = "设备ID")
     private String deviceId;
 
-    /** 场馆ID */
+    /**
+     * 场馆ID
+     */
     @Excel(name = "场馆ID")
     private Long venueId;
 
-    /** 区域ID */
+    /**
+     * 区域ID
+     */
     @Excel(name = "区域ID")
     private Long areaId;
-
-    /** MAC地址 */
+    /**
+     * 场馆名称
+     */
+    private String venueName;
+    /**
+     * 区域名称
+     */
+    private String areaName;
+
+    /**
+     * MAC地址
+     */
     @Excel(name = "MAC地址")
     private String mac;
 
-    /** 蓝牙名称 */
+    /**
+     * 蓝牙名称
+     */
     @Excel(name = "蓝牙名称")
     private String name;
 
-    /** 文件名 */
+    /**
+     * 文件名
+     */
     @Excel(name = "文件名")
     private String fileName;
 
-    /** 文件地址 */
+    /**
+     * 文件地址
+     */
     @Excel(name = "文件地址")
     private String filePath;
 
-    /** 是否非法 */
+    /**
+     * 是否非法
+     */
     @Excel(name = "是否非法")
     private String isIllegal;
 
-    /** 关键字类型 */
+    /**
+     * 关键字类型
+     */
     @Excel(name = "关键字类型")
     private String keyType;
 
-    /** 数据采集时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    /**
+     * 数据采集时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date time;
 
-    public void setbInfoId(Long bInfoId) 
-    {
+
+    public String getVenueName() {
+        return venueName;
+    }
+
+    public void setVenueName(String venueName) {
+        this.venueName = venueName;
+    }
+
+    public String getAreaName() {
+        return areaName;
+    }
+
+    public void setAreaName(String areaName) {
+        this.areaName = areaName;
+    }
+
+    public void setbInfoId(Long bInfoId) {
         this.bInfoId = bInfoId;
     }
 
-    public Long getbInfoId() 
-    {
+    public Long getbInfoId() {
         return bInfoId;
     }
-    public void setDeviceId(String deviceId) 
-    {
+
+    public void setDeviceId(String deviceId) {
         this.deviceId = deviceId;
     }
 
-    public String getDeviceId() 
-    {
+    public String getDeviceId() {
         return deviceId;
     }
-    public void setVenueId(Long venueId) 
-    {
+
+    public void setVenueId(Long venueId) {
         this.venueId = venueId;
     }
 
-    public Long getVenueId() 
-    {
+    public Long getVenueId() {
         return venueId;
     }
-    public void setAreaId(Long areaId) 
-    {
+
+    public void setAreaId(Long areaId) {
         this.areaId = areaId;
     }
 
-    public Long getAreaId() 
-    {
+    public Long getAreaId() {
         return areaId;
     }
-    public void setMac(String mac) 
-    {
+
+    public void setMac(String mac) {
         this.mac = mac;
     }
 
-    public String getMac() 
-    {
+    public String getMac() {
         return mac;
     }
-    public void setName(String name) 
-    {
+
+    public void setName(String name) {
         this.name = name;
     }
 
-    public String getName() 
-    {
+    public String getName() {
         return name;
     }
-    public void setFileName(String fileName) 
-    {
+
+    public void setFileName(String fileName) {
         this.fileName = fileName;
     }
 
-    public String getFileName() 
-    {
+    public String getFileName() {
         return fileName;
     }
-    public void setFilePath(String filePath) 
-    {
+
+    public void setFilePath(String filePath) {
         this.filePath = filePath;
     }
 
-    public String getFilePath() 
-    {
+    public String getFilePath() {
         return filePath;
     }
-    public void setIsIllegal(String isIllegal) 
-    {
+
+    public void setIsIllegal(String isIllegal) {
         this.isIllegal = isIllegal;
     }
 
-    public String getIsIllegal() 
-    {
+    public String getIsIllegal() {
         return isIllegal;
     }
-    public void setKeyType(String keyType) 
-    {
+
+    public void setKeyType(String keyType) {
         this.keyType = keyType;
     }
 
-    public String getKeyType() 
-    {
+    public String getKeyType() {
         return keyType;
     }
-    public void setTime(Date time) 
-    {
+
+    public void setTime(Date time) {
         this.time = time;
     }
 
-    public Date getTime() 
-    {
+    public Date getTime() {
         return time;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("bInfoId", getbInfoId())
-            .append("deviceId", getDeviceId())
-            .append("venueId", getVenueId())
-            .append("areaId", getAreaId())
-            .append("mac", getMac())
-            .append("name", getName())
-            .append("fileName", getFileName())
-            .append("filePath", getFilePath())
-            .append("isIllegal", getIsIllegal())
-            .append("keyType", getKeyType())
-            .append("time", getTime())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("bInfoId", getbInfoId())
+                .append("deviceId", getDeviceId())
+                .append("venueId", getVenueId())
+                .append("areaId", getAreaId())
+                .append("mac", getMac())
+                .append("name", getName())
+                .append("fileName", getFileName())
+                .append("filePath", getFilePath())
+                .append("isIllegal", getIsIllegal())
+                .append("keyType", getKeyType())
+                .append("time", getTime())
+                .toString();
     }
 }

+ 1 - 1
dayun-admin/src/main/java/com/jjt/biz/domain/DeviceInfo.java

@@ -37,7 +37,7 @@ public class DeviceInfo extends BaseEntity
     private String deviceDesc;
 
     /** 注册时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "注册时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date registerTime;
 

+ 73 - 0
dayun-admin/src/main/java/com/jjt/biz/domain/TopVO.java

@@ -0,0 +1,73 @@
+package com.jjt.biz.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * WIFI信息对象 wifi_info
+ *
+ * @author ruoyi
+ * @date 2023-07-06
+ */
+public class TopVO{
+    private static final long serialVersionUID = 1L;
+
+    public TopVO(String name, Integer wifi, Integer bluetooth) {
+        this.name = name;
+        this.wifi = wifi;
+        this.bluetooth = bluetooth;
+    }
+
+    /**
+     * 场馆名称
+     */
+    private String name;
+
+    /**
+     * wifi数量
+     */
+    private Integer wifi;
+
+    /**
+     * 蓝牙数量
+     */
+    private Integer bluetooth;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getWifi() {
+        return wifi;
+    }
+
+    public void setWifi(Integer wifi) {
+        this.wifi = wifi;
+    }
+
+    public Integer getBluetooth() {
+        return bluetooth;
+    }
+
+    public void setBluetooth(Integer bluetooth) {
+        this.bluetooth = bluetooth;
+    }
+
+    @Override
+    public String toString() {
+        return "TopVO{" +
+                "name='" + name + '\'' +
+                ", wifi=" + wifi +
+                ", bluetooth=" + bluetooth +
+                '}';
+    }
+}

+ 99 - 66
dayun-admin/src/main/java/com/jjt/biz/domain/WifiInfo.java

@@ -1,6 +1,7 @@
 package com.jjt.biz.domain;
 
 import java.util.Date;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -9,158 +10,190 @@ import com.jjt.common.core.domain.BaseEntity;
 
 /**
  * WIFI信息对象 wifi_info
- * 
+ *
  * @author ruoyi
  * @date 2023-07-06
  */
-public class WifiInfo extends BaseEntity
-{
+public class WifiInfo extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 信息ID */
+    /**
+     * 信息ID
+     */
     private Long wifiInfoId;
 
-    /** 设备ID */
+    /**
+     * 设备ID
+     */
     @Excel(name = "设备ID")
     private String deviceId;
 
-    /** 场馆ID */
+    /**
+     * 场馆ID
+     */
     @Excel(name = "场馆ID")
     private Long venueId;
 
-    /** 区域ID */
+    /**
+     * 区域ID
+     */
     @Excel(name = "区域ID")
     private Long areaId;
 
-    /** MAC地址 */
+    /**
+     * MAC地址
+     */
     @Excel(name = "MAC地址")
     private String bssid;
 
-    /** WIFI名称 */
+    /**
+     * WIFI名称
+     */
     @Excel(name = "WIFI名称")
     private String ssid;
 
-    /** 认证页面 */
+    /**
+     * 认证页面
+     */
     @Excel(name = "认证页面")
     private String authPage;
 
-    /** 是否非法 */
+    /**
+     * 是否非法
+     */
     @Excel(name = "是否非法")
     private String isIllegal;
 
-    /** 关键字类型 */
+    /**
+     * 关键字类型
+     */
     @Excel(name = "关键字类型")
     private String keyType;
 
-    /** 数据采集时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    /**
+     * 数据采集时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date time;
+    /**
+     * 场馆名称
+     */
+    private String venueName;
+    /**
+     * 区域名称
+     */
+    private String areaName;
+
+    public String getVenueName() {
+        return venueName;
+    }
+
+    public void setVenueName(String venueName) {
+        this.venueName = venueName;
+    }
+
+    public String getAreaName() {
+        return areaName;
+    }
+
+    public void setAreaName(String areaName) {
+        this.areaName = areaName;
+    }
 
-    public void setWifiInfoId(Long wifiInfoId) 
-    {
+    public void setWifiInfoId(Long wifiInfoId) {
         this.wifiInfoId = wifiInfoId;
     }
 
-    public Long getWifiInfoId() 
-    {
+    public Long getWifiInfoId() {
         return wifiInfoId;
     }
-    public void setDeviceId(String deviceId) 
-    {
+
+    public void setDeviceId(String deviceId) {
         this.deviceId = deviceId;
     }
 
-    public String getDeviceId() 
-    {
+    public String getDeviceId() {
         return deviceId;
     }
-    public void setVenueId(Long venueId) 
-    {
+
+    public void setVenueId(Long venueId) {
         this.venueId = venueId;
     }
 
-    public Long getVenueId() 
-    {
+    public Long getVenueId() {
         return venueId;
     }
-    public void setAreaId(Long areaId) 
-    {
+
+    public void setAreaId(Long areaId) {
         this.areaId = areaId;
     }
 
-    public Long getAreaId() 
-    {
+    public Long getAreaId() {
         return areaId;
     }
-    public void setBssid(String bssid) 
-    {
+
+    public void setBssid(String bssid) {
         this.bssid = bssid;
     }
 
-    public String getBssid() 
-    {
+    public String getBssid() {
         return bssid;
     }
-    public void setSsid(String ssid) 
-    {
+
+    public void setSsid(String ssid) {
         this.ssid = ssid;
     }
 
-    public String getSsid() 
-    {
+    public String getSsid() {
         return ssid;
     }
-    public void setAuthPage(String authPage) 
-    {
+
+    public void setAuthPage(String authPage) {
         this.authPage = authPage;
     }
 
-    public String getAuthPage() 
-    {
+    public String getAuthPage() {
         return authPage;
     }
-    public void setIsIllegal(String isIllegal) 
-    {
+
+    public void setIsIllegal(String isIllegal) {
         this.isIllegal = isIllegal;
     }
 
-    public String getIsIllegal() 
-    {
+    public String getIsIllegal() {
         return isIllegal;
     }
-    public void setKeyType(String keyType) 
-    {
+
+    public void setKeyType(String keyType) {
         this.keyType = keyType;
     }
 
-    public String getKeyType() 
-    {
+    public String getKeyType() {
         return keyType;
     }
-    public void setTime(Date time) 
-    {
+
+    public void setTime(Date time) {
         this.time = time;
     }
 
-    public Date getTime() 
-    {
+    public Date getTime() {
         return time;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("wifiInfoId", getWifiInfoId())
-            .append("deviceId", getDeviceId())
-            .append("venueId", getVenueId())
-            .append("areaId", getAreaId())
-            .append("bssid", getBssid())
-            .append("ssid", getSsid())
-            .append("authPage", getAuthPage())
-            .append("isIllegal", getIsIllegal())
-            .append("keyType", getKeyType())
-            .append("time", getTime())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("wifiInfoId", getWifiInfoId())
+                .append("deviceId", getDeviceId())
+                .append("venueId", getVenueId())
+                .append("areaId", getAreaId())
+                .append("bssid", getBssid())
+                .append("ssid", getSsid())
+                .append("authPage", getAuthPage())
+                .append("isIllegal", getIsIllegal())
+                .append("keyType", getKeyType())
+                .append("time", getTime())
+                .toString();
     }
 }

+ 22 - 14
dayun-admin/src/main/java/com/jjt/biz/mapper/VenueInfoMapper.java

@@ -1,20 +1,21 @@
 package com.jjt.biz.mapper;
 
 import java.util.List;
+
+import com.jjt.biz.domain.TopVO;
 import com.jjt.biz.domain.VenueInfo;
 import com.jjt.biz.domain.VenueArea;
 
 /**
  * 场馆基本信息Mapper接口
- * 
+ *
  * @author ruoyi
  * @date 2023-07-06
  */
-public interface VenueInfoMapper 
-{
+public interface VenueInfoMapper {
     /**
      * 查询场馆基本信息
-     * 
+     *
      * @param venueId 场馆基本信息主键
      * @return 场馆基本信息
      */
@@ -22,7 +23,7 @@ public interface VenueInfoMapper
 
     /**
      * 查询场馆基本信息列表
-     * 
+     *
      * @param venueInfo 场馆基本信息
      * @return 场馆基本信息集合
      */
@@ -30,7 +31,7 @@ public interface VenueInfoMapper
 
     /**
      * 新增场馆基本信息
-     * 
+     *
      * @param venueInfo 场馆基本信息
      * @return 结果
      */
@@ -38,7 +39,7 @@ public interface VenueInfoMapper
 
     /**
      * 修改场馆基本信息
-     * 
+     *
      * @param venueInfo 场馆基本信息
      * @return 结果
      */
@@ -46,7 +47,7 @@ public interface VenueInfoMapper
 
     /**
      * 删除场馆基本信息
-     * 
+     *
      * @param venueId 场馆基本信息主键
      * @return 结果
      */
@@ -54,7 +55,7 @@ public interface VenueInfoMapper
 
     /**
      * 批量删除场馆基本信息
-     * 
+     *
      * @param venueIds 需要删除的数据主键集合
      * @return 结果
      */
@@ -62,26 +63,33 @@ public interface VenueInfoMapper
 
     /**
      * 批量删除场馆区域
-     * 
+     *
      * @param venueIds 需要删除的数据主键集合
      * @return 结果
      */
     public int deleteVenueAreaByVenueIds(Long[] venueIds);
-    
+
     /**
      * 批量新增场馆区域
-     * 
+     *
      * @param venueAreaList 场馆区域列表
      * @return 结果
      */
     public int batchVenueArea(List<VenueArea> venueAreaList);
-    
+
 
     /**
      * 通过场馆基本信息主键删除场馆区域信息
-     * 
+     *
      * @param venueId 场馆基本信息ID
      * @return 结果
      */
     public int deleteVenueAreaByVenueId(Long venueId);
+
+    /**
+     * 查询Top10
+     *
+     * @return
+     */
+    public List<TopVO> selectTop10();
 }

+ 17 - 9
dayun-admin/src/main/java/com/jjt/biz/service/IVenueInfoService.java

@@ -1,19 +1,20 @@
 package com.jjt.biz.service;
 
 import java.util.List;
+
+import com.jjt.biz.domain.TopVO;
 import com.jjt.biz.domain.VenueInfo;
 
 /**
  * 场馆基本信息Service接口
- * 
+ *
  * @author ruoyi
  * @date 2023-07-06
  */
-public interface IVenueInfoService 
-{
+public interface IVenueInfoService {
     /**
      * 查询场馆基本信息
-     * 
+     *
      * @param venueId 场馆基本信息主键
      * @return 场馆基本信息
      */
@@ -21,15 +22,22 @@ public interface IVenueInfoService
 
     /**
      * 查询场馆基本信息列表
-     * 
+     *
      * @param venueInfo 场馆基本信息
      * @return 场馆基本信息集合
      */
     public List<VenueInfo> selectVenueInfoList(VenueInfo venueInfo);
 
     /**
+     * 查询Top10
+     *
+     * @return
+     */
+    public List<TopVO> selectTop10();
+
+    /**
      * 新增场馆基本信息
-     * 
+     *
      * @param venueInfo 场馆基本信息
      * @return 结果
      */
@@ -37,7 +45,7 @@ public interface IVenueInfoService
 
     /**
      * 修改场馆基本信息
-     * 
+     *
      * @param venueInfo 场馆基本信息
      * @return 结果
      */
@@ -45,7 +53,7 @@ public interface IVenueInfoService
 
     /**
      * 批量删除场馆基本信息
-     * 
+     *
      * @param venueIds 需要删除的场馆基本信息主键集合
      * @return 结果
      */
@@ -53,7 +61,7 @@ public interface IVenueInfoService
 
     /**
      * 删除场馆基本信息信息
-     * 
+     *
      * @param venueId 场馆基本信息主键
      * @return 结果
      */

+ 12 - 0
dayun-admin/src/main/java/com/jjt/biz/service/impl/VenueInfoServiceImpl.java

@@ -1,6 +1,8 @@
 package com.jjt.biz.service.impl;
 
 import java.util.List;
+
+import com.jjt.biz.domain.TopVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import java.util.ArrayList;
@@ -48,6 +50,16 @@ public class VenueInfoServiceImpl implements IVenueInfoService
     }
 
     /**
+     * 查询Top10
+     *
+     * @return
+     */
+    @Override
+    public List<TopVO> selectTop10() {
+        return venueInfoMapper.selectTop10();
+    }
+
+    /**
      * 新增场馆基本信息
      * 
      * @param venueInfo 场馆基本信息

+ 50 - 33
dayun-admin/src/main/resources/mapper/biz/BluetoothInfoMapper.xml

@@ -1,48 +1,63 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jjt.biz.mapper.BluetoothInfoMapper">
-    
+
     <resultMap type="BluetoothInfo" id="BluetoothInfoResult">
-        <result property="bInfoId"    column="B_INFO_ID"    />
-        <result property="deviceId"    column="DEVICE_ID"    />
-        <result property="venueId"    column="VENUE_ID"    />
-        <result property="areaId"    column="AREA_ID"    />
-        <result property="mac"    column="MAC"    />
-        <result property="name"    column="NAME"    />
-        <result property="fileName"    column="FILE_NAME"    />
-        <result property="filePath"    column="FILE_PATH"    />
-        <result property="isIllegal"    column="IS_ILLEGAL"    />
-        <result property="keyType"    column="KEY_TYPE"    />
-        <result property="time"    column="TIME"    />
+        <result property="bInfoId" column="B_INFO_ID"/>
+        <result property="deviceId" column="DEVICE_ID"/>
+        <result property="venueId" column="VENUE_ID"/>
+        <result property="areaId" column="AREA_ID"/>
+        <result property="mac" column="MAC"/>
+        <result property="name" column="NAME"/>
+        <result property="fileName" column="FILE_NAME"/>
+        <result property="filePath" column="FILE_PATH"/>
+        <result property="isIllegal" column="IS_ILLEGAL"/>
+        <result property="keyType" column="KEY_TYPE"/>
+        <result property="time" column="TIME"/>
     </resultMap>
 
     <sql id="selectBluetoothInfoVo">
-        select B_INFO_ID, DEVICE_ID, VENUE_ID, AREA_ID, MAC, NAME, FILE_NAME, FILE_PATH, IS_ILLEGAL, KEY_TYPE, TIME from bluetooth_info
+        select B_INFO_ID,
+               DEVICE_ID,
+               VENUE_ID,
+               AREA_ID,
+               MAC,
+               NAME,
+               FILE_NAME,
+               FILE_PATH,
+               IS_ILLEGAL,
+               KEY_TYPE, TIME
+        from bluetooth_info
     </sql>
 
     <select id="selectBluetoothInfoList" parameterType="BluetoothInfo" resultMap="BluetoothInfoResult">
-        <include refid="selectBluetoothInfoVo"/>
-        <where>  
-            <if test="deviceId != null  and deviceId != ''"> and DEVICE_ID = #{deviceId}</if>
-            <if test="venueId != null "> and VENUE_ID = #{venueId}</if>
-            <if test="areaId != null "> and AREA_ID = #{areaId}</if>
-            <if test="mac != null  and mac != ''"> and MAC like concat('%', #{mac}, '%')</if>
-            <if test="name != null  and name != ''"> and NAME like concat('%', #{name}, '%')</if>
-            <if test="fileName != null  and fileName != ''"> and FILE_NAME like concat('%', #{fileName}, '%')</if>
-            <if test="filePath != null  and filePath != ''"> and FILE_PATH = #{filePath}</if>
-            <if test="isIllegal != null  and isIllegal != ''"> and IS_ILLEGAL = #{isIllegal}</if>
-            <if test="keyType != null  and keyType != ''"> and KEY_TYPE like concat('%', #{keyType}, '%')</if>
-            <if test="time != null "> and TIME = #{time}</if>
+        select * from (select B_INFO_ID, DEVICE_ID, a.VENUE_ID,b.VENUE_NAME, a.AREA_ID,c.area_name, MAC, NAME,
+        FILE_NAME, FILE_PATH, IS_ILLEGAL, KEY_TYPE, TIME from bluetooth_info a left join venue_info b on
+        a.venue_id=b.venue_id left join venue_area
+        c on a.AREA_ID=c.area_id ) t
+        <where>
+            <if test="deviceId != null  and deviceId != ''">and DEVICE_ID = #{deviceId}</if>
+            <if test="venueId != null ">and VENUE_ID = #{venueId}</if>
+            <if test="areaId != null ">and AREA_ID = #{areaId}</if>
+            <if test="mac != null  and mac != ''">and MAC like concat('%', #{mac}, '%')</if>
+            <if test="name != null  and name != ''">and NAME like concat('%', #{name}, '%')</if>
+            <if test="fileName != null  and fileName != ''">and FILE_NAME like concat('%', #{fileName}, '%')</if>
+            <if test="filePath != null  and filePath != ''">and FILE_PATH = #{filePath}</if>
+            <if test="isIllegal != null  and isIllegal != ''">and IS_ILLEGAL = #{isIllegal}</if>
+            <if test="keyType != null  and keyType != ''">and KEY_TYPE like concat('%', #{keyType}, '%')</if>
+            <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
+                and TIME between #{params.beginTime} and #{params.endTime}
+            </if>
         </where>
     </select>
-    
+
     <select id="selectBluetoothInfoByBInfoId" parameterType="Long" resultMap="BluetoothInfoResult">
         <include refid="selectBluetoothInfoVo"/>
         where B_INFO_ID = #{bInfoId}
     </select>
-        
+
     <insert id="insertBluetoothInfo" parameterType="BluetoothInfo" useGeneratedKeys="true" keyProperty="bInfoId">
         insert into bluetooth_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -56,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isIllegal != null">IS_ILLEGAL,</if>
             <if test="keyType != null">KEY_TYPE,</if>
             <if test="time != null">TIME,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="deviceId != null">#{deviceId},</if>
             <if test="venueId != null">#{venueId},</if>
@@ -68,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isIllegal != null">#{isIllegal},</if>
             <if test="keyType != null">#{keyType},</if>
             <if test="time != null">#{time},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateBluetoothInfo" parameterType="BluetoothInfo">
@@ -89,11 +104,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteBluetoothInfoByBInfoId" parameterType="Long">
-        delete from bluetooth_info where B_INFO_ID = #{bInfoId}
+        delete
+        from bluetooth_info
+        where B_INFO_ID = #{bInfoId}
     </delete>
 
     <delete id="deleteBluetoothInfoByBInfoIds" parameterType="String">
-        delete from bluetooth_info where B_INFO_ID in 
+        delete from bluetooth_info where B_INFO_ID in
         <foreach item="bInfoId" collection="array" open="(" separator="," close=")">
             #{bInfoId}
         </foreach>

+ 54 - 29
dayun-admin/src/main/resources/mapper/biz/VenueInfoMapper.xml

@@ -1,59 +1,80 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jjt.biz.mapper.VenueInfoMapper">
-    
+
     <resultMap type="VenueInfo" id="VenueInfoResult">
-        <result property="venueId"    column="VENUE_ID"    />
-        <result property="venueName"    column="VENUE_NAME"    />
-        <result property="venueAddr"    column="VENUE_ADDR"    />
-        <result property="venueDesc"    column="VENUE_DESC"    />
+        <result property="venueId" column="VENUE_ID"/>
+        <result property="venueName" column="VENUE_NAME"/>
+        <result property="venueAddr" column="VENUE_ADDR"/>
+        <result property="venueDesc" column="VENUE_DESC"/>
     </resultMap>
 
     <resultMap id="VenueInfoVenueAreaResult" type="VenueInfo" extends="VenueInfoResult">
-        <collection property="venueAreaList" notNullColumn="sub_AREA_ID" javaType="java.util.List" resultMap="VenueAreaResult" />
+        <collection property="venueAreaList" notNullColumn="sub_AREA_ID" javaType="java.util.List"
+                    resultMap="VenueAreaResult"/>
     </resultMap>
 
     <resultMap type="VenueArea" id="VenueAreaResult">
-        <result property="areaId"    column="sub_AREA_ID"    />
-        <result property="venueId"    column="sub_VENUE_ID"    />
-        <result property="areaName"    column="sub_AREA_NAME"    />
+        <result property="areaId" column="sub_AREA_ID"/>
+        <result property="venueId" column="sub_VENUE_ID"/>
+        <result property="areaName" column="sub_AREA_NAME"/>
     </resultMap>
 
     <sql id="selectVenueInfoVo">
-        select VENUE_ID, VENUE_NAME, VENUE_ADDR, VENUE_DESC from venue_info
+        select VENUE_ID, VENUE_NAME, VENUE_ADDR, VENUE_DESC
+        from venue_info
     </sql>
 
     <select id="selectVenueInfoList" parameterType="VenueInfo" resultMap="VenueInfoResult">
         <include refid="selectVenueInfoVo"/>
-        <where>  
-            <if test="venueName != null  and venueName != ''"> and VENUE_NAME like concat('%', #{venueName}, '%')</if>
-            <if test="venueAddr != null  and venueAddr != ''"> and VENUE_ADDR = #{venueAddr}</if>
-            <if test="venueDesc != null  and venueDesc != ''"> and VENUE_DESC = #{venueDesc}</if>
+        <where>
+            <if test="venueName != null  and venueName != ''">and VENUE_NAME like concat('%', #{venueName}, '%')</if>
+            <if test="venueAddr != null  and venueAddr != ''">and VENUE_ADDR = #{venueAddr}</if>
+            <if test="venueDesc != null  and venueDesc != ''">and VENUE_DESC = #{venueDesc}</if>
         </where>
     </select>
-    
+
     <select id="selectVenueInfoByVenueId" parameterType="Long" resultMap="VenueInfoVenueAreaResult">
-        select a.VENUE_ID, a.VENUE_NAME, a.VENUE_ADDR, a.VENUE_DESC,
- b.AREA_ID as sub_AREA_ID, b.VENUE_ID as sub_VENUE_ID, b.AREA_NAME as sub_AREA_NAME
+        select a.VENUE_ID,
+               a.VENUE_NAME,
+               a.VENUE_ADDR,
+               a.VENUE_DESC,
+               b.AREA_ID   as sub_AREA_ID,
+               b.VENUE_ID  as sub_VENUE_ID,
+               b.AREA_NAME as sub_AREA_NAME
         from venue_info a
-        left join venue_area b on b.VENUE_ID = a.VENUE_ID
+                 left join venue_area b on b.VENUE_ID = a.VENUE_ID
         where a.VENUE_ID = #{venueId}
     </select>
-        
+    <select id="selectTop10" resultType="com.jjt.biz.domain.TopVO">
+        SELECT a.*, a.wifi + bluetooth ss
+        FROM (SELECT t.venue_name name,
+                     (SELECT COUNT(*)
+                      FROM wifi_info
+                      WHERE IS_ILLEGAL = 'Y'
+                        AND VENUE_ID = t.VENUE_ID) wifi,
+                     (SELECT COUNT(*)
+                      FROM bluetooth_info
+                      WHERE IS_ILLEGAL = 'Y'
+                        AND VENUE_ID = t.VENUE_ID) bluetooth
+              FROM venue_info t) a
+        ORDER BY ss DESC LIMIT 10
+    </select>
+
     <insert id="insertVenueInfo" parameterType="VenueInfo" useGeneratedKeys="true" keyProperty="venueId">
         insert into venue_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="venueName != null and venueName != ''">VENUE_NAME,</if>
             <if test="venueAddr != null">VENUE_ADDR,</if>
             <if test="venueDesc != null">VENUE_DESC,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="venueName != null and venueName != ''">#{venueName},</if>
             <if test="venueAddr != null">#{venueAddr},</if>
             <if test="venueDesc != null">#{venueDesc},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateVenueInfo" parameterType="VenueInfo">
@@ -67,30 +88,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteVenueInfoByVenueId" parameterType="Long">
-        delete from venue_info where VENUE_ID = #{venueId}
+        delete
+        from venue_info
+        where VENUE_ID = #{venueId}
     </delete>
 
     <delete id="deleteVenueInfoByVenueIds" parameterType="String">
-        delete from venue_info where VENUE_ID in 
+        delete from venue_info where VENUE_ID in
         <foreach item="venueId" collection="array" open="(" separator="," close=")">
             #{venueId}
         </foreach>
     </delete>
-    
+
     <delete id="deleteVenueAreaByVenueIds" parameterType="String">
-        delete from venue_area where VENUE_ID in 
+        delete from venue_area where VENUE_ID in
         <foreach item="venueId" collection="array" open="(" separator="," close=")">
             #{venueId}
         </foreach>
     </delete>
 
     <delete id="deleteVenueAreaByVenueId" parameterType="Long">
-        delete from venue_area where VENUE_ID = #{venueId}
+        delete
+        from venue_area
+        where VENUE_ID = #{venueId}
     </delete>
 
     <insert id="batchVenueArea">
         insert into venue_area( AREA_ID, VENUE_ID, AREA_NAME) values
-		<foreach item="item" index="index" collection="list" separator=",">
+        <foreach item="item" index="index" collection="list" separator=",">
             ( #{item.areaId}, #{item.venueId}, #{item.areaName})
         </foreach>
     </insert>

+ 45 - 31
dayun-admin/src/main/resources/mapper/biz/WifiInfoMapper.xml

@@ -1,46 +1,58 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jjt.biz.mapper.WifiInfoMapper">
-    
+
     <resultMap type="WifiInfo" id="WifiInfoResult">
-        <result property="wifiInfoId"    column="WIFI_INFO_ID"    />
-        <result property="deviceId"    column="DEVICE_ID"    />
-        <result property="venueId"    column="VENUE_ID"    />
-        <result property="areaId"    column="AREA_ID"    />
-        <result property="bssid"    column="BSSID"    />
-        <result property="ssid"    column="SSID"    />
-        <result property="authPage"    column="AUTH_PAGE"    />
-        <result property="isIllegal"    column="IS_ILLEGAL"    />
-        <result property="keyType"    column="KEY_TYPE"    />
-        <result property="time"    column="TIME"    />
+        <result property="wifiInfoId" column="WIFI_INFO_ID"/>
+        <result property="deviceId" column="DEVICE_ID"/>
+        <result property="venueId" column="VENUE_ID"/>
+        <result property="areaId" column="AREA_ID"/>
+        <result property="bssid" column="BSSID"/>
+        <result property="ssid" column="SSID"/>
+        <result property="authPage" column="AUTH_PAGE"/>
+        <result property="isIllegal" column="IS_ILLEGAL"/>
+        <result property="keyType" column="KEY_TYPE"/>
+        <result property="time" column="TIME"/>
     </resultMap>
 
     <sql id="selectWifiInfoVo">
-        select WIFI_INFO_ID, DEVICE_ID, VENUE_ID, AREA_ID, BSSID, SSID, AUTH_PAGE, IS_ILLEGAL, KEY_TYPE, TIME from wifi_info
+        select WIFI_INFO_ID,
+               DEVICE_ID,
+               VENUE_ID,
+               AREA_ID,
+               BSSID,
+               SSID,
+               AUTH_PAGE,
+               IS_ILLEGAL,
+               KEY_TYPE, TIME
+        from wifi_info
     </sql>
 
     <select id="selectWifiInfoList" parameterType="WifiInfo" resultMap="WifiInfoResult">
-        <include refid="selectWifiInfoVo"/>
-        <where>  
-            <if test="deviceId != null  and deviceId != ''"> and DEVICE_ID = #{deviceId}</if>
-            <if test="venueId != null "> and VENUE_ID = #{venueId}</if>
-            <if test="areaId != null "> and AREA_ID = #{areaId}</if>
-            <if test="bssid != null  and bssid != ''"> and BSSID like concat('%', #{bssid}, '%')</if>
-            <if test="ssid != null  and ssid != ''"> and SSID like concat('%', #{ssid}, '%')</if>
-            <if test="authPage != null  and authPage != ''"> and AUTH_PAGE like concat('%', #{authPage}, '%')</if>
-            <if test="isIllegal != null  and isIllegal != ''"> and IS_ILLEGAL = #{isIllegal}</if>
-            <if test="keyType != null  and keyType != ''"> and KEY_TYPE = #{keyType}</if>
-            <if test="time != null "> and TIME = #{time}</if>
+        select * from (select WIFI_INFO_ID, DEVICE_ID, a.VENUE_ID,b.VENUE_NAME, a.AREA_ID,c.area_name, BSSID, SSID, AUTH_PAGE,
+        IS_ILLEGAL, KEY_TYPE, TIME from wifi_info a left join venue_info b on a.venue_id=b.venue_id left join venue_area
+        c on a.AREA_ID=c.area_id ) t
+        <where>
+            <if test="deviceId != null  and deviceId != ''">and DEVICE_ID = #{deviceId}</if>
+            <if test="venueId != null ">and VENUE_ID = #{venueId}</if>
+            <if test="areaId != null ">and AREA_ID = #{areaId}</if>
+            <if test="bssid != null  and bssid != ''">and BSSID like concat('%', #{bssid}, '%')</if>
+            <if test="ssid != null  and ssid != ''">and SSID like concat('%', #{ssid}, '%')</if>
+            <if test="authPage != null  and authPage != ''">and AUTH_PAGE like concat('%', #{authPage}, '%')</if>
+            <if test="isIllegal != null  and isIllegal != ''">and IS_ILLEGAL = #{isIllegal}</if>
+            <if test="keyType != null  and keyType != ''">and KEY_TYPE = #{keyType}</if>
+            <if test="time != null ">and TIME = #{time}</if>
+            <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and TIME between #{params.beginTime} and #{params.endTime}</if>
         </where>
     </select>
-    
+
     <select id="selectWifiInfoByWifiInfoId" parameterType="Long" resultMap="WifiInfoResult">
         <include refid="selectWifiInfoVo"/>
         where WIFI_INFO_ID = #{wifiInfoId}
     </select>
-        
+
     <insert id="insertWifiInfo" parameterType="WifiInfo" useGeneratedKeys="true" keyProperty="wifiInfoId">
         insert into wifi_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -53,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isIllegal != null">IS_ILLEGAL,</if>
             <if test="keyType != null">KEY_TYPE,</if>
             <if test="time != null">TIME,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="deviceId != null">#{deviceId},</if>
             <if test="venueId != null">#{venueId},</if>
@@ -64,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isIllegal != null">#{isIllegal},</if>
             <if test="keyType != null">#{keyType},</if>
             <if test="time != null">#{time},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateWifiInfo" parameterType="WifiInfo">
@@ -84,11 +96,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteWifiInfoByWifiInfoId" parameterType="Long">
-        delete from wifi_info where WIFI_INFO_ID = #{wifiInfoId}
+        delete
+        from wifi_info
+        where WIFI_INFO_ID = #{wifiInfoId}
     </delete>
 
     <delete id="deleteWifiInfoByWifiInfoIds" parameterType="String">
-        delete from wifi_info where WIFI_INFO_ID in 
+        delete from wifi_info where WIFI_INFO_ID in
         <foreach item="wifiInfoId" collection="array" open="(" separator="," close=")">
             #{wifiInfoId}
         </foreach>