Browse Source

新增需求11,广播管理系统接口优化

wangshuangpan 1 tháng trước cách đây
mục cha
commit
bfae7fe4b2

+ 344 - 0
pm-admin/src/main/java/com/pm/web/controller/publicBroadcasting/IbmsBroadcastController.java

@@ -0,0 +1,344 @@
+package com.pm.web.controller.publicBroadcasting;
+
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.pm.common.annotation.Log;
+import com.pm.common.core.controller.BaseController;
+import com.pm.common.core.domain.AjaxResult;
+import com.pm.common.enums.BusinessType;
+import com.pm.common.config.PageData;
+import com.pm.common.utils.poi.ExcelUtilPageData;
+import com.pm.subsystem.service.IIbmsBroadcastZoneService;
+import com.pm.subsystem.service.IIbmsBroadcastDeviceService;
+import com.pm.subsystem.service.IIbmsBroadcastContentService;
+import com.pm.common.core.page.TableDataInfo;
+
+/**
+ * 广播系统Controller
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+@RestController
+@RequestMapping("/broadcast/system")
+public class IbmsBroadcastController extends BaseController
+{
+    @Autowired
+    private IIbmsBroadcastZoneService ibmsBroadcastZoneService;
+    
+    @Autowired
+    private IIbmsBroadcastDeviceService ibmsBroadcastDeviceService;
+    
+    @Autowired
+    private IIbmsBroadcastContentService ibmsBroadcastContentService;
+
+    /**
+     * 查询广播分区列表
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:zone:list')")
+    @GetMapping("/zone/list")
+    public TableDataInfo zoneList()
+    {
+        PageData pd = this.getPageData();
+        startPage();
+        List<PageData> list = ibmsBroadcastZoneService.selectIbmsBroadcastZoneList(pd);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出广播分区列表
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:zone:export')")
+    @Log(title = "广播分区", businessType = BusinessType.EXPORT)
+    @PostMapping("/zone/export")
+    public void exportZone(HttpServletResponse response)
+    {
+        try {
+            PageData pd = this.getPageData();
+            List<PageData> list = ibmsBroadcastZoneService.selectIbmsBroadcastZoneList(pd);
+            String filename = "广播分区数据";
+            String[] titles = {
+                    "分区编码,zoneCode",
+                    "分区名称,zoneName",
+                    "分区类型,zoneType",
+                    "楼栋,buildingName",
+                    "楼层,floorName",
+                    "空间位置,spaceLocation",
+                    "设备数量,deviceCount",
+                    "音量,volume",
+                    "静音状态,isMute",
+                    "在线状态,isOnline",
+                    "广播状态,broadcastStatus",
+                    "当前播放内容,currentContent",
+                    "内容代号,contentCode",
+                    "优先级,priority"
+            };
+            ExcelUtilPageData.exportXLSX(response, null, null, filename, titles, list);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 获取广播分区详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:zone:query')")
+    @GetMapping(value = "/zone/{id}")
+    public AjaxResult getZoneInfo(@PathVariable("id") Long id)
+    {
+        return success(ibmsBroadcastZoneService.selectIbmsBroadcastZoneById(id));
+    }
+
+    /**
+     * 新增广播分区
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:zone:add')")
+    @Log(title = "广播分区", businessType = BusinessType.INSERT)
+    @PostMapping("/zone")
+    public AjaxResult addZone(@RequestBody PageData pd)
+    {
+        return toAjax(ibmsBroadcastZoneService.insertIbmsBroadcastZone(pd));
+    }
+
+    /**
+     * 修改广播分区
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:zone:edit')")
+    @Log(title = "广播分区", businessType = BusinessType.UPDATE)
+    @PutMapping("/zone")
+    public AjaxResult editZone(@RequestBody PageData pd)
+    {
+        return toAjax(ibmsBroadcastZoneService.updateIbmsBroadcastZone(pd));
+    }
+
+    /**
+     * 更新音量和静音状态
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:zone:control')")
+    @Log(title = "音量控制", businessType = BusinessType.UPDATE)
+    @PostMapping("/zone/volume")
+    public AjaxResult updateVolume(@RequestBody PageData pd)
+    {
+        return toAjax(ibmsBroadcastZoneService.updateZoneVolume(pd));
+    }
+
+    /**
+     * 控制广播播放
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:zone:broadcast')")
+    @Log(title = "广播控制", businessType = BusinessType.OTHER)
+    @PostMapping("/zone/control")
+    public AjaxResult controlBroadcast(@RequestBody PageData pd)
+    {
+        Map<String, Object> result = ibmsBroadcastZoneService.controlBroadcast(pd);
+        if ((boolean) result.get("success")) {
+            return success(result.get("msg"));
+        } else {
+            return error((String) result.get("msg"));
+        }
+    }
+
+    /**
+     * 紧急广播
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:zone:emergency')")
+    @Log(title = "紧急广播", businessType = BusinessType.OTHER)
+    @PostMapping("/zone/emergency")
+    public AjaxResult emergencyBroadcast(@RequestBody PageData pd)
+    {
+        Map<String, Object> result = ibmsBroadcastZoneService.emergencyBroadcast(pd);
+        if ((boolean) result.get("success")) {
+            return AjaxResult.success(result);
+        } else {
+            return AjaxResult.error((String) result.get("msg"));
+        }
+    }
+
+    /**
+     * 删除广播分区
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:zone:remove')")
+    @Log(title = "广播分区", businessType = BusinessType.DELETE)
+    @DeleteMapping("/zone/{ids}")
+    public AjaxResult removeZone(@PathVariable Long[] ids)
+    {
+        return toAjax(ibmsBroadcastZoneService.deleteIbmsBroadcastZoneByIds(ids));
+    }
+
+    /**
+     * 查询广播设备列表
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:device:list')")
+    @GetMapping("/device/list")
+    public TableDataInfo deviceList()
+    {
+        PageData pd = this.getPageData();
+        startPage();
+        List<PageData> list = ibmsBroadcastDeviceService.selectIbmsBroadcastDeviceList(pd);
+        
+        // 获取统计信息
+        PageData stats = ibmsBroadcastDeviceService.getDeviceStatistics();
+        
+        TableDataInfo dataTable = getDataTable(list);
+        if (stats != null) {
+            dataTable.setExtData(stats);
+        }
+        
+        return dataTable;
+    }
+
+    /**
+     * 根据分区ID查询设备
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:device:list')")
+    @GetMapping("/device/zone/{zoneId}")
+    public AjaxResult getZoneDevices(@PathVariable("zoneId") Long zoneId)
+    {
+        List<PageData> list = ibmsBroadcastDeviceService.getDevicesByZoneId(zoneId);
+        return success(list);
+    }
+
+    /**
+     * 导出广播设备列表
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:device:export')")
+    @Log(title = "广播设备", businessType = BusinessType.EXPORT)
+    @PostMapping("/device/export")
+    public void exportDevice(HttpServletResponse response)
+    {
+        try {
+            PageData pd = this.getPageData();
+            List<PageData> list = ibmsBroadcastDeviceService.selectIbmsBroadcastDeviceList(pd);
+            String filename = "广播设备数据";
+            String[] titles = {
+                    "设备编码,deviceCode",
+                    "设备名称,deviceName",
+                    "设备类型,deviceType",
+                    "所属分区,zoneName",
+                    "IP地址,ipAddress",
+                    "MAC地址,macAddress",
+                    "品牌,brand",
+                    "型号,model",
+                    "功率,power",
+                    "状态,status",
+                    "在线状态,isOnline",
+                    "故障代码,faultCode",
+                    "故障描述,faultDesc",
+                    "最后心跳时间,lastHeartbeat"
+            };
+            ExcelUtilPageData.exportXLSX(response, null, null, filename, titles, list);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 获取广播设备详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:device:query')")
+    @GetMapping(value = "/device/{id}")
+    public AjaxResult getDeviceInfo(@PathVariable("id") Long id)
+    {
+        return success(ibmsBroadcastDeviceService.selectIbmsBroadcastDeviceById(id));
+    }
+
+    /**
+     * 新增广播设备
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:device:add')")
+    @Log(title = "广播设备", businessType = BusinessType.INSERT)
+    @PostMapping("/device")
+    public AjaxResult addDevice(@RequestBody PageData pd)
+    {
+        return toAjax(ibmsBroadcastDeviceService.insertIbmsBroadcastDevice(pd));
+    }
+
+    /**
+     * 修改广播设备
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:device:edit')")
+    @Log(title = "广播设备", businessType = BusinessType.UPDATE)
+    @PutMapping("/device")
+    public AjaxResult editDevice(@RequestBody PageData pd)
+    {
+        return toAjax(ibmsBroadcastDeviceService.updateIbmsBroadcastDevice(pd));
+    }
+
+    /**
+     * 删除广播设备
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:device:remove')")
+    @Log(title = "广播设备", businessType = BusinessType.DELETE)
+    @DeleteMapping("/device/{ids}")
+    public AjaxResult removeDevice(@PathVariable Long[] ids)
+    {
+        return toAjax(ibmsBroadcastDeviceService.deleteIbmsBroadcastDeviceByIds(ids));
+    }
+
+    /**
+     * 查询广播内容列表
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:content:list')")
+    @GetMapping("/content/list")
+    public TableDataInfo contentList()
+    {
+        PageData pd = this.getPageData();
+        startPage();
+        List<PageData> list = ibmsBroadcastContentService.selectIbmsBroadcastContentList(pd);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取广播内容详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:content:query')")
+    @GetMapping(value = "/content/{id}")
+    public AjaxResult getContentInfo(@PathVariable("id") Long id)
+    {
+        return success(ibmsBroadcastContentService.selectIbmsBroadcastContentById(id));
+    }
+
+    /**
+     * 新增广播内容
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:content:add')")
+    @Log(title = "广播内容", businessType = BusinessType.INSERT)
+    @PostMapping("/content")
+    public AjaxResult addContent(@RequestBody PageData pd)
+    {
+        return toAjax(ibmsBroadcastContentService.insertIbmsBroadcastContent(pd));
+    }
+
+    /**
+     * 修改广播内容
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:content:edit')")
+    @Log(title = "广播内容", businessType = BusinessType.UPDATE)
+    @PutMapping("/content")
+    public AjaxResult editContent(@RequestBody PageData pd)
+    {
+        return toAjax(ibmsBroadcastContentService.updateIbmsBroadcastContent(pd));
+    }
+
+    /**
+     * 删除广播内容
+     */
+    @PreAuthorize("@ss.hasPermi('broadcast:content:remove')")
+    @Log(title = "广播内容", businessType = BusinessType.DELETE)
+    @DeleteMapping("/content/{ids}")
+    public AjaxResult removeContent(@PathVariable Long[] ids)
+    {
+        return toAjax(ibmsBroadcastContentService.deleteIbmsBroadcastContentByIds(ids));
+    }
+}

