From 1e7df355faa4b89c18360a7b9ccae6f855a50c47 Mon Sep 17 00:00:00 2001 From: 15666619788 <11841994@qq.com> Date: Sat, 2 Aug 2025 17:05:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=91=8A=E8=AD=A6=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=20=20=E6=96=B0=E5=A2=9E=E5=85=AC=E5=85=B1=E6=A1=A3?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/tool/TestController2.java | 4 +- .../com/xinda/mq/ruleEngine/SceneContext.java | 10 +- .../data/controller/AlertLogController.java | 8 +- .../data/controller/PubDocController.java | 110 ++++++++++++++++++ .../xinda/data/service/impl/DeviceJob.java | 4 +- .../java/com/xinda/iot/domain/AlertLog.java | 15 +-- .../java/com/xinda/iot/domain/PubDoc.java | 56 +++++++++ .../com/xinda/iot/mapper/PubDocMapper.java | 61 ++++++++++ .../com/xinda/iot/model/AlertSceneSendVO.java | 2 +- .../xinda/iot/service/IAlertLogService.java | 2 +- .../com/xinda/iot/service/IPubDocService.java | 61 ++++++++++ .../iot/service/impl/AlertLogServiceImpl.java | 4 +- .../iot/service/impl/PubDocServiceImpl.java | 96 +++++++++++++++ .../resources/mapper/iot/PubDocMapper.xml | 97 +++++++++++++++ 14 files changed, 506 insertions(+), 24 deletions(-) create mode 100644 xinda-open-api/src/main/java/com/xinda/data/controller/PubDocController.java create mode 100644 xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/domain/PubDoc.java create mode 100644 xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/mapper/PubDocMapper.java create mode 100644 xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/IPubDocService.java create mode 100644 xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/impl/PubDocServiceImpl.java create mode 100644 xinda-service/xinda-iot-service/src/main/resources/mapper/iot/PubDocMapper.xml diff --git a/xinda-admin/src/main/java/com/xinda/web/controller/tool/TestController2.java b/xinda-admin/src/main/java/com/xinda/web/controller/tool/TestController2.java index defd7c9..da1f1e6 100644 --- a/xinda-admin/src/main/java/com/xinda/web/controller/tool/TestController2.java +++ b/xinda-admin/src/main/java/com/xinda/web/controller/tool/TestController2.java @@ -61,8 +61,8 @@ public class TestController2 { AlertLog alertLog = new AlertLog(); alertLog.setSerialNumber(deviceNumber); alertLog.setAlertName("温度告警测试"); - alertLog.setAlertLevel(1L); - alertLog.setStatus(1); + alertLog.setAlertLevel("1"); + alertLog.setStatus("1"); alertLog.setProductId(1L); alertLog.setDetail("111"); alertLog.setCreateTime(new Date()); diff --git a/xinda-gateway/xinda-mq/src/main/java/com/xinda/mq/ruleEngine/SceneContext.java b/xinda-gateway/xinda-mq/src/main/java/com/xinda/mq/ruleEngine/SceneContext.java index 757ed67..41dda72 100644 --- a/xinda-gateway/xinda-mq/src/main/java/com/xinda/mq/ruleEngine/SceneContext.java +++ b/xinda-gateway/xinda-mq/src/main/java/com/xinda/mq/ruleEngine/SceneContext.java @@ -392,7 +392,7 @@ public class SceneContext { private boolean checkDeviceAlerting(Long sceneId, String deviceNum) { AlertLog alertLog = new AlertLog(); alertLog.setSerialNumber(deviceNum); - alertLog.setStatus(2); + alertLog.setStatus("2"); alertLog.setCreateBy(sceneId.toString()); Long count = alertLogService.selectSceneAlertLogListCount(alertLog); // 查询设备告警对应的场景是否有未处理告警 @@ -437,7 +437,7 @@ public class SceneContext { AlertLog alertLog = new AlertLog(); alertLog.setCreateBy(scriptTemplate.getRecoverId().toString()); alertLog.setSerialNumber(deviceNum); - alertLog.setStatus(2); + alertLog.setStatus("2"); //自动设置告警处理状态 alertLogService.updateAlertLogStatus(alertLog); //如果存在延时确认任务,则删除 @@ -529,14 +529,14 @@ public class SceneContext { private AlertLog getTerminalUserAlertLog(SceneTerminalUserVO sceneTerminalUserVO, Device device, SceneThingsModelItem sceneThingsModelItem) { AlertLog alertLog = new AlertLog(); alertLog.setAlertName("设备告警"); - alertLog.setAlertLevel(1L); + alertLog.setAlertLevel("1"); alertLog.setSerialNumber(sceneThingsModelItem.getDeviceNumber()); alertLog.setProductId(sceneThingsModelItem.getProductId()); alertLog.setDeviceName(device.getDeviceName()); alertLog.setUserId(sceneTerminalUserVO.getUserId()); alertLog.setCreateBy(sceneThingsModelItem.getSceneId().toString()); // 统一未处理 - alertLog.setStatus(2); + alertLog.setStatus("2"); JSONObject jsonObject = new JSONObject(); jsonObject.put("id", sceneThingsModelItem.getId()); jsonObject.put("value", sceneThingsModelItem.getValue()); @@ -564,7 +564,7 @@ public class SceneContext { alertLog.setUserId(device.getTenantId()); alertLog.setCreateBy(sceneThingsModelItem.getSceneId().toString()); // 统一未处理 - alertLog.setStatus(2); + alertLog.setStatus("2"); JSONObject jsonObject = new JSONObject(); jsonObject.put("id", sceneThingsModelItem.getId()); jsonObject.put("value", sceneThingsModelItem.getValue()); diff --git a/xinda-open-api/src/main/java/com/xinda/data/controller/AlertLogController.java b/xinda-open-api/src/main/java/com/xinda/data/controller/AlertLogController.java index 14fcc66..3332b38 100644 --- a/xinda-open-api/src/main/java/com/xinda/data/controller/AlertLogController.java +++ b/xinda-open-api/src/main/java/com/xinda/data/controller/AlertLogController.java @@ -73,17 +73,17 @@ public class AlertLogController extends BaseController { Map map = new HashMap<>(); AlertLog alertLog = new AlertLog(); - alertLog.setStatus(2); + alertLog.setStatus("2"); List list = alertLogService.selectAlertLogList(alertLog); //1=提醒通知,2=轻微问题,3=严重警告 List tlist =list.stream() - .filter(log -> log.getAlertLevel() == 1) + .filter(log -> log.getAlertLevel() == "1") .collect(Collectors.toList()); List qlist =list.stream() - .filter(log -> log.getAlertLevel() == 2) + .filter(log -> log.getAlertLevel() == "2") .collect(Collectors.toList()); List ylist =list.stream() - .filter(log -> log.getAlertLevel() == 3) + .filter(log -> log.getAlertLevel() == "3") .collect(Collectors.toList()); map.put("tx",tlist.size()); map.put("qw",qlist.size()); diff --git a/xinda-open-api/src/main/java/com/xinda/data/controller/PubDocController.java b/xinda-open-api/src/main/java/com/xinda/data/controller/PubDocController.java new file mode 100644 index 0000000..add08a0 --- /dev/null +++ b/xinda-open-api/src/main/java/com/xinda/data/controller/PubDocController.java @@ -0,0 +1,110 @@ +package com.xinda.data.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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.xinda.common.annotation.Log; +import com.xinda.common.core.controller.BaseController; +import com.xinda.common.core.domain.AjaxResult; +import com.xinda.common.enums.BusinessType; +import com.xinda.iot.domain.PubDoc; +import com.xinda.iot.service.IPubDocService; +import com.xinda.common.utils.poi.ExcelUtil; +import com.xinda.common.core.page.TableDataInfo; + +/** + * 公共档案Controller + * + * @author kerwincui + * @date 2025-08-02 + */ +@RestController +@RequestMapping("/iot/pubDoc") +@Api(tags = "公共档案") +public class PubDocController extends BaseController +{ + @Autowired + private IPubDocService pubDocService; + +/** + * 查询公共档案列表 + */ +@PreAuthorize("@ss.hasPermi('iot:pubDoc:list')") +@GetMapping("/list") +@ApiOperation("查询公共档案列表") + public TableDataInfo list(PubDoc pubDoc) + { + startPage(); + List list = pubDocService.selectPubDocList(pubDoc); + return getDataTable(list); + } + + /** + * 导出公共档案列表 + */ + @ApiOperation("导出公共档案列表") + @PreAuthorize("@ss.hasPermi('iot:pubDoc:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, PubDoc pubDoc) + { + List list = pubDocService.selectPubDocList(pubDoc); + ExcelUtil util = new ExcelUtil(PubDoc.class); + util.exportExcel(response, list, "公共档案数据"); + } + + /** + * 获取公共档案详细信息 + */ + @PreAuthorize("@ss.hasPermi('iot:pubDoc:query')") + @GetMapping(value = "/{id}") + @ApiOperation("获取公共档案详细信息") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(pubDocService.selectPubDocById(id)); + } + + /** + * 新增公共档案 + */ + @PreAuthorize("@ss.hasPermi('iot:pubDoc:add')") + @PostMapping + @ApiOperation("新增公共档案") + public AjaxResult add(@RequestBody PubDoc pubDoc) + { + return toAjax(pubDocService.insertPubDoc(pubDoc)); + } + + /** + * 修改公共档案 + */ + @PreAuthorize("@ss.hasPermi('iot:pubDoc:edit')") + @PutMapping + @ApiOperation("修改公共档案") + public AjaxResult edit(@RequestBody PubDoc pubDoc) + { + return toAjax(pubDocService.updatePubDoc(pubDoc)); + } + + /** + * 删除公共档案 + */ + @PreAuthorize("@ss.hasPermi('iot:pubDoc:remove')") + @DeleteMapping("/{ids}") + @ApiOperation("删除公共档案") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(pubDocService.deletePubDocByIds(ids)); + } +} diff --git a/xinda-open-api/src/main/java/com/xinda/data/service/impl/DeviceJob.java b/xinda-open-api/src/main/java/com/xinda/data/service/impl/DeviceJob.java index 85ba4e4..7598869 100644 --- a/xinda-open-api/src/main/java/com/xinda/data/service/impl/DeviceJob.java +++ b/xinda-open-api/src/main/java/com/xinda/data/service/impl/DeviceJob.java @@ -166,7 +166,7 @@ public class DeviceJob { alertPushParams.setNotifyTemplateId(alertNotifyTemplate.getNotifyTemplateId()); notifySendService.alertSend(alertPushParams); } - List alist = alertLogService.selectAlertLogListByCreateBy(alertlog.getSceneId().toString(), alertlog.getId(), 2); + List alist = alertLogService.selectAlertLogListByCreateBy(alertlog.getSceneId().toString(), alertlog.getId(), "2"); if (alist.isEmpty()) { AlertLog alertLog = buildAlertLog(alertSceneSendVO, device, alertlog); alertLogList.add(alertLog); @@ -190,7 +190,7 @@ public class DeviceJob { alertLog.setProductId(device.getProductId()); alertLog.setDeviceName(device.getDeviceName()); alertLog.setUserId(device.getTenantId()); - alertLog.setStatus(2); + alertLog.setStatus("2"); JSONObject jsonObject = new JSONObject(); jsonObject.put("id", Item.getId()); diff --git a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/domain/AlertLog.java b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/domain/AlertLog.java index 13260e8..33fac27 100644 --- a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/domain/AlertLog.java +++ b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/domain/AlertLog.java @@ -27,7 +27,8 @@ public class AlertLog extends BaseEntity /** 告警ID */ @ApiModelProperty("告警ID") private Long alertLogId; - + @Excel(name = "设备名称") + private String deviceName; /** 告警名称 */ @ApiModelProperty("告警名称") @Excel(name = "告警名称") @@ -35,17 +36,17 @@ public class AlertLog extends BaseEntity /** 告警级别(1=提醒通知,2=轻微问题,3=严重警告,4=场景联动) */ @ApiModelProperty("告警级别(1=提醒通知,2=轻微问题,3=严重警告,4=场景联动)") - @Excel(name = "告警级别", readConverterExp = "1==提醒通知,2=轻微问题,3=严重警告,4=场景联动") - private Long alertLevel; + @Excel(name = "告警级别", readConverterExp = "1=提醒通知,2=轻微问题,3=严重警告,4=场景联动") + private String alertLevel; /** 处理状态(1=不需要处理,2=未处理,3=已处理) */ @ApiModelProperty("处理状态(1=不需要处理,2=未处理,3=已处理)") - @Excel(name = "处理状态(1=不需要处理,2=未处理,3=已处理)") - private Integer status; + @Excel(name = "处理状态", readConverterExp ="1=不需要处理,2=未处理,3=已处理)") + private String status; /** 产品ID */ @ApiModelProperty("产品ID") - @Excel(name = "产品ID") +// @Excel(name = "产品ID") private Long productId; /** 设备编号 */ @@ -62,7 +63,7 @@ public class AlertLog extends BaseEntity private Long orderId; private RepairOrder order; - private String deviceName; + private Long deviceId; private Long sceneId; diff --git a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/domain/PubDoc.java b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/domain/PubDoc.java new file mode 100644 index 0000000..3a41a20 --- /dev/null +++ b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/domain/PubDoc.java @@ -0,0 +1,56 @@ +package com.xinda.iot.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.xinda.common.annotation.Excel; +import com.xinda.common.core.domain.BaseEntity; + +/** + * 公共档案对象 iot_pub_doc + * + * @author kerwincui + * @date 2025-08-02 + */ +@ApiModel(value = "PubDoc",description = "公共档案 iot_pub_doc") +@Data +public class PubDoc extends BaseEntity + { +private static final long serialVersionUID = 1L; + + /** id唯一标识 */ + private Long id; + + /** 机构id */ + @Excel(name = "机构id") + @ApiModelProperty("机构id") + private Long deptId; + + /** 机构名称 */ + @Excel(name = "机构名称") + @ApiModelProperty("机构名称") + private String deptName; + + /** 文件名称 */ + @Excel(name = "文件名称") + @ApiModelProperty("文件名称") + private String fileName; + + /** 资源请求路径 */ + @Excel(name = "资源请求路径") + @ApiModelProperty("资源请求路径") + private String resourceUrl; + + /** 租户id */ + @Excel(name = "租户id") + @ApiModelProperty("租户id") + private Long tenantId; + + /** 租户名称 */ + @Excel(name = "租户名称") + @ApiModelProperty("租户名称") + private String tenantName; + +} diff --git a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/mapper/PubDocMapper.java b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/mapper/PubDocMapper.java new file mode 100644 index 0000000..fc19274 --- /dev/null +++ b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/mapper/PubDocMapper.java @@ -0,0 +1,61 @@ +package com.xinda.iot.mapper; + +import java.util.List; +import com.xinda.iot.domain.PubDoc; + +/** + * 公共档案Mapper接口 + * + * @author kerwincui + * @date 2025-08-02 + */ +public interface PubDocMapper +{ + /** + * 查询公共档案 + * + * @param id 公共档案主键 + * @return 公共档案 + */ + public PubDoc selectPubDocById(Long id); + + /** + * 查询公共档案列表 + * + * @param pubDoc 公共档案 + * @return 公共档案集合 + */ + public List selectPubDocList(PubDoc pubDoc); + + /** + * 新增公共档案 + * + * @param pubDoc 公共档案 + * @return 结果 + */ + public int insertPubDoc(PubDoc pubDoc); + + /** + * 修改公共档案 + * + * @param pubDoc 公共档案 + * @return 结果 + */ + public int updatePubDoc(PubDoc pubDoc); + + /** + * 删除公共档案 + * + * @param id 公共档案主键 + * @return 结果 + */ + public int deletePubDocById(Long id); + + /** + * 批量删除公共档案 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePubDocByIds(Long[] ids); +} diff --git a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/model/AlertSceneSendVO.java b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/model/AlertSceneSendVO.java index 6ac138a..cab8033 100644 --- a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/model/AlertSceneSendVO.java +++ b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/model/AlertSceneSendVO.java @@ -29,7 +29,7 @@ public class AlertSceneSendVO { /** * 告警级别(1=提醒通知,2=轻微问题,3=严重警告) */ - private Long alertLevel; + private String alertLevel; } diff --git a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/IAlertLogService.java b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/IAlertLogService.java index 4538b15..5e967bd 100644 --- a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/IAlertLogService.java +++ b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/IAlertLogService.java @@ -30,7 +30,7 @@ public interface IAlertLogService * @return 设备告警集合 */ public List selectAlertLogList(AlertLog alertLog); - public List selectAlertLogListByCreateBy(String createBy, String remark, Integer status); + public List selectAlertLogListByCreateBy(String createBy, String remark, String status); /** * 查询设备告警列表总数 * diff --git a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/IPubDocService.java b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/IPubDocService.java new file mode 100644 index 0000000..72de39e --- /dev/null +++ b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/IPubDocService.java @@ -0,0 +1,61 @@ +package com.xinda.iot.service; + +import java.util.List; +import com.xinda.iot.domain.PubDoc; + +/** + * 公共档案Service接口 + * + * @author kerwincui + * @date 2025-08-02 + */ +public interface IPubDocService +{ + /** + * 查询公共档案 + * + * @param id 公共档案主键 + * @return 公共档案 + */ + public PubDoc selectPubDocById(Long id); + + /** + * 查询公共档案列表 + * + * @param pubDoc 公共档案 + * @return 公共档案集合 + */ + public List selectPubDocList(PubDoc pubDoc); + + /** + * 新增公共档案 + * + * @param pubDoc 公共档案 + * @return 结果 + */ + public int insertPubDoc(PubDoc pubDoc); + + /** + * 修改公共档案 + * + * @param pubDoc 公共档案 + * @return 结果 + */ + public int updatePubDoc(PubDoc pubDoc); + + /** + * 批量删除公共档案 + * + * @param ids 需要删除的公共档案主键集合 + * @return 结果 + */ + public int deletePubDocByIds(Long[] ids); + + /** + * 删除公共档案信息 + * + * @param id 公共档案主键 + * @return 结果 + */ + public int deletePubDocById(Long id); +} diff --git a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/impl/AlertLogServiceImpl.java b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/impl/AlertLogServiceImpl.java index 05e05b0..ed40aaf 100644 --- a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/impl/AlertLogServiceImpl.java +++ b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/impl/AlertLogServiceImpl.java @@ -92,7 +92,7 @@ public class AlertLogServiceImpl implements IAlertLogService { } @Override - public List selectAlertLogListByCreateBy(String createBy, String remark, Integer status) { + public List selectAlertLogListByCreateBy(String createBy, String remark, String status) { AlertLog alertLog = new AlertLog(); alertLog.setCreateBy(createBy); alertLog.setStatus(status); @@ -187,7 +187,7 @@ public class AlertLogServiceImpl implements IAlertLogService { alertLog.setUpdateTime(DateUtils.getNowDate()); if (alertLog.getRemark().length() > 0) { // 1=不需要处理,2=未处理,3=已处理 - alertLog.setStatus(3); + alertLog.setStatus("3"); } if (alertLog.getEnable()==1) { RepairOrder order = alertLog.getOrder(); diff --git a/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/impl/PubDocServiceImpl.java b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/impl/PubDocServiceImpl.java new file mode 100644 index 0000000..4803407 --- /dev/null +++ b/xinda-service/xinda-iot-service/src/main/java/com/xinda/iot/service/impl/PubDocServiceImpl.java @@ -0,0 +1,96 @@ +package com.xinda.iot.service.impl; + +import java.util.List; +import com.xinda.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.xinda.iot.mapper.PubDocMapper; +import com.xinda.iot.domain.PubDoc; +import com.xinda.iot.service.IPubDocService; + +/** + * 公共档案Service业务层处理 + * + * @author kerwincui + * @date 2025-08-02 + */ +@Service +public class PubDocServiceImpl implements IPubDocService +{ + @Autowired + private PubDocMapper pubDocMapper; + + /** + * 查询公共档案 + * + * @param id 公共档案主键 + * @return 公共档案 + */ + @Override + public PubDoc selectPubDocById(Long id) + { + return pubDocMapper.selectPubDocById(id); + } + + /** + * 查询公共档案列表 + * + * @param pubDoc 公共档案 + * @return 公共档案 + */ + @Override + public List selectPubDocList(PubDoc pubDoc) + { + return pubDocMapper.selectPubDocList(pubDoc); + } + + /** + * 新增公共档案 + * + * @param pubDoc 公共档案 + * @return 结果 + */ + @Override + public int insertPubDoc(PubDoc pubDoc) + { + pubDoc.setCreateTime(DateUtils.getNowDate()); + return pubDocMapper.insertPubDoc(pubDoc); + } + + /** + * 修改公共档案 + * + * @param pubDoc 公共档案 + * @return 结果 + */ + @Override + public int updatePubDoc(PubDoc pubDoc) + { + pubDoc.setUpdateTime(DateUtils.getNowDate()); + return pubDocMapper.updatePubDoc(pubDoc); + } + + /** + * 批量删除公共档案 + * + * @param ids 需要删除的公共档案主键 + * @return 结果 + */ + @Override + public int deletePubDocByIds(Long[] ids) + { + return pubDocMapper.deletePubDocByIds(ids); + } + + /** + * 删除公共档案信息 + * + * @param id 公共档案主键 + * @return 结果 + */ + @Override + public int deletePubDocById(Long id) + { + return pubDocMapper.deletePubDocById(id); + } +} diff --git a/xinda-service/xinda-iot-service/src/main/resources/mapper/iot/PubDocMapper.xml b/xinda-service/xinda-iot-service/src/main/resources/mapper/iot/PubDocMapper.xml new file mode 100644 index 0000000..ed205cf --- /dev/null +++ b/xinda-service/xinda-iot-service/src/main/resources/mapper/iot/PubDocMapper.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + select id, dept_id, dept_name, file_name, resource_url, tenant_id, tenant_name, create_by, create_time, update_by, update_time from iot_pub_doc + + + + + + + + insert into iot_pub_doc + + dept_id, + dept_name, + file_name, + resource_url, + tenant_id, + tenant_name, + create_by, + create_time, + update_by, + update_time, + + + #{deptId}, + #{deptName}, + #{fileName}, + #{resourceUrl}, + #{tenantId}, + #{tenantName}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update iot_pub_doc + + dept_id = #{deptId}, + dept_name = #{deptName}, + file_name = #{fileName}, + resource_url = #{resourceUrl}, + tenant_id = #{tenantId}, + tenant_name = #{tenantName}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from iot_pub_doc where id = #{id} + + + + delete from iot_pub_doc where id in + + #{id} + + + \ No newline at end of file