Jelajahi Sumber

血滤提交

Tong 3 tahun lalu
induk
melakukan
2a9440885a
36 mengubah file dengan 2398 tambahan dan 52 penghapusan
  1. 6 6
      pom.xml
  2. 4 4
      ruoyi-admin/src/main/resources/application.yml
  3. 2 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
  4. 104 0
      ruoyi-system/src/main/java/com/ruoyi/system/controller/BusDeviceNewsController.java
  5. 23 13
      ruoyi-system/src/main/java/com/ruoyi/system/controller/BusDeviceRunningController.java
  6. 104 0
      ruoyi-system/src/main/java/com/ruoyi/system/controller/DeviceMaintenanceController.java
  7. 104 0
      ruoyi-system/src/main/java/com/ruoyi/system/controller/DeviceUpkeepController.java
  8. 497 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/BusDeviceNews.java
  9. 27 13
      ruoyi-system/src/main/java/com/ruoyi/system/domain/BusDeviceRunning.java
  10. 111 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/DeviceMaintenance.java
  11. 111 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/DeviceUpkeep.java
  12. 14 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/BloodPressure.java
  13. 15 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/CurrentValue.java
  14. 41 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DeviceBody.java
  15. 11 7
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DeviceHeader.java
  16. 24 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DeviceRunningDto.java
  17. 12 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DialysisParam.java
  18. 11 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/UfParam.java
  19. 8 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/BusDeviceHistoryMapper.java
  20. 61 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/BusDeviceNewsMapper.java
  21. 61 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/DeviceMaintenanceMapper.java
  22. 61 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/DeviceUpkeepMapper.java
  23. 61 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IBusDeviceNewsService.java
  24. 2 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/IBusDeviceRunningService.java
  25. 61 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IDeviceMaintenanceService.java
  26. 61 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IDeviceUpkeepService.java
  27. 7 5
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BusDeviceHistoryServiceImpl.java
  28. 93 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BusDeviceNewsServiceImpl.java
  29. 87 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BusDeviceRunningServiceImpl.java
  30. 96 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DeviceMaintenanceServiceImpl.java
  31. 96 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DeviceUpkeepServiceImpl.java
  32. 6 0
      ruoyi-system/src/main/resources/mapper/system/BusDeviceHistoryMapper.xml
  33. 215 0
      ruoyi-system/src/main/resources/mapper/system/BusDeviceNewsMapper.xml
  34. 9 1
      ruoyi-system/src/main/resources/mapper/system/BusDeviceRunningMapper.xml
  35. 96 0
      ruoyi-system/src/main/resources/mapper/system/DeviceMaintenanceMapper.xml
  36. 96 0
      ruoyi-system/src/main/resources/mapper/system/DeviceUpkeepMapper.xml

+ 6 - 6
pom.xml

@@ -200,13 +200,13 @@
     <packaging>pom</packaging>
 
 
-    <dependencies>
+<!--    <dependencies>-->
 
-        <dependency>
-            <groupId>com.ruoyi</groupId>
-            <artifactId>ruoyi-common</artifactId>
-        </dependency>
-    </dependencies>
+<!--        <dependency>-->
+<!--            <groupId>com.ruoyi</groupId>-->
+<!--            <artifactId>ruoyi-common</artifactId>-->
+<!--        </dependency>-->
+<!--    </dependencies>-->
 
     <build>
         <plugins>

+ 4 - 4
ruoyi-admin/src/main/resources/application.yml

@@ -21,7 +21,7 @@ server:
   port: 8080
   servlet:
     # 应用的访问路径
-    context-path: /tuoren
+    context-path: /
   tomcat:
     # tomcat的URI编码
     uri-encoding: UTF-8
@@ -89,7 +89,7 @@ token:
     # 令牌密钥
     secret: abcdefghijklmnopqrstuvwxyz
     # 令牌有效期(默认30分钟)
-    expireTime: 30
+    expireTime: 300
   
 # MyBatis配置
 mybatis:
@@ -111,13 +111,13 @@ swagger:
   # 是否开启swagger
   enabled: true
   # 请求前缀
-  pathMapping: /dev-api
+  pathMapping: /tuoren
 
 # 防止XSS攻击
 xss: 
   # 过滤开关
   enabled: true
   # 排除链接(多个用逗号分隔)
-  excludes: /system/notice
+  excludes: /system/notice,/system/running/add
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*

+ 2 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -109,10 +109,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 // 过滤请求
                 .authorizeRequests()
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
-                .antMatchers("/login", "/register", "/captchaImage","/system/running/**").anonymous()
+                .antMatchers("/login", "/register", "/captchaImage").anonymous()
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
+                .antMatchers("/system/running/add").permitAll()
                 // 除上面外的所有请求全部需要鉴权认证
                 .anyRequest().authenticated()
                 .and()

+ 104 - 0
ruoyi-system/src/main/java/com/ruoyi/system/controller/BusDeviceNewsController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.system.controller;
+
+import java.util.List;
+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.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.BusDeviceNews;
+import com.ruoyi.system.service.IBusDeviceNewsService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * newsController
+ * 
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+@RestController
+@RequestMapping("/system/news")
+public class BusDeviceNewsController extends BaseController
+{
+    @Autowired
+    private IBusDeviceNewsService busDeviceNewsService;
+
+    /**
+     * 查询news列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:news:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BusDeviceNews busDeviceNews)
+    {
+        startPage();
+        List<BusDeviceNews> list = busDeviceNewsService.selectBusDeviceNewsList(busDeviceNews);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出news列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:news:export')")
+    @Log(title = "news", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BusDeviceNews busDeviceNews)
+    {
+        List<BusDeviceNews> list = busDeviceNewsService.selectBusDeviceNewsList(busDeviceNews);
+        ExcelUtil<BusDeviceNews> util = new ExcelUtil<BusDeviceNews>(BusDeviceNews.class);
+        util.exportExcel(response, list, "news数据");
+    }
+
+    /**
+     * 获取news详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:news:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(busDeviceNewsService.selectBusDeviceNewsById(id));
+    }
+
+    /**
+     * 新增news
+     */
+    @PreAuthorize("@ss.hasPermi('system:news:add')")
+    @Log(title = "news", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BusDeviceNews busDeviceNews)
+    {
+        return toAjax(busDeviceNewsService.insertBusDeviceNews(busDeviceNews));
+    }
+
+    /**
+     * 修改news
+     */
+    @PreAuthorize("@ss.hasPermi('system:news:edit')")
+    @Log(title = "news", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BusDeviceNews busDeviceNews)
+    {
+        return toAjax(busDeviceNewsService.updateBusDeviceNews(busDeviceNews));
+    }
+
+    /**
+     * 删除news
+     */
+    @PreAuthorize("@ss.hasPermi('system:news:remove')")
+    @Log(title = "news", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(busDeviceNewsService.deleteBusDeviceNewsByIds(ids));
+    }
+}

+ 23 - 13
ruoyi-system/src/main/java/com/ruoyi/system/controller/BusDeviceRunningController.java

@@ -3,10 +3,12 @@ package com.ruoyi.system.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.exception.GlobalException;
+import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.system.domain.dto.DeviceRunningDto;
 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;
@@ -42,7 +44,6 @@ public class BusDeviceRunningController extends BaseController
     /**
      * 查询运行状态列表
      */
-   // @PreAuthorize("@ss.hasPermi('system:running:list')")
     @GetMapping("/list")
     @ApiOperation("查询设备运行状态")
     public TableDataInfo list(BusDeviceRunning busDeviceRunning)
@@ -56,7 +57,6 @@ public class BusDeviceRunningController extends BaseController
     /**
      * 导出运行状态列表
      */