+ 61 - 0
pm-system/src/main/java/com/pm/subsystem/mapper/IbmsBroadcastContentMapper.java

@@ -0,0 +1,61 @@
+package com.pm.subsystem.mapper;
+
+import java.util.List;
+import com.pm.common.config.PageData;
+
+/**
+ * 广播内容Mapper接口
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+public interface IbmsBroadcastContentMapper
+{
+    /**
+     * 查询广播内容
+     *
+     * @param id 广播内容主键
+     * @return 广播内容
+     */
+    public PageData selectIbmsBroadcastContentById(Long id);
+
+    /**
+     * 查询广播内容列表
+     *
+     * @param pd
+     * @return 广播内容集合
+     */
+    public List<PageData> selectIbmsBroadcastContentList(PageData pd);
+
+    /**
+     * 新增广播内容
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int insertIbmsBroadcastContent(PageData pd);
+
+    /**
+     * 修改广播内容
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int updateIbmsBroadcastContent(PageData pd);
+
+    /**
+     * 删除广播内容
+     *
+     * @param id 广播内容主键
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastContentById(Long id);
+
+    /**
+     * 批量删除广播内容
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastContentByIds(Long[] ids);
+}

+ 76 - 0
pm-system/src/main/java/com/pm/subsystem/mapper/IbmsBroadcastDeviceMapper.java

@@ -0,0 +1,76 @@
+package com.pm.subsystem.mapper;
+
+import java.util.List;
+import com.pm.common.config.PageData;
+
+/**
+ * 广播设备Mapper接口
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+public interface IbmsBroadcastDeviceMapper
+{
+    /**
+     * 查询广播设备
+     *
+     * @param id 广播设备主键
+     * @return 广播设备
+     */
+    public PageData selectIbmsBroadcastDeviceById(Long id);
+
+    /**
+     * 查询广播设备列表
+     *
+     * @param pd
+     * @return 广播设备集合
+     */
+    public List<PageData> selectIbmsBroadcastDeviceList(PageData pd);
+
+    /**
+     * 查询设备统计信息
+     *
+     * @return 统计信息
+     */
+    public PageData selectDeviceStatistics();
+
+    /**
+     * 根据分区ID查询设备
+     *
+     * @param zoneId 分区ID
+     * @return 设备集合
+     */
+    public List<PageData> selectDevicesByZoneId(Long zoneId);
+
+    /**
+     * 新增广播设备
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int insertIbmsBroadcastDevice(PageData pd);
+
+    /**
+     * 修改广播设备
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int updateIbmsBroadcastDevice(PageData pd);
+
+    /**
+     * 删除广播设备
+     *
+     * @param id 广播设备主键
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastDeviceById(Long id);
+
+    /**
+     * 批量删除广播设备
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastDeviceByIds(Long[] ids);
+}

+ 80 - 0
pm-system/src/main/java/com/pm/subsystem/mapper/IbmsBroadcastZoneMapper.java

@@ -0,0 +1,80 @@
+package com.pm.subsystem.mapper;
+
+import java.util.List;
+import com.pm.common.config.PageData;
+
+/**
+ * 广播分区Mapper接口
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+public interface IbmsBroadcastZoneMapper
+{
+    /**
+     * 查询广播分区
+     *
+     * @param id 广播分区主键
+     * @return 广播分区
+     */
+    public PageData selectIbmsBroadcastZoneById(Long id);
+
+    /**
+     * 查询广播分区列表
+     *
+     * @param pd
+     * @return 广播分区集合
+     */
+    public List<PageData> selectIbmsBroadcastZoneList(PageData pd);
+
+    /**
+     * 新增广播分区
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int insertIbmsBroadcastZone(PageData pd);
+
+    /**
+     * 修改广播分区
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int updateIbmsBroadcastZone(PageData pd);
+
+    /**
+     * 更新音量和静音状态
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int updateZoneVolume(PageData pd);
+
+    /**
+     * 更新广播状态
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int updateBroadcastStatus(PageData pd);
+
+    /**
+     * 删除广播分区
+     *
+     * @param id 广播分区主键
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastZoneById(Long id);
+
+    /**
+     * 批量删除广播分区
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastZoneByIds(Long[] ids);
+}
+
+
+

+ 61 - 0
pm-system/src/main/java/com/pm/subsystem/service/IIbmsBroadcastContentService.java

@@ -0,0 +1,61 @@
+package com.pm.subsystem.service;
+
+import java.util.List;
+import com.pm.common.config.PageData;
+
+/**
+ * 广播内容Service接口
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+public interface IIbmsBroadcastContentService
+{
+    /**
+     * 查询广播内容
+     *
+     * @param id 广播内容主键
+     * @return 广播内容
+     */
+    public PageData selectIbmsBroadcastContentById(Long id);
+
+    /**
+     * 查询广播内容列表
+     *
+     * @param pd
+     * @return 广播内容集合
+     */
+    public List<PageData> selectIbmsBroadcastContentList(PageData pd);
+
+    /**
+     * 新增广播内容
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int insertIbmsBroadcastContent(PageData pd);
+
+    /**
+     * 修改广播内容
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int updateIbmsBroadcastContent(PageData pd);
+
+    /**
+     * 批量删除广播内容
+     *
+     * @param ids 需要删除的广播内容主键集合
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastContentByIds(Long[] ids);
+
+    /**
+     * 删除广播内容信息
+     *
+     * @param id 广播内容主键
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastContentById(Long id);
+}

+ 76 - 0
pm-system/src/main/java/com/pm/subsystem/service/IIbmsBroadcastDeviceService.java

@@ -0,0 +1,76 @@
+package com.pm.subsystem.service;
+
+import java.util.List;
+import com.pm.common.config.PageData;
+
+/**
+ * 广播设备Service接口
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+public interface IIbmsBroadcastDeviceService
+{
+    /**
+     * 查询广播设备
+     *
+     * @param id 广播设备主键
+     * @return 广播设备
+     */
+    public PageData selectIbmsBroadcastDeviceById(Long id);
+
+    /**
+     * 查询广播设备列表
+     *
+     * @param pd
+     * @return 广播设备集合
+     */
+    public List<PageData> selectIbmsBroadcastDeviceList(PageData pd);
+
+    /**
+     * 获取设备统计信息
+     *
+     * @return 统计信息
+     */
+    public PageData getDeviceStatistics();
+
+    /**
+     * 根据分区ID查询设备
+     *
+     * @param zoneId 分区ID
+     * @return 设备集合
+     */
+    public List<PageData> getDevicesByZoneId(Long zoneId);
+
+    /**
+     * 新增广播设备
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int insertIbmsBroadcastDevice(PageData pd);
+
+    /**
+     * 修改广播设备
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int updateIbmsBroadcastDevice(PageData pd);
+
+    /**
+     * 批量删除广播设备
+     *
+     * @param ids 需要删除的广播设备主键集合
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastDeviceByIds(Long[] ids);
+
+    /**
+     * 删除广播设备信息
+     *
+     * @param id 广播设备主键
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastDeviceById(Long id);
+}

+ 89 - 0
pm-system/src/main/java/com/pm/subsystem/service/IIbmsBroadcastZoneService.java

@@ -0,0 +1,89 @@
+package com.pm.subsystem.service;
+
+import java.util.List;
+import java.util.Map;
+import com.pm.common.config.PageData;
+
+/**
+ * 广播分区Service接口
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+public interface IIbmsBroadcastZoneService
+{
+    /**
+     * 查询广播分区
+     *
+     * @param id 广播分区主键
+     * @return 广播分区
+     */
+    public PageData selectIbmsBroadcastZoneById(Long id);
+
+    /**
+     * 查询广播分区列表
+     *
+     * @param pd
+     * @return 广播分区集合
+     */
+    public List<PageData> selectIbmsBroadcastZoneList(PageData pd);
+
+    /**
+     * 新增广播分区
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int insertIbmsBroadcastZone(PageData pd);
+
+    /**
+     * 修改广播分区
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int updateIbmsBroadcastZone(PageData pd);
+
+    /**
+     * 更新音量和静音状态
+     *
+     * @param pd
+     * @return 结果
+     */
+    public int updateZoneVolume(PageData pd);
+
+    /**
+     * 控制广播播放
+     *
+     * @param pd
+     * @return 结果
+     */
+    public Map<String, Object> controlBroadcast(PageData pd);
+
+    /**
+     * 紧急广播
+     *
+     * @param pd
+     * @return 结果
+     */
+    public Map<String, Object> emergencyBroadcast(PageData pd);
+
+    /**
+     * 批量删除广播分区
+     *
+     * @param ids 需要删除的广播分区主键集合
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastZoneByIds(Long[] ids);
+
+    /**
+     * 删除广播分区信息
+     *
+     * @param id 广播分区主键
+     * @return 结果
+     */
+    public int deleteIbmsBroadcastZoneById(Long id);
+}
+
+
+