- //   @PreAuthorize("@ss.hasPermi('system:running:export')")
     @Log(title = "运行状态", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @ApiOperation("导出运行状态列表")
@@ -70,7 +70,6 @@ public class BusDeviceRunningController extends BaseController
     /**
      * 获取运行状态详细信息
      */
-    //@PreAuthorize("@ss.hasPermi('system:running:query')")
     @GetMapping(value = "/{id}")
     @ApiOperation("获取运行状态详细信息")
     public AjaxResult getInfo(@PathVariable("id") Long id)
@@ -81,20 +80,32 @@ public class BusDeviceRunningController extends BaseController
     /**
      * 新增运行状态
      */
- //   @PreAuthorize("@ss.hasPermi('system:running:add')")
-    @Log(title = "运行状态")
     @PostMapping("/add")
-    @ApiOperation("新增运行状态")
-    public AjaxResult add(@RequestBody DeviceRunningDto deviceRunningDto)
+    @ApiOperation("接收推送数据")
+    public AjaxResult add(@RequestBody DeviceRunningDto json)
     {
-
-        System.out.println(deviceRunningDto);
-        return toAjax(1==1);
+//        if(API_Key != null && API_Key.equals("TUORen_d78ab_f54d0_c04b4_50e1f_67818") ) {
+//            if (json.getHeader().getId() == null) {
+////                return toAjax(false);
+////            }
+////            BusDeviceRunning busDeviceRunning = new BusDeviceRunning();
+////            busDeviceRunning.setJson(json.toString());
+////            busDeviceRunning.setStatus("0");
+////            return toAjax(busDeviceRunningService.insertBusDeviceRunning(busDeviceRunning, json));
+//        }else{
+//            return toAjax(false);
+//        }
+            if (json.getHeader() == null || json.getHeader().getId() == null) {
+                throw new ServiceException("请确保传输数据存在header及设备ID");
+            }
+            BusDeviceRunning busDeviceRunning = new BusDeviceRunning();
+            busDeviceRunning.setJson(json.toString());
+            busDeviceRunning.setStatus("0");
+            return toAjax(busDeviceRunningService.insertBusDeviceRunning(busDeviceRunning, json));
     }
     /**
      * 修改运行状态
      */
-   // @PreAuthorize("@ss.hasPermi('system:running:edit')")
     @Log(title = "运行状态", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation("修改运行状态")
@@ -106,7 +117,6 @@ public class BusDeviceRunningController extends BaseController
     /**
      * 删除运行状态
      */
- //   @PreAuthorize("@ss.hasPermi('system:running:remove')")
     @Log(title = "运行状态", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     @ApiOperation("删除运行状态")

+ 104 - 0
ruoyi-system/src/main/java/com/ruoyi/system/controller/DeviceMaintenanceController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.system.controller;
+
+import java.util.List;
+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.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.DeviceMaintenance;
+import com.ruoyi.system.service.IDeviceMaintenanceService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 日常维护Controller
+ * 
+ * @author ruoyi
+ * @date 2022-06-24
+ */
+@RestController
+@RequestMapping("/system/maintenance")
+public class DeviceMaintenanceController extends BaseController
+{
+    @Autowired
+    private IDeviceMaintenanceService deviceMaintenanceService;
+
+    /**
+     * 查询日常维护列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:maintenance:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(DeviceMaintenance deviceMaintenance)
+    {
+        startPage();
+        List<DeviceMaintenance> list = deviceMaintenanceService.selectDeviceMaintenanceList(deviceMaintenance);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出日常维护列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:maintenance:export')")
+    @Log(title = "日常维护", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DeviceMaintenance deviceMaintenance)
+    {
+        List<DeviceMaintenance> list = deviceMaintenanceService.selectDeviceMaintenanceList(deviceMaintenance);
+        ExcelUtil<DeviceMaintenance> util = new ExcelUtil<DeviceMaintenance>(DeviceMaintenance.class);
+        util.exportExcel(response, list, "日常维护数据");
+    }
+
+    /**
+     * 获取日常维护详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:maintenance:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(deviceMaintenanceService.selectDeviceMaintenanceById(id));
+    }
+
+    /**
+     * 新增日常维护
+     */
+    @PreAuthorize("@ss.hasPermi('system:maintenance:add')")
+    @Log(title = "日常维护", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DeviceMaintenance deviceMaintenance)
+    {
+        return toAjax(deviceMaintenanceService.insertDeviceMaintenance(deviceMaintenance));
+    }
+
+    /**
+     * 修改日常维护
+     */
+    @PreAuthorize("@ss.hasPermi('system:maintenance:edit')")
+    @Log(title = "日常维护", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DeviceMaintenance deviceMaintenance)
+    {
+        return toAjax(deviceMaintenanceService.updateDeviceMaintenance(deviceMaintenance));
+    }
+
+    /**
+     * 删除日常维护
+     */
+    @PreAuthorize("@ss.hasPermi('system:maintenance:remove')")
+    @Log(title = "日常维护", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(deviceMaintenanceService.deleteDeviceMaintenanceByIds(ids));
+    }
+}

+ 104 - 0
ruoyi-system/src/main/java/com/ruoyi/system/controller/DeviceUpkeepController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.system.controller;
+
+import java.util.List;
+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.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.DeviceUpkeep;
+import com.ruoyi.system.service.IDeviceUpkeepService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 设备维保记录Controller
+ * 
+ * @author ruoyi
+ * @date 2022-06-27
+ */
+@RestController
+@RequestMapping("/system/upkeep")
+public class DeviceUpkeepController extends BaseController
+{
+    @Autowired
+    private IDeviceUpkeepService deviceUpkeepService;
+
+    /**
+     * 查询设备维保记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:upkeep:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(DeviceUpkeep deviceUpkeep)
+    {
+        startPage();
+        List<DeviceUpkeep> list = deviceUpkeepService.selectDeviceUpkeepList(deviceUpkeep);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出设备维保记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:upkeep:export')")
+    @Log(title = "设备维保记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DeviceUpkeep deviceUpkeep)
+    {
+        List<DeviceUpkeep> list = deviceUpkeepService.selectDeviceUpkeepList(deviceUpkeep);
+        ExcelUtil<DeviceUpkeep> util = new ExcelUtil<DeviceUpkeep>(DeviceUpkeep.class);
+        util.exportExcel(response, list, "设备维保记录数据");
+    }
+
+    /**
+     * 获取设备维保记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:upkeep:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(deviceUpkeepService.selectDeviceUpkeepById(id));
+    }
+
+    /**
+     * 新增设备维保记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:upkeep:add')")
+    @Log(title = "设备维保记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DeviceUpkeep deviceUpkeep)
+    {
+        return toAjax(deviceUpkeepService.insertDeviceUpkeep(deviceUpkeep));
+    }
+
+    /**
+     * 修改设备维保记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:upkeep:edit')")
+    @Log(title = "设备维保记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DeviceUpkeep deviceUpkeep)
+    {
+        return toAjax(deviceUpkeepService.updateDeviceUpkeep(deviceUpkeep));
+    }
+
+    /**
+     * 删除设备维保记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:upkeep:remove')")
+    @Log(title = "设备维保记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(deviceUpkeepService.deleteDeviceUpkeepByIds(ids));
+    }
+}

+ 497 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/BusDeviceNews.java

@@ -0,0 +1,497 @@
+package com.ruoyi.system.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;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * news对象 bus_device_news
+ * 
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+public class BusDeviceNews
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 设备id */
+    private Long deviceId;
+
+    /** 上传时间 */
+    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date time;
+
+    /** 当前运行状态 */
+    @Excel(name = "当前运行状态")
+    private String currentStatus;
+
+    /** 血压是否在开启状态 */
+    @Excel(name = "血压是否在开启状态")
+    private String bloodPressureOpemomh;
+
+    /** 血压定时测量 */
+    @Excel(name = "血压定时测量")
+    private String intervalMeasurement;
+
+    /** 收缩压 */
+    @Excel(name = "收缩压")
+    private String systolicPressure;
+
+    /** 舒张压 */
+    @Excel(name = "舒张压")
+    private String diastolicPressure;
+
+    /** 平均动脉压 */
+    @Excel(name = "平均动脉压")
+    private String theMap;
+
+    /** 脉搏 */
+    @Excel(name = "脉搏")
+    private String pulse;
+
+    /** 充气压力 */
+    @Excel(name = "充气压力")
+    private String inflationPressure;
+
+    /** 间隔时间 */
+    @Excel(name = "间隔时间")
+    private String intervalTime;
+
+    /** 基础钠 */
+    @Excel(name = "基础钠")
+    private String basicNa;
+
+    /** 处方钠 */
+    @Excel(name = "处方钠")
+    private String prescriptionNa;
+
+    /** 处方bic */
+    @Excel(name = "处方bic")
+    private String prescriptionBic;
+
+    /** 流量 */
+    @Excel(name = "流量")
+    private String dialysisFlow;
+
+    /** 设置温度 */
+    @Excel(name = "设置温度")
+    private String temperature;
+
+    /** 钠曲线 */
+    @Excel(name = "钠曲线")
+    private String naCurveId;
+
+    /** 超滤目标 */
+    @Excel(name = "超滤目标")
+    private String ufTarget;
+
+    /** 超滤时间 */
+    @Excel(name = "超滤时间")
+    private String ufTime;
+
+    /** 超滤速率 */
+    @Excel(name = "超滤速率")
+    private String ufRate;
+
+    /** 已超滤总量 */
+    @Excel(name = "已超滤总量")
+    private String ufVolume;
+
+    /** 超滤曲线 */
+    @Excel(name = "超滤曲线")
+    private String ufCurveId;
+
+    /** 动脉压 */
+    @Excel(name = "动脉压")
+    private String arterialPressure;
+
+    /** 静脉压 */
+    @Excel(name = "静脉压")
+    private String venousPressure;
+
+    /** 电导度 */
+    @Excel(name = "电导度")
+    private String conductivity;
+
+    /** 跨膜压 */
+    @Excel(name = "跨膜压")
+    private String transmembranePressure;
+
+    /** 温度 */
+    @Excel(name = "温度")
+    private String currentTemperature;
+
+    /** 已经透析血量 */
+    @Excel(name = "已经透析血量")
+    private String bloodVolumeDone;
+
+    /** 剩余透析时间 */
+    @Excel(name = "剩余透析时间")
+    private String timeRemain;
+
+    /** 已回血量 */
+    @Excel(name = "已回血量")
+    private String bloodVolumeReturn;
+
+    /** 血泵真实速度 */
+    @Excel(name = "血泵真实速度")
+    private String rateBpReal;
+
+    /** 透析ID */
+    @Excel(name = "透析ID")
+    private Long historyId;
+
+    private String createTime;
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setDeviceId(Long deviceId) 
+    {
+        this.deviceId = deviceId;
+    }
+
+    public Long getDeviceId() 
+    {
+        return deviceId;
+    }
+    public void setTime(Date time) 
+    {
+        this.time = time;
+    }
+
+    public Date getTime() 
+    {
+        return time;
+    }
+    public void setCurrentStatus(String currentStatus) 
+    {
+        this.currentStatus = currentStatus;
+    }
+
+    public String getCurrentStatus() 
+    {
+        return currentStatus;
+    }
+    public void setBloodPressureOpemomh(String bloodPressureOpemomh) 
+    {
+        this.bloodPressureOpemomh = bloodPressureOpemomh;
+    }
+
+    public String getBloodPressureOpemomh() 
+    {
+        return bloodPressureOpemomh;
+    }
+    public void setIntervalMeasurement(String intervalMeasurement) 
+    {
+        this.intervalMeasurement = intervalMeasurement;
+    }
+
+    public String getIntervalMeasurement() 
+    {
+        return intervalMeasurement;
+    }
+    public void setSystolicPressure(String systolicPressure) 
+    {
+        this.systolicPressure = systolicPressure;
+    }
+
+    public String getSystolicPressure() 
+    {
+        return systolicPressure;
+    }
+    public void setDiastolicPressure(String diastolicPressure) 
+    {
+        this.diastolicPressure = diastolicPressure;
+    }
+
+    public String getDiastolicPressure() 
+    {
+        return diastolicPressure;
+    }
+    public void setTheMap(String theMap) 
+    {
+        this.theMap = theMap;
+    }
+
+    public String getTheMap() 
+    {
+        return theMap;
+    }
+    public void setPulse(String pulse) 
+    {
+        this.pulse = pulse;
+    }
+
+    public String getPulse() 
+    {
+        return pulse;
+    }
+    public void setInflationPressure(String inflationPressure) 
+    {
+        this.inflationPressure = inflationPressure;
+    }
+
+    public String getInflationPressure() 
+    {
+        return inflationPressure;
+    }
+    public void setIntervalTime(String intervalTime) 
+    {
+        this.intervalTime = intervalTime;
+    }
+
+    public String getIntervalTime() 
+    {
+        return intervalTime;
+    }
+    public void setBasicNa(String basicNa) 
+    {
+        this.basicNa = basicNa;
+    }
+
+    public String getBasicNa() 
+    {
+        return basicNa;
+    }
+    public void setPrescriptionNa(String prescriptionNa) 
+    {
+        this.prescriptionNa = prescriptionNa;
+    }
+
+    public String getPrescriptionNa() 
+    {
+        return prescriptionNa;
+    }
+    public void setPrescriptionBic(String prescriptionBic) 
+    {
+        this.prescriptionBic = prescriptionBic;
+    }
+
+    public String getPrescriptionBic() 
+    {
+        return prescriptionBic;
+    }
+    public void setDialysisFlow(String dialysisFlow) 
+    {
+        this.dialysisFlow = dialysisFlow;
+    }
+
+    public String getDialysisFlow() 
+    {
+        return dialysisFlow;
+    }
+    public void setTemperature(String temperature) 
+    {
+        this.temperature = temperature;
+    }
+
+    public String getTemperature() 
+    {
+        return temperature;
+    }
+    public void setNaCurveId(String naCurveId) 
+    {
+        this.naCurveId = naCurveId;
+    }
+
+    public String getNaCurveId() 
+    {
+        return naCurveId;
+    }
+    public void setUfTarget(String ufTarget) 
+    {
+        this.ufTarget = ufTarget;
+    }
+
+    public String getUfTarget() 
+    {
+        return ufTarget;
+    }
+    public void setUfTime(String ufTime) 
+    {
+        this.ufTime = ufTime;
+    }
+
+    public String getUfTime() 
+    {
+        return ufTime;
+    }
+    public void setUfRate(String ufRate) 
+    {
+        this.ufRate = ufRate;
+    }
+
+    public String getUfRate() 
+    {
+        return ufRate;
+    }
+    public void setUfVolume(String ufVolume) 
+    {
+        this.ufVolume = ufVolume;
+    }
+
+    public String getUfVolume() 
+    {
+        return ufVolume;
+    }
+    public void setUfCurveId(String ufCurveId) 
+    {
+        this.ufCurveId = ufCurveId;
+    }
+
+    public String getUfCurveId() 
+    {
+        return ufCurveId;
+    }
+    public void setArterialPressure(String arterialPressure) 
+    {
+        this.arterialPressure = arterialPressure;
+    }
+
+    public String getArterialPressure() 
+    {
+        return arterialPressure;
+    }
+    public void setVenousPressure(String venousPressure) 
+    {
+        this.venousPressure = venousPressure;
+    }
+
+    public String getVenousPressure() 
+    {
+        return venousPressure;
+    }
+    public void setConductivity(String conductivity) 
+    {
+        this.conductivity = conductivity;
+    }
+
+    public String getConductivity() 
+    {
+        return conductivity;
+    }
+    public void setTransmembranePressure(String transmembranePressure) 
+    {
+        this.transmembranePressure = transmembranePressure;
+    }
+
+    public String getTransmembranePressure() 
+    {
+        return transmembranePressure;
+    }
+    public void setCurrentTemperature(String currentTemperature) 
+    {
+        this.currentTemperature = currentTemperature;
+    }
+
+    public String getCurrentTemperature() 
+    {
+        return currentTemperature;
+    }
+    public void setBloodVolumeDone(String bloodVolumeDone) 
+    {
+        this.bloodVolumeDone = bloodVolumeDone;
+    }
+
+    public String getBloodVolumeDone() 
+    {
+        return bloodVolumeDone;
+    }
+    public void setTimeRemain(String timeRemain) 
+    {
+        this.timeRemain = timeRemain;
+    }
+
+    public String getTimeRemain() 
+    {
+        return timeRemain;
+    }
+    public void setBloodVolumeReturn(String bloodVolumeReturn) 
+    {
+        this.bloodVolumeReturn = bloodVolumeReturn;
+    }
+
+    public String getBloodVolumeReturn() 
+    {
+        return bloodVolumeReturn;
+    }
+    public void setRateBpReal(String rateBpReal) 
+    {
+        this.rateBpReal = rateBpReal;
+    }
+
+    public String getRateBpReal() 
+    {
+        return rateBpReal;
+    }
+    public void setHistoryId(Long historyId) 
+    {
+        this.historyId = historyId;
+    }
+
+    public Long getHistoryId() 
+    {
+        return historyId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("deviceId", getDeviceId())
+            .append("time", getTime())
+            .append("currentStatus", getCurrentStatus())
+            .append("bloodPressureOpemomh", getBloodPressureOpemomh())
+            .append("intervalMeasurement", getIntervalMeasurement())
+            .append("systolicPressure", getSystolicPressure())
+            .append("diastolicPressure", getDiastolicPressure())
+            .append("theMap", getTheMap())
+            .append("pulse", getPulse())
+            .append("inflationPressure", getInflationPressure())
+            .append("intervalTime", getIntervalTime())
+            .append("basicNa", getBasicNa())
+            .append("prescriptionNa", getPrescriptionNa())
+            .append("prescriptionBic", getPrescriptionBic())
+            .append("dialysisFlow", getDialysisFlow())
+            .append("temperature", getTemperature())
+            .append("naCurveId", getNaCurveId())
+            .append("ufTarget", getUfTarget())
+            .append("ufTime", getUfTime())
+            .append("ufRate", getUfRate())
+            .append("ufVolume", getUfVolume())
+            .append("ufCurveId", getUfCurveId())
+            .append("arterialPressure", getArterialPressure())
+            .append("venousPressure", getVenousPressure())
+            .append("conductivity", getConductivity())
+            .append("transmembranePressure", getTransmembranePressure())
+            .append("currentTemperature", getCurrentTemperature())
+            .append("bloodVolumeDone", getBloodVolumeDone())
+            .append("timeRemain", getTimeRemain())
+            .append("bloodVolumeReturn", getBloodVolumeReturn())
+            .append("rateBpReal", getRateBpReal())
+            .append("historyId", getHistoryId())
+            .toString();
+    }
+}

+ 27 - 13
ruoyi-system/src/main/java/com/ruoyi/system/domain/BusDeviceRunning.java

@@ -3,7 +3,6 @@ package com.ruoyi.system.domain;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
-import com.ruoyi.common.core.domain.BaseEntity;
 
 import java.io.Serializable;
 
@@ -24,30 +23,45 @@ public class BusDeviceRunning implements Serializable
     @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
     private String json;
 
-    public void setId(Long id) 
-    {
-        this.id = id;
+    private String status;
+
+    private String createTime;
+
+    public String getCreateTime() {
+        return createTime;
     }
 
-    public Long getId() 
-    {
-        return id;
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
     }
-    public void setJson(String json) 
-    {
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public void setJson(String json) {
         this.json = json;
     }
 
-    public String getJson() 
-    {
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getJson() {
         return json;
     }
 
+    public String getStatus() {
+        return status;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("json", getJson())
             .toString();
     }
 }

+ 111 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/DeviceMaintenance.java

@@ -0,0 +1,111 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 日常维护对象 device_maintenance
+ * 
+ * @author ruoyi
+ * @date 2022-06-24
+ */
+public class DeviceMaintenance extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 设备ID */
+    private Long dId;
+
+    /** 维护人 */
+    @Excel(name = "维护人")
+    private String maintenanceUser;
+
+    /** 清洗时间 */
+    @Excel(name = "清洗时间")
+    private String cleaningTime;
+
+    /** 清洗类型 */
+    @Excel(name = "清洗类型")
+    private String cleaningType;
+
+    /** 其他维护操作 */
+    @Excel(name = "其他维护操作")
+    private String cleaningOther;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setdId(Long dId) 
+    {
+        this.dId = dId;
+    }
+
+    public Long getdId() 
+    {
+        return dId;
+    }
+    public void setMaintenanceUser(String maintenanceUser) 
+    {
+        this.maintenanceUser = maintenanceUser;
+    }
+
+    public String getMaintenanceUser() 
+    {
+        return maintenanceUser;
+    }
+    public void setCleaningTime(String cleaningTime) 
+    {
+        this.cleaningTime = cleaningTime;
+    }
+
+    public String getCleaningTime() 
+    {
+        return cleaningTime;
+    }
+    public void setCleaningType(String cleaningType) 
+    {
+        this.cleaningType = cleaningType;
+    }
+
+    public String getCleaningType() 
+    {
+        return cleaningType;
+    }
+    public void setCleaningOther(String cleaningOther) 
+    {
+        this.cleaningOther = cleaningOther;
+    }
+
+    public String getCleaningOther() 
+    {
+        return cleaningOther;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("dId", getdId())
+            .append("maintenanceUser", getMaintenanceUser())
+            .append("cleaningTime", getCleaningTime())
+            .append("cleaningType", getCleaningType())
+            .append("cleaningOther", getCleaningOther())
+            .append("remark", getRemark())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 111 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/DeviceUpkeep.java

@@ -0,0 +1,111 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 设备维保记录对象 device_upkeep
+ * 
+ * @author ruoyi
+ * @date 2022-06-27
+ */
+public class DeviceUpkeep extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 设备ID */
+    private Long dId;
+
+    /** 保养人 */
+    @Excel(name = "保养人")
+    private String upkeepUser;
+
+    /** 维保时间 */
+    @Excel(name = "维保时间")
+    private String upkeepTime;
+
+    /** 维保类型 */
+    @Excel(name = "维保类型")
+    private String upkeepType;
+
+    /** 维保操作内容 */
+    @Excel(name = "维保操作内容")
+    private String upkeepContent;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setdId(Long dId) 
+    {
+        this.dId = dId;
+    }
+
+    public Long getdId() 
+    {
+        return dId;
+    }
+    public void setUpkeepUser(String upkeepUser) 
+    {
+        this.upkeepUser = upkeepUser;
+    }
+
+    public String getUpkeepUser() 
+    {
+        return upkeepUser;
+    }
+    public void setUpkeepTime(String upkeepTime) 
+    {
+        this.upkeepTime = upkeepTime;
+    }
+
+    public String getUpkeepTime() 
+    {
+        return upkeepTime;
+    }
+    public void setUpkeepType(String upkeepType) 
+    {
+        this.upkeepType = upkeepType;
+    }
+
+    public String getUpkeepType() 
+    {
+        return upkeepType;
+    }
+    public void setUpkeepContent(String upkeepContent) 
+    {
+        this.upkeepContent = upkeepContent;
+    }
+
+    public String getUpkeepContent() 
+    {
+        return upkeepContent;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("dId", getdId())
+            .append("upkeepUser", getUpkeepUser())
+            .append("upkeepTime", getUpkeepTime())
+            .append("upkeepType", getUpkeepType())
+            .append("upkeepContent", getUpkeepContent())
+            .append("remark", getRemark())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 14 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/BloodPressure.java

@@ -82,4 +82,18 @@ public class BloodPressure implements Serializable {
     public void setIntervalTime(String intervalTime) {
         this.intervalTime = intervalTime;
     }
+
+    @Override
+    public String toString() {
+        return "{" +
+                "bloodPressureOpening:'" + bloodPressureOpening + '\'' +
+                ", intervalMeasurement:'" + intervalMeasurement + '\'' +
+                ", systolicPressure:'" + systolicPressure + '\'' +
+                ", diastolicPressure:'" + diastolicPressure + '\'' +
+                ", theMap:'" + theMap + '\'' +
+                ", pulse:'" + pulse + '\'' +
+                ", inflationPressure:'" + inflationPressure + '\'' +
+                ", intervalTime:'" + intervalTime + '\'' +
+                '}';
+    }
 }

+ 15 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/CurrentValue.java

@@ -91,4 +91,19 @@ public class CurrentValue implements Serializable {
     public void setRateBPReal(String rateBPReal) {
         this.rateBPReal = rateBPReal;
     }
+
+    @Override
+    public String toString() {
+        return "{" +
+                "arterialPressure:'" + arterialPressure + '\'' +
+                ", venousPressure:'" + venousPressure + '\'' +
+                ", conductivity:'" + conductivity + '\'' +
+                ", transmembranePressure:'" + transmembranePressure + '\'' +
+                ", temperature:'" + temperature + '\'' +
+                ", bloodVolumeDone:'" + bloodVolumeDone + '\'' +
+                ", timeRemain:'" + timeRemain + '\'' +
+                ", bloodVolumeReturn:'" + bloodVolumeReturn + '\'' +
+                ", rateBPReal:'" + rateBPReal + '\'' +
+                '}';
+    }
 }

+ 41 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DeviceBody.java

@@ -15,4 +15,45 @@ public class DeviceBody implements Serializable {
     private UfParam ufParam;
     private CurrentValue currentValue;
 
+    public BloodPressure getBloodPressure() {
+        return bloodPressure;
+    }
+
+    public void setBloodPressure(BloodPressure bloodPressure) {
+        this.bloodPressure = bloodPressure;
+    }
+
+    public DialysisParam getDialysisParam() {
+        return dialysisParam;
+    }
+
+    public void setDialysisParam(DialysisParam dialysisParam) {
+        this.dialysisParam = dialysisParam;
+    }
+
+    public UfParam getUfParam() {
+        return ufParam;
+    }
+
+    public void setUfParam(UfParam ufParam) {
+        this.ufParam = ufParam;
+    }
+
+    public CurrentValue getCurrentValue() {
+        return currentValue;
+    }
+
+    public void setCurrentValue(CurrentValue currentValue) {
+        this.currentValue = currentValue;
+    }
+
+    @Override
+    public String toString() {
+        return "{" +
+                "bloodPressure:" + ((bloodPressure != null) ? bloodPressure.toString() : "{}") +
+                ", dialysisParam:" + ((dialysisParam != null) ? dialysisParam.toString() : "{}")  +
+                ", ufParam:" + ((ufParam != null) ? ufParam.toString() : "{}") +
+                ", currentValue:" + ((currentValue != null) ? currentValue.toString() : "{}") +
+                '}';
+    }
 }

+ 11 - 7
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DeviceHeader.java

@@ -1,5 +1,6 @@
 package com.ruoyi.system.domain.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.core.SpringVersion;
 
 import java.io.Serializable;
@@ -13,15 +14,18 @@ import java.util.Date;
  * @createTime 2022/6/2116:38
  */
 public class DeviceHeader implements Serializable {
-    private Long id;
+    private String id;
+
+    /** 上传时间 */
+    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
     private Date time;
     private String currentStatus;
 
-    public Long getId() {
+    public String getId() {
         return id;
     }
 
-    public void setId(Long id) {
+    public void setId(String id) {
         this.id = id;
     }
 
@@ -43,10 +47,10 @@ public class DeviceHeader implements Serializable {
 
     @Override
     public String toString() {
-        return "DeviceHeader{" +
-                "id=" + id +
-                ", time=" + time +
-                ", currentStatus='" + currentStatus + '\'' +
+        return "{" +
+                "id:" + id +
+                ", time:" + time +
+                ", currentStatus:'" + currentStatus + '\'' +
                 '}';
     }
 }

+ 24 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DeviceRunningDto.java

@@ -15,4 +15,28 @@ public class DeviceRunningDto implements Serializable {
 
     private DeviceBody body;
 
+    public DeviceHeader getHeader() {
+        return header;
+    }
+
+    public DeviceBody getBody() {
+        return body;
+    }
+
+    public void setHeader(DeviceHeader header) {
+        this.header = header;
+    }
+
+    public void setBody(DeviceBody body) {
+        this.body = body;
+    }
+
+    @Override
+    public String toString() {
+        return "{" +
+                "header:" + header.toString() +
+                ", body:" +
+                    ((body != null) ? body.toString() : "{}") + '\'' +
+                '}';
+    }
 }

+ 12 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/DialysisParam.java

@@ -64,4 +64,16 @@ public class DialysisParam implements Serializable {
     public void setNaCurveID(String naCurveID) {
         this.naCurveID = naCurveID;
     }
+
+    @Override
+    public String toString() {
+        return "{" +
+                "basicNa:'" + basicNa + '\'' +
+                ", prescriptionNa:'" + prescriptionNa + '\'' +
+                ", prescriptionBic:'" + prescriptionBic + '\'' +
+                ", dialysisFlow:'" + dialysisFlow + '\'' +
+                ", temperature:'" + temperature + '\'' +
+                ", naCurveID:'" + naCurveID + '\'' +
+                '}';
+    }
 }

+ 11 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/UfParam.java

@@ -55,4 +55,15 @@ public class UfParam implements Serializable {
     public void setUfCurveID(String ufCurveID) {
         this.ufCurveID = ufCurveID;
     }
+
+    @Override
+    public String toString() {
+        return "{" +
+                "ufTarget:'" + ufTarget + '\'' +
+                ", ufTime:'" + ufTime + '\'' +
+                ", ufRate:'" + ufRate + '\'' +
+                ", ufVolume:'" + ufVolume + '\'' +
+                ", ufCurveID:'" + ufCurveID + '\'' +
+                '}';
+    }
 }

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/BusDeviceHistoryMapper.java

@@ -69,4 +69,12 @@ public interface BusDeviceHistoryMapper
      * @return 结果
      */
     public int deleteBusDeviceHistoryByIds(Long[] ids);
+
+    /**
+     * 通过接收设备ID获取透析信息
+     *
+     * @param dId 设备ID
+     * @return 运行状态集合
+     */
+    public List<BusDeviceHistory> selectBusDeviceByDeviceId(Long dId);
 }

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/BusDeviceNewsMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.BusDeviceNews;
+
+/**
+ * newsMapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+public interface BusDeviceNewsMapper 
+{
+    /**
+     * 查询news
+     * 
+     * @param id news主键
+     * @return news
+     */
+    public BusDeviceNews selectBusDeviceNewsById(Long id);
+
+    /**
+     * 查询news列表
+     * 
+     * @param busDeviceNews news
+     * @return news集合
+     */
+    public List<BusDeviceNews> selectBusDeviceNewsList(BusDeviceNews busDeviceNews);
+
+    /**
+     * 新增news
+     * 
+     * @param busDeviceNews news
+     * @return 结果
+     */
+    public int insertBusDeviceNews(BusDeviceNews busDeviceNews);
+
+    /**
+     * 修改news
+     * 
+     * @param busDeviceNews news
+     * @return 结果
+     */
+    public int updateBusDeviceNews(BusDeviceNews busDeviceNews);
+
+    /**
+     * 删除news
+     * 
+     * @param id news主键
+     * @return 结果
+     */
+    public int deleteBusDeviceNewsById(Long id);
+
+    /**
+     * 批量删除news
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBusDeviceNewsByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/DeviceMaintenanceMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.DeviceMaintenance;
+
+/**
+ * 日常维护Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-06-24
+ */
+public interface DeviceMaintenanceMapper 
+{
+    /**
+     * 查询日常维护
+     * 
+     * @param id 日常维护主键
+     * @return 日常维护
+     */
+    public DeviceMaintenance selectDeviceMaintenanceById(Long id);
+
+    /**
+     * 查询日常维护列表
+     * 
+     * @param deviceMaintenance 日常维护
+     * @return 日常维护集合
+     */
+    public List<DeviceMaintenance> selectDeviceMaintenanceList(DeviceMaintenance deviceMaintenance);
+
+    /**
+     * 新增日常维护
+     * 
+     * @param deviceMaintenance 日常维护
+     * @return 结果
+     */
+    public int insertDeviceMaintenance(DeviceMaintenance deviceMaintenance);
+
+    /**
+     * 修改日常维护
+     * 
+     * @param deviceMaintenance 日常维护
+     * @return 结果
+     */
+    public int updateDeviceMaintenance(DeviceMaintenance deviceMaintenance);
+
+    /**
+     * 删除日常维护
+     * 
+     * @param id 日常维护主键
+     * @return 结果
+     */
+    public int deleteDeviceMaintenanceById(Long id);
+
+    /**
+     * 批量删除日常维护
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDeviceMaintenanceByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/DeviceUpkeepMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.DeviceUpkeep;
+
+/**
+ * 设备维保记录Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-06-27
+ */
+public interface DeviceUpkeepMapper 
+{
+    /**
+     * 查询设备维保记录
+     * 
+     * @param id 设备维保记录主键
+     * @return 设备维保记录
+     */
+    public DeviceUpkeep selectDeviceUpkeepById(Long id);
+
+    /**
+     * 查询设备维保记录列表
+     * 
+     * @param deviceUpkeep 设备维保记录
+     * @return 设备维保记录集合
+     */
+    public List<DeviceUpkeep> selectDeviceUpkeepList(DeviceUpkeep deviceUpkeep);
+
+    /**
+     * 新增设备维保记录
+     * 
+     * @param deviceUpkeep 设备维保记录
+     * @return 结果
+     */
+    public int insertDeviceUpkeep(DeviceUpkeep deviceUpkeep);
+
+    /**
+     * 修改设备维保记录
+     * 
+     * @param deviceUpkeep 设备维保记录
+     * @return 结果
+     */
+    public int updateDeviceUpkeep(DeviceUpkeep deviceUpkeep);
+
+    /**
+     * 删除设备维保记录
+     * 
+     * @param id 设备维保记录主键
+     * @return 结果
+     */
+    public int deleteDeviceUpkeepById(Long id);
+
+    /**
+     * 批量删除设备维保记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDeviceUpkeepByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IBusDeviceNewsService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.BusDeviceNews;
+
+/**
+ * newsService接口
+ * 
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+public interface IBusDeviceNewsService 
+{
+    /**
+     * 查询news
+     * 
+     * @param id news主键
+     * @return news
+     */
+    public BusDeviceNews selectBusDeviceNewsById(Long id);
+
+    /**
+     * 查询news列表
+     * 
+     * @param busDeviceNews news
+     * @return news集合
+     */
+    public List<BusDeviceNews> selectBusDeviceNewsList(BusDeviceNews busDeviceNews);
+
+    /**
+     * 新增news
+     * 
+     * @param busDeviceNews news
+     * @return 结果
+     */
+    public int insertBusDeviceNews(BusDeviceNews busDeviceNews);
+
+    /**
+     * 修改news
+     * 
+     * @param busDeviceNews news
+     * @return 结果
+     */
+    public int updateBusDeviceNews(BusDeviceNews busDeviceNews);
+
+    /**
+     * 批量删除news
+     * 
+     * @param ids 需要删除的news主键集合
+     * @return 结果
+     */
+    public int deleteBusDeviceNewsByIds(Long[] ids);
+
+    /**
+     * 删除news信息
+     * 
+     * @param id news主键
+     * @return 结果
+     */
+    public int deleteBusDeviceNewsById(Long id);
+}

+ 2 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/IBusDeviceRunningService.java

@@ -2,6 +2,7 @@ package com.ruoyi.system.service;
 
 import java.util.List;
 import com.ruoyi.system.domain.BusDeviceRunning;
+import com.ruoyi.system.domain.dto.DeviceRunningDto;
 
 /**
  * 运行状态Service接口
@@ -33,7 +34,7 @@ public interface IBusDeviceRunningService
      * @param busDeviceRunning 运行状态
      * @return 结果
      */
-    public int insertBusDeviceRunning(BusDeviceRunning busDeviceRunning);
+    public int insertBusDeviceRunning(BusDeviceRunning busDeviceRunning, DeviceRunningDto json);
 
     /**
      * 修改运行状态

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IDeviceMaintenanceService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.DeviceMaintenance;
+
+/**
+ * 日常维护Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-06-24
+ */
+public interface IDeviceMaintenanceService 
+{
+    /**
+     * 查询日常维护
+     * 
+     * @param id 日常维护主键
+     * @return 日常维护
+     */
+    public DeviceMaintenance selectDeviceMaintenanceById(Long id);
+
+    /**
+     * 查询日常维护列表
+     * 
+     * @param deviceMaintenance 日常维护
+     * @return 日常维护集合
+     */
+    public List<DeviceMaintenance> selectDeviceMaintenanceList(DeviceMaintenance deviceMaintenance);
+
+    /**
+     * 新增日常维护
+     * 
+     * @param deviceMaintenance 日常维护
+     * @return 结果
+     */
+    public int insertDeviceMaintenance(DeviceMaintenance deviceMaintenance);
+
+    /**
+     * 修改日常维护
+     * 
+     * @param deviceMaintenance 日常维护
+     * @return 结果
+     */
+    public int updateDeviceMaintenance(DeviceMaintenance deviceMaintenance);
+
+    /**
+     * 批量删除日常维护
+     * 
+     * @param ids 需要删除的日常维护主键集合
+     * @return 结果
+     */
+    public int deleteDeviceMaintenanceByIds(Long[] ids);
+
+    /**
+     * 删除日常维护信息
+     * 
+     * @param id 日常维护主键
+     * @return 结果
+     */
+    public int deleteDeviceMaintenanceById(Long id);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IDeviceUpkeepService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.DeviceUpkeep;
+
+/**
+ * 设备维保记录Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-06-27
+ */
+public interface IDeviceUpkeepService 
+{
+    /**
+     * 查询设备维保记录
+     * 
+     * @param id 设备维保记录主键
+     * @return 设备维保记录
+     */
+    public DeviceUpkeep selectDeviceUpkeepById(Long id);
+
+    /**
+     * 查询设备维保记录列表
+     * 
+     * @param deviceUpkeep 设备维保记录
+     * @return 设备维保记录集合
+     */
+    public List<DeviceUpkeep> selectDeviceUpkeepList(DeviceUpkeep deviceUpkeep);
+
+    /**
+     * 新增设备维保记录
+     * 
+     * @param deviceUpkeep 设备维保记录
+     * @return 结果
+     */
+    public int insertDeviceUpkeep(DeviceUpkeep deviceUpkeep);
+
+    /**
+     * 修改设备维保记录
+     * 
+     * @param deviceUpkeep 设备维保记录
+     * @return 结果
+     */
+    public int updateDeviceUpkeep(DeviceUpkeep deviceUpkeep);
+
+    /**
+     * 批量删除设备维保记录
+     * 
+     * @param ids 需要删除的设备维保记录主键集合
+     * @return 结果
+     */
+    public int deleteDeviceUpkeepByIds(Long[] ids);
+
+    /**
+     * 删除设备维保记录信息
+     * 
+     * @param id 设备维保记录主键
+     * @return 结果
+     */
+    public int deleteDeviceUpkeepById(Long id);
+}

+ 7 - 5
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BusDeviceHistoryServiceImpl.java

@@ -79,10 +79,12 @@ public class BusDeviceHistoryServiceImpl implements IBusDeviceHistoryService
     public int updateBusDeviceHistory(BusDeviceHistory busDeviceHistory)
     {
         if(busDeviceHistory.getdId()!=null){
-            BusDevice busDevice = new BusDevice();
-            busDevice.setId(busDeviceHistory.getdId());
-            busDevice.setStatus(busDeviceHistory.getStatus());
-            busDeviceMapper.updateBusDevice(busDevice);
+            if(busDeviceHistory.getStatus().equals(2)){
+                BusDevice busDevice = new BusDevice();
+                busDevice.setId(busDeviceHistory.getdId());
+                busDevice.setStatus(0);
+                busDeviceMapper.updateBusDevice(busDevice);
+            }
         }
         if (busDeviceHistory.getpId()!=null){
             BusPatient busPatient = new BusPatient();
@@ -141,7 +143,7 @@ public class BusDeviceHistoryServiceImpl implements IBusDeviceHistoryService
         //时间处理
         busDeviceHistory.setSignTime(DateUtils.getNowDate());
         busDeviceHistory.setUpdateTime(DateUtils.getNowDate());
-
+        busDeviceHistory.setMachineModel(busDevice.getBrandName()+"_"+busDevice.getModel());
 
         busDeviceHistory.setdId(deviceId);
         busDeviceHistory.setpId(patinetId);

+ 93 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BusDeviceNewsServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.BusDeviceNewsMapper;
+import com.ruoyi.system.domain.BusDeviceNews;
+import com.ruoyi.system.service.IBusDeviceNewsService;
+
+/**
+ * newsService业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+@Service
+public class BusDeviceNewsServiceImpl implements IBusDeviceNewsService 
+{
+    @Autowired
+    private BusDeviceNewsMapper busDeviceNewsMapper;
+
+    /**
+     * 查询news
+     * 
+     * @param id news主键
+     * @return news
+     */
+    @Override
+    public BusDeviceNews selectBusDeviceNewsById(Long id)
+    {
+        return busDeviceNewsMapper.selectBusDeviceNewsById(id);
+    }
+
+    /**
+     * 查询news列表
+     * 
+     * @param busDeviceNews news
+     * @return news
+     */
+    @Override
+    public List<BusDeviceNews> selectBusDeviceNewsList(BusDeviceNews busDeviceNews)
+    {
+        return busDeviceNewsMapper.selectBusDeviceNewsList(busDeviceNews);
+    }
+
+    /**
+     * 新增news
+     * 
+     * @param busDeviceNews news
+     * @return 结果
+     */
+    @Override
+    public int insertBusDeviceNews(BusDeviceNews busDeviceNews)
+    {
+        return busDeviceNewsMapper.insertBusDeviceNews(busDeviceNews);
+    }
+
+    /**
+     * 修改news
+     * 
+     * @param busDeviceNews news
+     * @return 结果
+     */
+    @Override
+    public int updateBusDeviceNews(BusDeviceNews busDeviceNews)
+    {
+        return busDeviceNewsMapper.updateBusDeviceNews(busDeviceNews);
+    }
+
+    /**
+     * 批量删除news
+     * 
+     * @param ids 需要删除的news主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusDeviceNewsByIds(Long[] ids)
+    {
+        return busDeviceNewsMapper.deleteBusDeviceNewsByIds(ids);
+    }
+
+    /**
+     * 删除news信息
+     * 
+     * @param id news主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBusDeviceNewsById(Long id)
+    {
+        return busDeviceNewsMapper.deleteBusDeviceNewsById(id);
+    }
+}

+ 87 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BusDeviceRunningServiceImpl.java

@@ -1,6 +1,17 @@
 package com.ruoyi.system.service.impl;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
+
+import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.system.domain.BusDevice;
+import com.ruoyi.system.domain.BusDeviceHistory;
+import com.ruoyi.system.domain.BusDeviceNews;
+import com.ruoyi.system.domain.dto.DeviceRunningDto;
+import com.ruoyi.system.mapper.BusDeviceHistoryMapper;
+import com.ruoyi.system.mapper.BusDeviceMapper;
+import com.ruoyi.system.mapper.BusDeviceNewsMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.system.mapper.BusDeviceRunningMapper;
@@ -19,6 +30,15 @@ public class BusDeviceRunningServiceImpl implements IBusDeviceRunningService
     @Autowired
     private BusDeviceRunningMapper busDeviceRunningMapper;
 
+    @Autowired
+    private BusDeviceNewsMapper busDeviceNewsMapper;
+
+    @Autowired
+    private BusDeviceHistoryMapper busDeviceHistoryMapper;
+
+    @Autowired
+    private BusDeviceMapper busDeviceMapper;
+
     /**
      * 查询运行状态
      * 
@@ -50,8 +70,74 @@ public class BusDeviceRunningServiceImpl implements IBusDeviceRunningService
      * @return 结果
      */
     @Override
-    public int insertBusDeviceRunning(BusDeviceRunning busDeviceRunning)
+    public int insertBusDeviceRunning(BusDeviceRunning busDeviceRunning, DeviceRunningDto json)
     {
+        BusDeviceNews busDeviceNews = new BusDeviceNews();
+        Long deviceId;
+        /*通过设备编号获取设备ID*/
+        BusDevice busDevice = new BusDevice();
+        busDevice.setDeviceId(json.getHeader().getId());
+        List<BusDevice> deviceList = busDeviceMapper.selectBusDeviceList(busDevice);
+        if(deviceList.size()>0){
+            deviceId = deviceList.get(0).getId();
+            busDeviceNews.setDeviceId(deviceId);
+        }else{
+            throw new ServiceException("请先绑定此设备到管理系统中...");
+        }
+        busDeviceNews.setTime(json.getHeader().getTime());
+        busDeviceNews.setCurrentStatus(json.getHeader().getCurrentStatus());
+        if(json.getBody() != null && json.getBody().getBloodPressure() !=null){//血压模块参数和值
+            busDeviceNews.setBloodPressureOpemomh(json.getBody().getBloodPressure().getBloodPressureOpening());
+            busDeviceNews.setIntervalMeasurement(json.getBody().getBloodPressure().getIntervalMeasurement());
+            busDeviceNews.setSystolicPressure(json.getBody().getBloodPressure().getSystolicPressure());
+            busDeviceNews.setDiastolicPressure(json.getBody().getBloodPressure().getDiastolicPressure());
+            busDeviceNews.setTheMap(json.getBody().getBloodPressure().getTheMap());
+            busDeviceNews.setPulse(json.getBody().getBloodPressure().getPulse());
+            busDeviceNews.setInflationPressure(json.getBody().getBloodPressure().getInflationPressure());
+            busDeviceNews.setIntervalTime(json.getBody().getBloodPressure().getIntervalTime());
+        }
+        if(json.getBody() != null && json.getBody().getDialysisParam() !=null){//透析参数
+            busDeviceNews.setBasicNa(json.getBody().getDialysisParam().getBasicNa());
+            busDeviceNews.setPrescriptionNa(json.getBody().getDialysisParam().getPrescriptionNa());
+            busDeviceNews.setPrescriptionBic(json.getBody().getDialysisParam().getPrescriptionBic());
+            busDeviceNews.setDialysisFlow(json.getBody().getDialysisParam().getDialysisFlow());
+            busDeviceNews.setTemperature(json.getBody().getDialysisParam().getTemperature());
+            busDeviceNews.setNaCurveId(json.getBody().getDialysisParam().getNaCurveID());
+        }
+        if(json.getBody() != null && json.getBody().getUfParam() !=null){
+            busDeviceNews.setUfTarget(json.getBody().getUfParam().getUfTarget());
+            busDeviceNews.setUfTime(json.getBody().getUfParam().getUfTime());
+            busDeviceNews.setUfRate(json.getBody().getUfParam().getUfRate());
+            busDeviceNews.setUfVolume(json.getBody().getUfParam().getUfVolume());
+            busDeviceNews.setUfVolume(json.getBody().getUfParam().getUfCurveID());
+        }
+        if(json.getBody() != null && json.getBody().getCurrentValue() !=null){
+            busDeviceNews.setArterialPressure(json.getBody().getCurrentValue().getArterialPressure());
+            busDeviceNews.setVenousPressure(json.getBody().getCurrentValue().getVenousPressure());
+            busDeviceNews.setConductivity(json.getBody().getCurrentValue().getConductivity());
+            busDeviceNews.setTransmembranePressure(json.getBody().getCurrentValue().getTransmembranePressure());
+            busDeviceNews.setCurrentTemperature(json.getBody().getCurrentValue().getTemperature());
+            busDeviceNews.setBloodVolumeDone(json.getBody().getCurrentValue().getBloodVolumeDone());
+            busDeviceNews.setTimeRemain(json.getBody().getCurrentValue().getTimeRemain());
+            busDeviceNews.setBloodVolumeReturn(json.getBody().getCurrentValue().getBloodVolumeReturn());
+            busDeviceNews.setRateBpReal(json.getBody().getCurrentValue().getRateBPReal());
+        }
+        SimpleDateFormat sm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+        String createTime =sm.format(new Date());
+
+        List<BusDeviceHistory> historyList =  busDeviceHistoryMapper.selectBusDeviceByDeviceId(deviceId);
+        if(historyList.size()>0){
+            BusDeviceHistory deviceHistory = historyList.get(0);
+            if(deviceHistory.getStatus().equals(0)){
+                deviceHistory.setStatus(1);
+                busDeviceHistoryMapper.updateBusDeviceHistory(deviceHistory);
+            }
+            busDeviceNews.setHistoryId(deviceHistory.getId());
+        }else{
+            busDeviceRunning.setStatus("0");
+        }
+        busDeviceNews.setCreateTime(createTime);
+        busDeviceNewsMapper.insertBusDeviceNews(busDeviceNews);
         return busDeviceRunningMapper.insertBusDeviceRunning(busDeviceRunning);
     }
 

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DeviceMaintenanceServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.DeviceMaintenanceMapper;
+import com.ruoyi.system.domain.DeviceMaintenance;
+import com.ruoyi.system.service.IDeviceMaintenanceService;
+
+/**
+ * 日常维护Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-06-24
+ */
+@Service
+public class DeviceMaintenanceServiceImpl implements IDeviceMaintenanceService 
+{
+    @Autowired
+    private DeviceMaintenanceMapper deviceMaintenanceMapper;
+
+    /**
+     * 查询日常维护
+     * 
+     * @param id 日常维护主键
+     * @return 日常维护
+     */
+    @Override
+    public DeviceMaintenance selectDeviceMaintenanceById(Long id)
+    {
+        return deviceMaintenanceMapper.selectDeviceMaintenanceById(id);
+    }
+
+    /**
+     * 查询日常维护列表
+     * 
+     * @param deviceMaintenance 日常维护
+     * @return 日常维护
+     */
+    @Override
+    public List<DeviceMaintenance> selectDeviceMaintenanceList(DeviceMaintenance deviceMaintenance)
+    {
+        return deviceMaintenanceMapper.selectDeviceMaintenanceList(deviceMaintenance);
+    }
+
+    /**
+     * 新增日常维护
+     * 
+     * @param deviceMaintenance 日常维护
+     * @return 结果
+     */
+    @Override
+    public int insertDeviceMaintenance(DeviceMaintenance deviceMaintenance)
+    {
+        deviceMaintenance.setCreateTime(DateUtils.getNowDate());
+        return deviceMaintenanceMapper.insertDeviceMaintenance(deviceMaintenance);
+    }
+
+    /**
+     * 修改日常维护
+     * 
+     * @param deviceMaintenance 日常维护
+     * @return 结果
+     */
+    @Override
+    public int updateDeviceMaintenance(DeviceMaintenance deviceMaintenance)
+    {
+        deviceMaintenance.setUpdateTime(DateUtils.getNowDate());
+        return deviceMaintenanceMapper.updateDeviceMaintenance(deviceMaintenance);
+    }
+
+    /**
+     * 批量删除日常维护
+     * 
+     * @param ids 需要删除的日常维护主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDeviceMaintenanceByIds(Long[] ids)
+    {
+        return deviceMaintenanceMapper.deleteDeviceMaintenanceByIds(ids);
+    }
+
+    /**
+     * 删除日常维护信息
+     * 
+     * @param id 日常维护主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDeviceMaintenanceById(Long id)
+    {
+        return deviceMaintenanceMapper.deleteDeviceMaintenanceById(id);
+    }
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DeviceUpkeepServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.DeviceUpkeepMapper;
+import com.ruoyi.system.domain.DeviceUpkeep;
+import com.ruoyi.system.service.IDeviceUpkeepService;
+
+/**
+ * 设备维保记录Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-06-27
+ */
+@Service
+public class DeviceUpkeepServiceImpl implements IDeviceUpkeepService 
+{
+    @Autowired
+    private DeviceUpkeepMapper deviceUpkeepMapper;
+
+    /**
+     * 查询设备维保记录
+     * 
+     * @param id 设备维保记录主键
+     * @return 设备维保记录
+     */
+    @Override
+    public DeviceUpkeep selectDeviceUpkeepById(Long id)
+    {
+        return deviceUpkeepMapper.selectDeviceUpkeepById(id);
+    }
+
+    /**
+     * 查询设备维保记录列表
+     * 
+     * @param deviceUpkeep 设备维保记录
+     * @return 设备维保记录
+     */
+    @Override
+    public List<DeviceUpkeep> selectDeviceUpkeepList(DeviceUpkeep deviceUpkeep)
+    {
+        return deviceUpkeepMapper.selectDeviceUpkeepList(deviceUpkeep);
+    }
+
+    /**
+     * 新增设备维保记录
+     * 
+     * @param deviceUpkeep 设备维保记录
+     * @return 结果
+     */
+    @Override
+    public int insertDeviceUpkeep(DeviceUpkeep deviceUpkeep)
+    {
+        deviceUpkeep.setCreateTime(DateUtils.getNowDate());
+        return deviceUpkeepMapper.insertDeviceUpkeep(deviceUpkeep);
+    }
+
+    /**
+     * 修改设备维保记录
+     * 
+     * @param deviceUpkeep 设备维保记录
+     * @return 结果
+     */
+    @Override
+    public int updateDeviceUpkeep(DeviceUpkeep deviceUpkeep)
+    {
+        deviceUpkeep.setUpdateTime(DateUtils.getNowDate());
+        return deviceUpkeepMapper.updateDeviceUpkeep(deviceUpkeep);
+    }
+
+    /**
+     * 批量删除设备维保记录
+     * 
+     * @param ids 需要删除的设备维保记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDeviceUpkeepByIds(Long[] ids)
+    {
+        return deviceUpkeepMapper.deleteDeviceUpkeepByIds(ids);
+    }
+
+    /**
+     * 删除设备维保记录信息
+     * 
+     * @param id 设备维保记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDeviceUpkeepById(Long id)
+    {
+        return deviceUpkeepMapper.deleteDeviceUpkeepById(id);
+    }
+}

+ 6 - 0
ruoyi-system/src/main/resources/mapper/system/BusDeviceHistoryMapper.xml

@@ -398,4 +398,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+
+    <select id="selectBusDeviceByDeviceId" parameterType="Long" resultMap="BusDeviceHistoryResult">
+        <include refid="selectBusDeviceHistoryVo"/>
+        where d_id = #{dId} and (status = 0 or status = 1)
+        order by sign_time ASC
+    </select>
 </mapper>

+ 215 - 0
ruoyi-system/src/main/resources/mapper/system/BusDeviceNewsMapper.xml

@@ -0,0 +1,215 @@
+<?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.ruoyi.system.mapper.BusDeviceNewsMapper">
+    
+    <resultMap type="BusDeviceNews" id="BusDeviceNewsResult">
+        <result property="id"    column="id"    />
+        <result property="deviceId"    column="device_id"    />
+        <result property="time"    column="time"    />
+        <result property="currentStatus"    column="current_status"    />
+        <result property="bloodPressureOpemomh"    column="blood_pressure_opemomh"    />
+        <result property="intervalMeasurement"    column="interval_measurement"    />
+        <result property="systolicPressure"    column="systolic_pressure"    />
+        <result property="diastolicPressure"    column="diastolic_pressure"    />
+        <result property="theMap"    column="the_map"    />
+        <result property="pulse"    column="pulse"    />
+        <result property="inflationPressure"    column="inflation_pressure"    />
+        <result property="intervalTime"    column="interval_time"    />
+        <result property="basicNa"    column="basic_na"    />
+        <result property="prescriptionNa"    column="prescription_na"    />
+        <result property="prescriptionBic"    column="prescription_bic"    />
+        <result property="dialysisFlow"    column="dialysis_flow"    />
+        <result property="temperature"    column="temperature"    />
+        <result property="naCurveId"    column="na_curve_id"    />
+        <result property="ufTarget"    column="uf_target"    />
+        <result property="ufTime"    column="uf_time"    />
+        <result property="ufRate"    column="uf_rate"    />
+        <result property="ufVolume"    column="uf_volume"    />
+        <result property="ufCurveId"    column="uf_curve_id"    />
+        <result property="arterialPressure"    column="arterial_pressure"    />
+        <result property="venousPressure"    column="venous_pressure"    />
+        <result property="conductivity"    column="conductivity"    />
+        <result property="transmembranePressure"    column="transmembrane_pressure"    />
+        <result property="currentTemperature"    column="current_temperature"    />
+        <result property="bloodVolumeDone"    column="blood_volume_done"    />
+        <result property="timeRemain"    column="time_remain"    />
+        <result property="bloodVolumeReturn"    column="blood_volume_return"    />
+        <result property="rateBpReal"    column="rate_BP_real"    />
+        <result property="historyId"    column="history_id"    />
+        <result property="createTime"    column="create_time"    />
+    </resultMap>
+
+    <sql id="selectBusDeviceNewsVo">
+        select id, device_id, time, current_status, blood_pressure_opemomh, interval_measurement, systolic_pressure, diastolic_pressure, the_map, pulse, inflation_pressure, interval_time, basic_na, prescription_na, prescription_bic, dialysis_flow, temperature, na_curve_id, uf_target, uf_time, uf_rate, uf_volume, uf_curve_id, arterial_pressure, venous_pressure, conductivity, transmembrane_pressure, current_temperature, blood_volume_done, time_remain, blood_volume_return, rate_BP_real, history_id, create_time from bus_device_news
+    </sql>
+
+    <select id="selectBusDeviceNewsList" parameterType="BusDeviceNews" resultMap="BusDeviceNewsResult">
+        <include refid="selectBusDeviceNewsVo"/>
+        <where>  
+            <if test="deviceId != null "> and device_id = #{deviceId}</if>
+            <if test="time != null "> and time = #{time}</if>
+            <if test="currentStatus != null  and currentStatus != ''"> and current_status = #{currentStatus}</if>
+            <if test="bloodPressureOpemomh != null  and bloodPressureOpemomh != ''"> and blood_pressure_opemomh = #{bloodPressureOpemomh}</if>
+            <if test="intervalMeasurement != null  and intervalMeasurement != ''"> and interval_measurement = #{intervalMeasurement}</if>
+            <if test="systolicPressure != null  and systolicPressure != ''"> and systolic_pressure = #{systolicPressure}</if>
+            <if test="diastolicPressure != null  and diastolicPressure != ''"> and diastolic_pressure = #{diastolicPressure}</if>
+            <if test="theMap != null  and theMap != ''"> and the_map = #{theMap}</if>
+            <if test="pulse != null  and pulse != ''"> and pulse = #{pulse}</if>
+            <if test="inflationPressure != null  and inflationPressure != ''"> and inflation_pressure = #{inflationPressure}</if>
+            <if test="intervalTime != null  and intervalTime != ''"> and interval_time = #{intervalTime}</if>
+            <if test="basicNa != null  and basicNa != ''"> and basic_na = #{basicNa}</if>
+            <if test="prescriptionNa != null  and prescriptionNa != ''"> and prescription_na = #{prescriptionNa}</if>
+            <if test="prescriptionBic != null  and prescriptionBic != ''"> and prescription_bic = #{prescriptionBic}</if>
+            <if test="dialysisFlow != null  and dialysisFlow != ''"> and dialysis_flow = #{dialysisFlow}</if>
+            <if test="temperature != null  and temperature != ''"> and temperature = #{temperature}</if>
+            <if test="naCurveId != null  and naCurveId != ''"> and na_curve_id = #{naCurveId}</if>
+            <if test="ufTarget != null  and ufTarget != ''"> and uf_target = #{ufTarget}</if>
+            <if test="ufTime != null  and ufTime != ''"> and uf_time = #{ufTime}</if>
+            <if test="ufRate != null  and ufRate != ''"> and uf_rate = #{ufRate}</if>
+            <if test="ufVolume != null  and ufVolume != ''"> and uf_volume = #{ufVolume}</if>
+            <if test="ufCurveId != null  and ufCurveId != ''"> and uf_curve_id = #{ufCurveId}</if>
+            <if test="arterialPressure != null  and arterialPressure != ''"> and arterial_pressure = #{arterialPressure}</if>
+            <if test="venousPressure != null  and venousPressure != ''"> and venous_pressure = #{venousPressure}</if>
+            <if test="conductivity != null  and conductivity != ''"> and conductivity = #{conductivity}</if>
+            <if test="transmembranePressure != null  and transmembranePressure != ''"> and transmembrane_pressure = #{transmembranePressure}</if>
+            <if test="currentTemperature != null  and currentTemperature != ''"> and current_temperature = #{currentTemperature}</if>
+            <if test="bloodVolumeDone != null  and bloodVolumeDone != ''"> and blood_volume_done = #{bloodVolumeDone}</if>
+            <if test="timeRemain != null  and timeRemain != ''"> and time_remain = #{timeRemain}</if>
+            <if test="bloodVolumeReturn != null  and bloodVolumeReturn != ''"> and blood_volume_return = #{bloodVolumeReturn}</if>
+            <if test="rateBpReal != null  and rateBpReal != ''"> and rate_BP_real = #{rateBpReal}</if>
+            <if test="historyId != null "> and history_id = #{historyId}</if>
+            <if test="createTime != null "> and create_time = #{createTime}</if>
+        </where>
+    </select>
+    
+    <select id="selectBusDeviceNewsById" parameterType="Long" resultMap="BusDeviceNewsResult">
+        <include refid="selectBusDeviceNewsVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertBusDeviceNews" parameterType="BusDeviceNews" useGeneratedKeys="true" keyProperty="id">
+        insert into bus_device_news
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deviceId != null">device_id,</if>
+            <if test="time != null">time,</if>
+            <if test="currentStatus != null">current_status,</if>
+            <if test="bloodPressureOpemomh != null">blood_pressure_opemomh,</if>
+            <if test="intervalMeasurement != null">interval_measurement,</if>
+            <if test="systolicPressure != null">systolic_pressure,</if>
+            <if test="diastolicPressure != null">diastolic_pressure,</if>
+            <if test="theMap != null">the_map,</if>
+            <if test="pulse != null">pulse,</if>
+            <if test="inflationPressure != null">inflation_pressure,</if>
+            <if test="intervalTime != null">interval_time,</if>
+            <if test="basicNa != null">basic_na,</if>
+            <if test="prescriptionNa != null">prescription_na,</if>
+            <if test="prescriptionBic != null">prescription_bic,</if>
+            <if test="dialysisFlow != null">dialysis_flow,</if>
+            <if test="temperature != null">temperature,</if>
+            <if test="naCurveId != null">na_curve_id,</if>
+            <if test="ufTarget != null">uf_target,</if>
+            <if test="ufTime != null">uf_time,</if>
+            <if test="ufRate != null">uf_rate,</if>
+            <if test="ufVolume != null">uf_volume,</if>
+            <if test="ufCurveId != null">uf_curve_id,</if>
+            <if test="arterialPressure != null">arterial_pressure,</if>
+            <if test="venousPressure != null">venous_pressure,</if>
+            <if test="conductivity != null">conductivity,</if>
+            <if test="transmembranePressure != null">transmembrane_pressure,</if>
+            <if test="currentTemperature != null">current_temperature,</if>
+            <if test="bloodVolumeDone != null">blood_volume_done,</if>
+            <if test="timeRemain != null">time_remain,</if>
+            <if test="bloodVolumeReturn != null">blood_volume_return,</if>
+            <if test="rateBpReal != null">rate_BP_real,</if>
+            <if test="historyId != null">history_id,</if>
+            <if test="createTime != null">create_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deviceId != null">#{deviceId},</if>
+            <if test="time != null">#{time},</if>
+            <if test="currentStatus != null">#{currentStatus},</if>
+            <if test="bloodPressureOpemomh != null">#{bloodPressureOpemomh},</if>
+            <if test="intervalMeasurement != null">#{intervalMeasurement},</if>
+            <if test="systolicPressure != null">#{systolicPressure},</if>
+            <if test="diastolicPressure != null">#{diastolicPressure},</if>
+            <if test="theMap != null">#{theMap},</if>
+            <if test="pulse != null">#{pulse},</if>
+            <if test="inflationPressure != null">#{inflationPressure},</if>
+            <if test="intervalTime != null">#{intervalTime},</if>
+            <if test="basicNa != null">#{basicNa},</if>
+            <if test="prescriptionNa != null">#{prescriptionNa},</if>
+            <if test="prescriptionBic != null">#{prescriptionBic},</if>
+            <if test="dialysisFlow != null">#{dialysisFlow},</if>
+            <if test="temperature != null">#{temperature},</if>
+            <if test="naCurveId != null">#{naCurveId},</if>
+            <if test="ufTarget != null">#{ufTarget},</if>
+            <if test="ufTime != null">#{ufTime},</if>
+            <if test="ufRate != null">#{ufRate},</if>
+            <if test="ufVolume != null">#{ufVolume},</if>
+            <if test="ufCurveId != null">#{ufCurveId},</if>
+            <if test="arterialPressure != null">#{arterialPressure},</if>
+            <if test="venousPressure != null">#{venousPressure},</if>
+            <if test="conductivity != null">#{conductivity},</if>
+            <if test="transmembranePressure != null">#{transmembranePressure},</if>
+            <if test="currentTemperature != null">#{currentTemperature},</if>
+            <if test="bloodVolumeDone != null">#{bloodVolumeDone},</if>
+            <if test="timeRemain != null">#{timeRemain},</if>
+            <if test="bloodVolumeReturn != null">#{bloodVolumeReturn},</if>
+            <if test="rateBpReal != null">#{rateBpReal},</if>
+            <if test="historyId != null">#{historyId},</if>
+            <if test="createTime != null">#{createTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBusDeviceNews" parameterType="BusDeviceNews">
+        update bus_device_news
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deviceId != null">device_id = #{deviceId},</if>
+            <if test="time != null">time = #{time},</if>
+            <if test="currentStatus != null">current_status = #{currentStatus},</if>
+            <if test="bloodPressureOpemomh != null">blood_pressure_opemomh = #{bloodPressureOpemomh},</if>
+            <if test="intervalMeasurement != null">interval_measurement = #{intervalMeasurement},</if>
+            <if test="systolicPressure != null">systolic_pressure = #{systolicPressure},</if>
+            <if test="diastolicPressure != null">diastolic_pressure = #{diastolicPressure},</if>
+            <if test="theMap != null">the_map = #{theMap},</if>
+            <if test="pulse != null">pulse = #{pulse},</if>
+            <if test="inflationPressure != null">inflation_pressure = #{inflationPressure},</if>
+            <if test="intervalTime != null">interval_time = #{intervalTime},</if>
+            <if test="basicNa != null">basic_na = #{basicNa},</if>
+            <if test="prescriptionNa != null">prescription_na = #{prescriptionNa},</if>
+            <if test="prescriptionBic != null">prescription_bic = #{prescriptionBic},</if>
+            <if test="dialysisFlow != null">dialysis_flow = #{dialysisFlow},</if>
+            <if test="temperature != null">temperature = #{temperature},</if>
+            <if test="naCurveId != null">na_curve_id = #{naCurveId},</if>
+            <if test="ufTarget != null">uf_target = #{ufTarget},</if>
+            <if test="ufTime != null">uf_time = #{ufTime},</if>
+            <if test="ufRate != null">uf_rate = #{ufRate},</if>
+            <if test="ufVolume != null">uf_volume = #{ufVolume},</if>
+            <if test="ufCurveId != null">uf_curve_id = #{ufCurveId},</if>
+            <if test="arterialPressure != null">arterial_pressure = #{arterialPressure},</if>
+            <if test="venousPressure != null">venous_pressure = #{venousPressure},</if>
+            <if test="conductivity != null">conductivity = #{conductivity},</if>
+            <if test="transmembranePressure != null">transmembrane_pressure = #{transmembranePressure},</if>
+            <if test="currentTemperature != null">current_temperature = #{currentTemperature},</if>
+            <if test="bloodVolumeDone != null">blood_volume_done = #{bloodVolumeDone},</if>
+            <if test="timeRemain != null">time_remain = #{timeRemain},</if>
+            <if test="bloodVolumeReturn != null">blood_volume_return = #{bloodVolumeReturn},</if>
+            <if test="rateBpReal != null">rate_BP_real = #{rateBpReal},</if>
+            <if test="historyId != null">history_id = #{historyId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBusDeviceNewsById" parameterType="Long">
+        delete from bus_device_news where id = #{id}
+    </delete>
+
+    <delete id="deleteBusDeviceNewsByIds" parameterType="String">
+        delete from bus_device_news where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 9 - 1
ruoyi-system/src/main/resources/mapper/system/BusDeviceRunningMapper.xml

@@ -7,10 +7,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="BusDeviceRunning" id="BusDeviceRunningResult">
         <result property="id"    column="id"    />
         <result property="json"    column="json"    />
+        <result property="status"    column="status"    />
+        <result property="createTime"    column="create_time"    />
     </resultMap>
 
     <sql id="selectBusDeviceRunningVo">
-        select id, json from bus_device_running
+        select id, json, status, create_time from bus_device_running
     </sql>
 
     <select id="selectBusDeviceRunningList" parameterType="BusDeviceRunning" resultMap="BusDeviceRunningResult">
@@ -30,10 +32,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">id,</if>
             <if test="json != null">json,</if>
+            <if test="status != null">status,</if>
+            <if test="createTime != null">create_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
             <if test="json != null">#{json},</if>
+            <if test="status != null">status,</if>
+            <if test="createTime != null">createTime,</if>
          </trim>
     </insert>
 
@@ -41,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update bus_device_running
         <trim prefix="SET" suffixOverrides=",">
             <if test="json != null">json = #{json},</if>
+            <if test="status != null">json = #{status},</if>
         </trim>
         where id = #{id}
     </update>
@@ -55,4 +62,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+
 </mapper>

+ 96 - 0
ruoyi-system/src/main/resources/mapper/system/DeviceMaintenanceMapper.xml

@@ -0,0 +1,96 @@
+<?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.ruoyi.system.mapper.DeviceMaintenanceMapper">
+    
+    <resultMap type="DeviceMaintenance" id="DeviceMaintenanceResult">
+        <result property="id"    column="id"    />
+        <result property="dId"    column="d_id"    />
+        <result property="maintenanceUser"    column="maintenance_user"    />
+        <result property="cleaningTime"    column="cleaning_time"    />
+        <result property="cleaningType"    column="cleaning_type"    />
+        <result property="cleaningOther"    column="cleaning_other"    />
+        <result property="remark"    column="remark"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectDeviceMaintenanceVo">
+        select id, d_id, maintenance_user, cleaning_time, cleaning_type, cleaning_other, remark, create_by, create_time, update_by, update_time from device_maintenance
+    </sql>
+
+    <select id="selectDeviceMaintenanceList" parameterType="DeviceMaintenance" resultMap="DeviceMaintenanceResult">
+        <include refid="selectDeviceMaintenanceVo"/>
+        <where>  
+            <if test="dId != null "> and d_id = #{dId}</if>
+            <if test="maintenanceUser != null  and maintenanceUser != ''"> and maintenance_user = #{maintenanceUser}</if>
+            <if test="cleaningTime != null  and cleaningTime != ''"> and cleaning_time = #{cleaningTime}</if>
+            <if test="cleaningType != null  and cleaningType != ''"> and cleaning_type = #{cleaningType}</if>
+            <if test="cleaningOther != null  and cleaningOther != ''"> and cleaning_other = #{cleaningOther}</if>
+        </where>
+    </select>
+    
+    <select id="selectDeviceMaintenanceById" parameterType="Long" resultMap="DeviceMaintenanceResult">
+        <include refid="selectDeviceMaintenanceVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertDeviceMaintenance" parameterType="DeviceMaintenance" useGeneratedKeys="true" keyProperty="id">
+        insert into device_maintenance
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="dId != null">d_id,</if>
+            <if test="maintenanceUser != null">maintenance_user,</if>
+            <if test="cleaningTime != null">cleaning_time,</if>
+            <if test="cleaningType != null">cleaning_type,</if>
+            <if test="cleaningOther != null">cleaning_other,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="dId != null">#{dId},</if>
+            <if test="maintenanceUser != null">#{maintenanceUser},</if>
+            <if test="cleaningTime != null">#{cleaningTime},</if>
+            <if test="cleaningType != null">#{cleaningType},</if>
+            <if test="cleaningOther != null">#{cleaningOther},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDeviceMaintenance" parameterType="DeviceMaintenance">
+        update device_maintenance
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="dId != null">d_id = #{dId},</if>
+            <if test="maintenanceUser != null">maintenance_user = #{maintenanceUser},</if>
+            <if test="cleaningTime != null">cleaning_time = #{cleaningTime},</if>
+            <if test="cleaningType != null">cleaning_type = #{cleaningType},</if>
+            <if test="cleaningOther != null">cleaning_other = #{cleaningOther},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDeviceMaintenanceById" parameterType="Long">
+        delete from device_maintenance where id = #{id}
+    </delete>
+
+    <delete id="deleteDeviceMaintenanceByIds" parameterType="String">
+        delete from device_maintenance where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 96 - 0
ruoyi-system/src/main/resources/mapper/system/DeviceUpkeepMapper.xml

@@ -0,0 +1,96 @@
+<?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.ruoyi.system.mapper.DeviceUpkeepMapper">
+    
+    <resultMap type="DeviceUpkeep" id="DeviceUpkeepResult">
+        <result property="id"    column="id"    />
+        <result property="dId"    column="d_id"    />
+        <result property="upkeepUser"    column="upkeep_user"    />
+        <result property="upkeepTime"    column="upkeep_time"    />
+        <result property="upkeepType"    column="upkeep_type"    />
+        <result property="upkeepContent"    column="upkeep_content"    />
+        <result property="remark"    column="remark"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectDeviceUpkeepVo">
+        select id, d_id, upkeep_user, upkeep_time, upkeep_type, upkeep_content, remark, create_by, create_time, update_by, update_time from device_upkeep
+    </sql>
+
+    <select id="selectDeviceUpkeepList" parameterType="DeviceUpkeep" resultMap="DeviceUpkeepResult">
+        <include refid="selectDeviceUpkeepVo"/>
+        <where>  
+            <if test="dId != null "> and d_id = #{dId}</if>
+            <if test="upkeepUser != null  and upkeepUser != ''"> and upkeep_user = #{upkeepUser}</if>
+            <if test="upkeepTime != null  and upkeepTime != ''"> and upkeep_time = #{upkeepTime}</if>
+            <if test="upkeepType != null  and upkeepType != ''"> and upkeep_type = #{upkeepType}</if>
+            <if test="upkeepContent != null  and upkeepContent != ''"> and upkeep_content = #{upkeepContent}</if>
+        </where>
+    </select>
+    
+    <select id="selectDeviceUpkeepById" parameterType="Long" resultMap="DeviceUpkeepResult">
+        <include refid="selectDeviceUpkeepVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertDeviceUpkeep" parameterType="DeviceUpkeep" useGeneratedKeys="true" keyProperty="id">
+        insert into device_upkeep
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="dId != null">d_id,</if>
+            <if test="upkeepUser != null">upkeep_user,</if>
+            <if test="upkeepTime != null">upkeep_time,</if>
+            <if test="upkeepType != null">upkeep_type,</if>
+            <if test="upkeepContent != null">upkeep_content,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="dId != null">#{dId},</if>
+            <if test="upkeepUser != null">#{upkeepUser},</if>
+            <if test="upkeepTime != null">#{upkeepTime},</if>
+            <if test="upkeepType != null">#{upkeepType},</if>
+            <if test="upkeepContent != null">#{upkeepContent},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDeviceUpkeep" parameterType="DeviceUpkeep">
+        update device_upkeep
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="dId != null">d_id = #{dId},</if>
+            <if test="upkeepUser != null">upkeep_user = #{upkeepUser},</if>
+            <if test="upkeepTime != null">upkeep_time = #{upkeepTime},</if>
+            <if test="upkeepType != null">upkeep_type = #{upkeepType},</if>
+            <if test="upkeepContent != null">upkeep_content = #{upkeepContent},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDeviceUpkeepById" parameterType="Long">
+        delete from device_upkeep where id = #{id}
+    </delete>
+
+    <delete id="deleteDeviceUpkeepByIds" parameterType="String">
+        delete from device_upkeep where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>