+ 95 - 0
pm-system/src/main/java/com/pm/subsystem/service/impl/IbmsBroadcastContentServiceImpl.java

@@ -0,0 +1,95 @@
+package com.pm.subsystem.service.impl;
+
+import java.util.List;
+import com.pm.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.pm.subsystem.mapper.IbmsBroadcastContentMapper;
+import com.pm.subsystem.service.IIbmsBroadcastContentService;
+import com.pm.common.config.PageData;
+
+/**
+ * 广播内容Service业务层处理
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+@Service
+public class IbmsBroadcastContentServiceImpl implements IIbmsBroadcastContentService
+{
+    @Autowired
+    private IbmsBroadcastContentMapper ibmsBroadcastContentMapper;
+
+    /**
+     * 查询广播内容
+     *
+     * @param id 广播内容主键
+     * @return 广播内容
+     */
+    @Override
+    public PageData selectIbmsBroadcastContentById(Long id)
+    {
+        return ibmsBroadcastContentMapper.selectIbmsBroadcastContentById(id);
+    }
+
+    /**
+     * 查询广播内容列表
+     *
+     * @param pd
+     * @return 广播内容
+     */
+    @Override
+    public List<PageData> selectIbmsBroadcastContentList(PageData pd)
+    {
+        return ibmsBroadcastContentMapper.selectIbmsBroadcastContentList(pd);
+    }
+
+    /**
+     * 新增广播内容
+     *
+     * @param pd
+     * @return 结果
+     */
+    @Override
+    public int insertIbmsBroadcastContent(PageData pd)
+    {
+        pd.put("createTime", DateUtils.getTime());
+        return ibmsBroadcastContentMapper.insertIbmsBroadcastContent(pd);
+    }
+
+    /**
+     * 修改广播内容
+     *
+     * @param pd
+     * @return 结果
+     */
+    @Override
+    public int updateIbmsBroadcastContent(PageData pd)
+    {
+        return ibmsBroadcastContentMapper.updateIbmsBroadcastContent(pd);
+    }
+
+    /**
+     * 批量删除广播内容
+     *
+     * @param ids 需要删除的广播内容主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIbmsBroadcastContentByIds(Long[] ids)
+    {
+        return ibmsBroadcastContentMapper.deleteIbmsBroadcastContentByIds(ids);
+    }
+
+    /**
+     * 删除广播内容信息
+     *
+     * @param id 广播内容主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIbmsBroadcastContentById(Long id)
+    {
+        return ibmsBroadcastContentMapper.deleteIbmsBroadcastContentById(id);
+    }
+}

+ 120 - 0
pm-system/src/main/java/com/pm/subsystem/service/impl/IbmsBroadcastDeviceServiceImpl.java

@@ -0,0 +1,120 @@
+package com.pm.subsystem.service.impl;
+
+import java.util.List;
+import com.pm.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.pm.subsystem.mapper.IbmsBroadcastDeviceMapper;
+import com.pm.subsystem.service.IIbmsBroadcastDeviceService;
+import com.pm.common.config.PageData;
+
+/**
+ * 广播设备Service业务层处理
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+@Service
+public class IbmsBroadcastDeviceServiceImpl implements IIbmsBroadcastDeviceService
+{
+    @Autowired
+    private IbmsBroadcastDeviceMapper ibmsBroadcastDeviceMapper;
+
+    /**
+     * 查询广播设备
+     *
+     * @param id 广播设备主键
+     * @return 广播设备
+     */
+    @Override
+    public PageData selectIbmsBroadcastDeviceById(Long id)
+    {
+        return ibmsBroadcastDeviceMapper.selectIbmsBroadcastDeviceById(id);
+    }
+
+    /**
+     * 查询广播设备列表
+     *
+     * @param pd
+     * @return 广播设备
+     */
+    @Override
+    public List<PageData> selectIbmsBroadcastDeviceList(PageData pd)
+    {
+        return ibmsBroadcastDeviceMapper.selectIbmsBroadcastDeviceList(pd);
+    }
+
+    /**
+     * 获取设备统计信息
+     *
+     * @return 统计信息
+     */
+    @Override
+    public PageData getDeviceStatistics()
+    {
+        return ibmsBroadcastDeviceMapper.selectDeviceStatistics();
+    }
+
+    /**
+     * 根据分区ID查询设备
+     *
+     * @param zoneId 分区ID
+     * @return 设备集合
+     */
+    @Override
+    public List<PageData> getDevicesByZoneId(Long zoneId)
+    {
+        return ibmsBroadcastDeviceMapper.selectDevicesByZoneId(zoneId);
+    }
+
+    /**
+     * 新增广播设备
+     *
+     * @param pd
+     * @return 结果
+     */
+    @Override
+    public int insertIbmsBroadcastDevice(PageData pd)
+    {
+        pd.put("createTime", DateUtils.getTime());
+        pd.put("updateTime", DateUtils.getTime());
+        return ibmsBroadcastDeviceMapper.insertIbmsBroadcastDevice(pd);
+    }
+
+    /**
+     * 修改广播设备
+     *
+     * @param pd
+     * @return 结果
+     */
+    @Override
+    public int updateIbmsBroadcastDevice(PageData pd)
+    {
+        pd.put("updateTime", DateUtils.getTime());
+        return ibmsBroadcastDeviceMapper.updateIbmsBroadcastDevice(pd);
+    }
+
+    /**
+     * 批量删除广播设备
+     *
+     * @param ids 需要删除的广播设备主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIbmsBroadcastDeviceByIds(Long[] ids)
+    {
+        return ibmsBroadcastDeviceMapper.deleteIbmsBroadcastDeviceByIds(ids);
+    }
+
+    /**
+     * 删除广播设备信息
+     *
+     * @param id 广播设备主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIbmsBroadcastDeviceById(Long id)
+    {
+        return ibmsBroadcastDeviceMapper.deleteIbmsBroadcastDeviceById(id);
+    }
+}

+ 263 - 0
pm-system/src/main/java/com/pm/subsystem/service/impl/IbmsBroadcastZoneServiceImpl.java

@@ -0,0 +1,263 @@
+package com.pm.subsystem.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.stream.Collectors;
+import com.pm.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.pm.subsystem.mapper.IbmsBroadcastZoneMapper;
+import com.pm.subsystem.mapper.IbmsBroadcastContentMapper;
+import com.pm.subsystem.service.IIbmsBroadcastZoneService;
+import com.pm.common.config.PageData;
+
+/**
+ * 广播分区Service业务层处理
+ *
+ * @author system
+ * @date 2025-01-06
+ */
+@Service
+public class IbmsBroadcastZoneServiceImpl implements IIbmsBroadcastZoneService
+{
+    @Autowired
+    private IbmsBroadcastZoneMapper ibmsBroadcastZoneMapper;
+    
+    @Autowired
+    private IbmsBroadcastContentMapper ibmsBroadcastContentMapper;
+
+    /**
+     * 查询广播分区
+     *
+     * @param id 广播分区主键
+     * @return 广播分区
+     */
+    @Override
+    public PageData selectIbmsBroadcastZoneById(Long id)
+    {
+        return ibmsBroadcastZoneMapper.selectIbmsBroadcastZoneById(id);
+    }
+
+    /**
+     * 查询广播分区列表
+     *
+     * @param pd
+     * @return 广播分区
+     */
+    @Override
+    public List<PageData> selectIbmsBroadcastZoneList(PageData pd)
+    {
+        return ibmsBroadcastZoneMapper.selectIbmsBroadcastZoneList(pd);
+    }
+
+    /**
+     * 新增广播分区
+     *
+     * @param pd
+     * @return 结果
+     */
+    @Override
+    public int insertIbmsBroadcastZone(PageData pd)
+    {
+        pd.put("createTime", DateUtils.getTime());
+        pd.put("updateTime", DateUtils.getTime());
+        return ibmsBroadcastZoneMapper.insertIbmsBroadcastZone(pd);
+    }
+
+    /**
+     * 修改广播分区
+     *
+     * @param pd
+     * @return 结果
+     */
+    @Override
+    public int updateIbmsBroadcastZone(PageData pd)
+    {
+        pd.put("updateTime", DateUtils.getTime());
+        return ibmsBroadcastZoneMapper.updateIbmsBroadcastZone(pd);
+    }
+
+    /**
+     * 更新音量和静音状态
+     *
+     * @param pd
+     * @return 结果
+     */
+    @Override
+    public int updateZoneVolume(PageData pd)
+    {
+        pd.put("updateTime", DateUtils.getTime());
+        
+        // TODO: 调用广播系统接口更新实际设备音量
+        simulateCallBroadcastAPI("updateVolume", pd);
+        
+        return ibmsBroadcastZoneMapper.updateZoneVolume(pd);
+    }
+
+    /**
+     * 控制广播播放
+     *
+     * @param pd
+     * @return 结果
+     */
+    @Override
+    public Map<String, Object> controlBroadcast(PageData pd)
+    {
+        Map<String, Object> result = new HashMap<>();
+        
+        try {
+            String action = pd.getString("action");
+            
+            if ("stop".equals(action)) {
+                // 停止播放
+                PageData updatePd = new PageData();
+                updatePd.put("id", pd.get("zoneId"));
+                updatePd.put("broadcastStatus", 0);
+                updatePd.put("currentContent", null);
+                updatePd.put("contentCode", null);
+                updatePd.put("updateTime", DateUtils.getTime());
+                ibmsBroadcastZoneMapper.updateBroadcastStatus(updatePd);
+                
+                // TODO: 调用广播系统接口停止播放
+                simulateCallBroadcastAPI("stopBroadcast", pd);
+                
+                result.put("success", true);
+                result.put("msg", "广播已停止");
+            } else {
+                // 开始播放
+                // 获取内容信息
+                PageData contentQuery = new PageData();
+                contentQuery.put("contentCode", pd.getString("contentCode"));
+                List<PageData> contents = ibmsBroadcastContentMapper.selectIbmsBroadcastContentList(contentQuery);
+                
+                if (contents != null && contents.size() > 0) {
+                    PageData content = contents.get(0);
+                    
+                    // 更新分区状态
+                    PageData updatePd = new PageData();
+                    updatePd.put("id", pd.get("zoneId"));
+                    updatePd.put("broadcastStatus", 1);
+                    updatePd.put("currentContent", content.getString("contentName"));
+                    updatePd.put("contentCode", pd.getString("contentCode"));
+                    updatePd.put("updateTime", DateUtils.getTime());
+                    ibmsBroadcastZoneMapper.updateBroadcastStatus(updatePd);
+                    
+                    // TODO: 调用广播系统接口开始播放
+                    pd.put("filePath", content.getString("filePath"));
+                    simulateCallBroadcastAPI("startBroadcast", pd);
+                    
+                    result.put("success", true);
+                    result.put("msg", "广播开始播放");
+                } else {
+                    result.put("success", false);
+                    result.put("msg", "广播内容不存在");
+                }
+            }
+        } catch (Exception e) {
+            result.put("success", false);
+            result.put("msg", "操作失败:" + e.getMessage());
+        }
+        
+        return result;
+    }
+
+    /**
+     * 紧急广播
+     *
+     * @param pd
+     * @return 结果
+     */
+    @Override
+    public Map<String, Object> emergencyBroadcast(PageData pd)
+    {
+        Map<String, Object> result = new HashMap<>();
+        
+        try {
+            Integer broadcastRange = pd.getInteger("broadcastRange");
+            List<Long> zoneIds;
+            
+            if (broadcastRange == 1) {
+                // 全部分区
+                List<PageData> allZones = ibmsBroadcastZoneMapper.selectIbmsBroadcastZoneList(new PageData());
+                zoneIds = new ArrayList<>();
+                for (PageData zone : allZones) {
+                    if (zone.getInteger("isOnline") == 1) {
+                    Long ids=(Long)    zone.get("id");
+                        zoneIds.add(ids);
+                    }
+                }
+            } else {
+                // 选择的分区
+                String selectedZonesStr = pd.getString("selectedZones");
+                zoneIds = Arrays.asList(selectedZonesStr.split(",")).stream()
+                    .map(Long::parseLong)
+                    .collect(Collectors.toList());
+            }
+            
+            // 更新所有选中分区的状态
+            for (Long zoneId : zoneIds) {
+                PageData updatePd = new PageData();
+                updatePd.put("id", zoneId);
+                updatePd.put("broadcastStatus", 2);
+                updatePd.put("currentContent", "紧急广播");
+                updatePd.put("contentCode", pd.getString("contentCode"));
+                updatePd.put("updateTime", DateUtils.getTime());
+                ibmsBroadcastZoneMapper.updateBroadcastStatus(updatePd);
+            }
+            
+            // TODO: 调用广播系统接口发送紧急广播
+            pd.put("zoneIds", zoneIds);
+            simulateCallBroadcastAPI("emergencyBroadcast", pd);
+            
+            result.put("success", true);
+            result.put("msg", "紧急广播已发送到" + zoneIds.size() + "个分区");
+            result.put("affectedZones", zoneIds.size());
+            
+        } catch (Exception e) {
+            result.put("success", false);
+            result.put("msg", "紧急广播发送失败:" + e.getMessage());
+        }
+        
+        return result;
+    }
+
+    /**
+     * 批量删除广播分区
+     *
+     * @param ids 需要删除的广播分区主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIbmsBroadcastZoneByIds(Long[] ids)
+    {
+        return ibmsBroadcastZoneMapper.deleteIbmsBroadcastZoneByIds(ids);
+    }
+
+    /**
+     * 删除广播分区信息
+     *
+     * @param id 广播分区主键
+     * @return 结果
+     */
+    @Override
+    public int deleteIbmsBroadcastZoneById(Long id)
+    {
+        return ibmsBroadcastZoneMapper.deleteIbmsBroadcastZoneById(id);
+    }
+    
+    /**
+     * 模拟调用广播系统接口
+     */
+    private void simulateCallBroadcastAPI(String action, PageData params) {
+        // TODO: 实际项目中这里应该调用真实的广播系统接口
+        // 模拟接口调用日志
+        System.out.println("调用广播系统接口: " + action);
+        System.out.println("参数: " + params.toString());
+    }
+}
+
+
+

+ 42 - 0
pm-system/src/main/resources/mapper/subsystem/IbmsBroadcastContentMapper.xml

@@ -0,0 +1,42 @@
+<?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="com.pm.subsystem.mapper.IbmsBroadcastContentMapper">
+
+    <resultMap type="pd" id="IbmsBroadcastContentResult">
+        <result property="id"    column="id"    />
+        <result property="contentCode"    column="content_code"    />
+        <result property="contentName"    column="content_name"    />
+        <result property="contentType"    column="content_type"    />
+        <result property="filePath"    column="file_path"    />
+        <result property="duration"    column="duration"    />
+        <result property="priority"    column="priority"    />
+        <result property="isLoop"    column="is_loop"    />
+        <result property="description"    column="description"    />
+        <result property="createTime"    column="create_time"    />
+    </resultMap>
+
+    <sql id="selectIbmsBroadcastContentVo">
+        select id, content_code, content_name, content_type, file_path, duration,
+        priority, is_loop, description, create_time
+        from ibms_broadcast_content
+    </sql>
+
+    <select id="selectIbmsBroadcastContentList" parameterType="pd" resultMap="IbmsBroadcastContentResult">
+        <include refid="selectIbmsBroadcastContentVo"/>
+        <where>
+            <if test="contentType != null and contentType != ''">
+                and content_type in
+                <foreach item="type" collection="contentType.split(',')" open="(" separator="," close=")">
+                    #{type}
+                </foreach>
+            </if>
+            <if test="contentName != null and contentName != ''">
+                and content_name like concat('%', #{contentName}, '%')
+            </if>
+        </where>
+        order by content_type, priority desc, content_code
+    </select>
+
+</mapper>

+ 85 - 0
pm-system/src/main/resources/mapper/subsystem/IbmsBroadcastDeviceMapper.xml

@@ -0,0 +1,85 @@
+<?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="com.pm.subsystem.mapper.IbmsBroadcastDeviceMapper">
+
+    <resultMap type="pd" id="IbmsBroadcastDeviceResult">
+        <result property="id"    column="id"    />
+        <result property="deviceCode"    column="device_code"    />
+        <result property="deviceName"    column="device_name"    />
+        <result property="deviceType"    column="device_type"    />
+        <result property="zoneId"    column="zone_id"    />
+        <result property="zoneCode"    column="zone_code"    />
+        <result property="zoneName"    column="zone_name"    />
+        <result property="ipAddress"    column="ip_address"    />
+        <result property="macAddress"    column="mac_address"    />
+        <result property="brand"    column="brand"    />
+        <result property="model"    column="model"    />
+        <result property="power"    column="power"    />
+        <result property="status"    column="status"    />
+        <result property="isOnline"    column="is_online"    />
+        <result property="faultCode"    column="fault_code"    />
+        <result property="faultDesc"    column="fault_desc"    />
+        <result property="lastHeartbeat"    column="last_heartbeat"    />
+        <result property="positionX"    column="position_x"    />
+        <result property="positionY"    column="position_y"    />
+        <result property="positionZ"    column="position_z"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectIbmsBroadcastDeviceVo">
+        select id, device_code, device_name, device_type, zone_id, zone_code, zone_name,
+        ip_address, mac_address, brand, model, power, status, is_online,
+        fault_code, fault_desc, last_heartbeat, position_x, position_y, position_z,
+        create_time, update_time
+        from ibms_broadcast_device
+    </sql>
+
+    <select id="selectIbmsBroadcastDeviceList" parameterType="pd" resultMap="IbmsBroadcastDeviceResult">
+        <include refid="selectIbmsBroadcastDeviceVo"/>
+        <where>
+            <if test="deviceCode != null and deviceCode != ''">
+                and device_code like concat('%', #{deviceCode}, '%')
+            </if>
+            <if test="deviceName != null and deviceName != ''">
+                and device_name like concat('%', #{deviceName}, '%')
+            </if>
+            <if test="deviceType != null and deviceType != ''">
+                and device_type = #{deviceType}
+            </if>
+            <if test="zoneId != null">
+                and zone_id = #{zoneId}
+            </if>
+            <if test="zoneName != null and zoneName != ''">
+                and zone_name like concat('%', #{zoneName}, '%')
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+            <if test="isOnline != null">
+                and is_online = #{isOnline}
+            </if>
+        </where>
+        order by zone_code, device_type, device_code
+    </select>
+
+    <!-- 查询设备统计信息 -->
+    <select id="selectDeviceStatistics" resultType="pd">
+        select
+        count(1) as total,
+        sum(case when is_online = 1 then 1 else 0 end) as online,
+        sum(case when status = 0 then 1 else 0 end) as fault,
+        sum(case when status = 2 then 1 else 0 end) as maintenance
+        from ibms_broadcast_device
+    </select>
+
+    <!-- 根据分区ID查询设备 -->
+    <select id="selectDevicesByZoneId" parameterType="Long" resultMap="IbmsBroadcastDeviceResult">
+        <include refid="selectIbmsBroadcastDeviceVo"/>
+        where zone_id = #{zoneId}
+        order by device_type, device_code
+    </select>
+
+</mapper>

+ 173 - 0
pm-system/src/main/resources/mapper/subsystem/IbmsBroadcastZoneMapper.xml

@@ -0,0 +1,173 @@
+<?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="com.pm.subsystem.mapper.IbmsBroadcastZoneMapper">
+
+    <resultMap type="pd" id="IbmsBroadcastZoneResult">
+        <result property="id"    column="id"    />
+        <result property="zoneCode"    column="zone_code"    />
+        <result property="zoneName"    column="zone_name"    />
+        <result property="zoneType"    column="zone_type"    />
+        <result property="buildingName"    column="building_name"    />
+        <result property="floorName"    column="floor_name"    />
+        <result property="spaceLocation"    column="space_location"    />
+        <result property="deviceCount"    column="device_count"    />
+        <result property="volume"    column="volume"    />
+        <result property="isMute"    column="is_mute"    />
+        <result property="isOnline"    column="is_online"    />
+        <result property="broadcastStatus"    column="broadcast_status"    />
+        <result property="currentContent"    column="current_content"    />
+        <result property="contentCode"    column="content_code"    />
+        <result property="priority"    column="priority"    />
+        <result property="positionX"    column="position_x"    />
+        <result property="positionY"    column="position_y"    />
+        <result property="positionZ"    column="position_z"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectIbmsBroadcastZoneVo">
+        select id, zone_code, zone_name, zone_type, building_name, floor_name, space_location,
+               device_count, volume, is_mute, is_online, broadcast_status, current_content,
+               content_code, priority, position_x, position_y, position_z, create_time, update_time
+        from ibms_broadcast_zone
+    </sql>
+
+    <select id="selectIbmsBroadcastZoneList" parameterType="pd" resultMap="IbmsBroadcastZoneResult">
+        <include refid="selectIbmsBroadcastZoneVo"/>
+        <where>
+            <if test="zoneCode != null and zoneCode != ''">
+                and zone_code like concat('%', #{zoneCode}, '%')
+            </if>
+            <if test="zoneName != null and zoneName != ''">
+                and zone_name like concat('%', #{zoneName}, '%')
+            </if>
+            <if test="zoneType != null and zoneType != ''">
+                and zone_type = #{zoneType}
+            </if>
+            <if test="buildingName != null and buildingName != ''">
+                and building_name = #{buildingName}
+            </if>
+            <if test="floorName != null and floorName != ''">
+                and floor_name = #{floorName}
+            </if>
+            <if test="isOnline != null">
+                and is_online = #{isOnline}
+            </if>
+            <if test="broadcastStatus != null">
+                and broadcast_status = #{broadcastStatus}
+            </if>
+        </where>
+        order by building_name, floor_name, zone_code
+    </select>
+
+    <select id="selectIbmsBroadcastZoneById" parameterType="Long" resultMap="IbmsBroadcastZoneResult">
+        <include refid="selectIbmsBroadcastZoneVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertIbmsBroadcastZone" parameterType="pd" useGeneratedKeys="true" keyProperty="id">
+        insert into ibms_broadcast_zone
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="zoneCode != null and zoneCode != ''">zone_code,</if>
+            <if test="zoneName != null and zoneName != ''">zone_name,</if>
+            <if test="zoneType != null and zoneType != ''">zone_type,</if>
+            <if test="buildingName != null and buildingName != ''">building_name,</if>
+            <if test="floorName != null and floorName != ''">floor_name,</if>
+            <if test="spaceLocation != null and spaceLocation != ''">space_location,</if>
+            <if test="deviceCount != null">device_count,</if>
+            <if test="volume != null">volume,</if>
+            <if test="isMute != null">is_mute,</if>
+            <if test="isOnline != null">is_online,</if>
+            <if test="broadcastStatus != null">broadcast_status,</if>
+            <if test="currentContent != null and currentContent != ''">current_content,</if>
+            <if test="contentCode != null and contentCode != ''">content_code,</if>
+            <if test="priority != null">priority,</if>
+            <if test="positionX != null">position_x,</if>
+            <if test="positionY != null">position_y,</if>
+            <if test="positionZ != null">position_z,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="zoneCode != null and zoneCode != ''">#{zoneCode},</if>
+            <if test="zoneName != null and zoneName != ''">#{zoneName},</if>
+            <if test="zoneType != null and zoneType != ''">#{zoneType},</if>
+            <if test="buildingName != null and buildingName != ''">#{buildingName},</if>
+            <if test="floorName != null and floorName != ''">#{floorName},</if>
+            <if test="spaceLocation != null and spaceLocation != ''">#{spaceLocation},</if>
+            <if test="deviceCount != null">#{deviceCount},</if>
+            <if test="volume != null">#{volume},</if>
+            <if test="isMute != null">#{isMute},</if>
+            <if test="isOnline != null">#{isOnline},</if>
+            <if test="broadcastStatus != null">#{broadcastStatus},</if>
+            <if test="currentContent != null and currentContent != ''">#{currentContent},</if>
+            <if test="contentCode != null and contentCode != ''">#{contentCode},</if>
+            <if test="priority != null">#{priority},</if>
+            <if test="positionX != null">#{positionX},</if>
+            <if test="positionY != null">#{positionY},</if>
+            <if test="positionZ != null">#{positionZ},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateIbmsBroadcastZone" parameterType="pd">
+        update ibms_broadcast_zone
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="zoneCode != null and zoneCode != ''">zone_code = #{zoneCode},</if>
+            <if test="zoneName != null and zoneName != ''">zone_name = #{zoneName},</if>
+            <if test="zoneType != null and zoneType != ''">zone_type = #{zoneType},</if>
+            <if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
+            <if test="floorName != null and floorName != ''">floor_name = #{floorName},</if>
+            <if test="spaceLocation != null and spaceLocation != ''">space_location = #{spaceLocation},</if>
+            <if test="deviceCount != null">device_count = #{deviceCount},</if>
+            <if test="volume != null">volume = #{volume},</if>
+            <if test="isMute != null">is_mute = #{isMute},</if>
+            <if test="isOnline != null">is_online = #{isOnline},</if>
+            <if test="broadcastStatus != null">broadcast_status = #{broadcastStatus},</if>
+            <if test="currentContent != null">current_content = #{currentContent},</if>
+            <if test="contentCode != null">content_code = #{contentCode},</if>
+            <if test="priority != null">priority = #{priority},</if>
+            <if test="positionX != null">position_x = #{positionX},</if>
+            <if test="positionY != null">position_y = #{positionY},</if>
+            <if test="positionZ != null">position_z = #{positionZ},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <!-- 更新音量和静音状态 -->
+    <update id="updateZoneVolume" parameterType="pd">
+        update ibms_broadcast_zone
+        set volume = #{volume},
+            is_mute = #{isMute},
+            update_time = #{updateTime}
+        where id = #{id}
+    </update>
+
+    <!-- 更新广播状态 -->
+    <update id="updateBroadcastStatus" parameterType="pd">
+        update ibms_broadcast_zone
+        set broadcast_status = #{broadcastStatus},
+            current_content = #{currentContent},
+            content_code = #{contentCode},
+            update_time = #{updateTime}
+        where id = #{id}
+    </update>
+
+    <delete id="deleteIbmsBroadcastZoneById" parameterType="Long">
+        delete from ibms_broadcast_zone where id = #{id}
+    </delete>
+
+    <delete id="deleteIbmsBroadcastZoneByIds" parameterType="String">
+        delete from ibms_broadcast_zone where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>
+
+
+

+ 1 - 1
pm_ui/src/views/device/waring/index2.vue

@@ -504,7 +504,7 @@ function submitOrder() {
 // 查看详情
 function handleDetail(row) {
   getAlarmDetail(row.id).then(response => {
-    currentAlarm.value = response.data
+    currentAlarm.value = response.data.data
     alarmLogs.value = response.logs || []
     detailVisible.value = true
   })