From a0cfe3612b1f88f37fc68ab57481852185da5e6b Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期五, 06 九月 2024 12:04:33 +0800
Subject: [PATCH] 设备管理

---
 jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java                      |    1 
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java             |   53 ++++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java              |   31 +++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devmanage/DeviceServiceImpl.java           |   75 +++++++++
 jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/devmanage/DeviceMapper.xml                                   |   12 +
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/DeviceController.java   |   95 +++++++++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java    |   45 +++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devmanage/DeviceService.java               |   56 +++++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DevicePageReqVO.java |   40 +++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceSaveReqVO.java |   36 ++++
 10 files changed, 444 insertions(+), 0 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java
index b644a32..e7ceaf4 100644
--- a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java
+++ b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java
@@ -24,4 +24,5 @@
     ErrorCode PATIENT_NOT_EXISTS = new ErrorCode(1_010_004_000, "鎮h�呬笉瀛樺湪");
 
     ErrorCode DEV_MODEL_NOT_EXISTS = new ErrorCode(1_010_005_000, "璁惧鍨嬪彿涓嶅瓨鍦�");
+    ErrorCode DEVICE_NOT_EXISTS = new ErrorCode(1_010_005_001,  "璁惧涓嶅瓨鍦�");
 }
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/DeviceController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/DeviceController.java
new file mode 100644
index 0000000..b1fa875
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/DeviceController.java
@@ -0,0 +1,95 @@
+package cn.lihu.jh.module.ecg.controller.admin.devmanage;
+
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import java.util.*;
+import java.io.IOException;
+
+import cn.lihu.jh.framework.common.pojo.PageParam;
+import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.framework.common.pojo.CommonResult;
+import cn.lihu.jh.framework.common.util.object.BeanUtils;
+import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
+
+import cn.lihu.jh.framework.excel.core.util.ExcelUtils;
+
+import cn.lihu.jh.framework.apilog.core.annotation.ApiAccessLog;
+import static cn.lihu.jh.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import cn.lihu.jh.module.ecg.controller.admin.devmanage.vo.*;
+import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO;
+import cn.lihu.jh.module.ecg.service.devmanage.DeviceService;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+@Tag(name = "绠$悊鍚庡彴 - 璁惧")
+@RestController
+@RequestMapping("/ecg/device")
+@Validated
+public class DeviceController {
+
+    @Resource
+    private DeviceService deviceService;
+
+    @PostMapping("/create")
+    @Operation(summary = "鍒涘缓璁惧")
+    @PreAuthorize("@ss.hasPermission('ecg:device:create')")
+    public CommonResult<Integer> createDevice(@Valid @RequestBody DeviceSaveReqVO createReqVO) {
+        return success(deviceService.createDevice(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "鏇存柊璁惧")
+    @PreAuthorize("@ss.hasPermission('ecg:device:update')")
+    public CommonResult<Boolean> updateDevice(@Valid @RequestBody DeviceSaveReqVO updateReqVO) {
+        deviceService.updateDevice(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "鍒犻櫎璁惧")
+    @Parameter(name = "id", description = "缂栧彿", required = true)
+    @PreAuthorize("@ss.hasPermission('ecg:device:delete')")
+    public CommonResult<Boolean> deleteDevice(@RequestParam("id") Integer id) {
+        deviceService.deleteDevice(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "鑾峰緱璁惧")
+    @Parameter(name = "id", description = "缂栧彿", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('ecg:device:query')")
+    public CommonResult<DeviceRespVO> getDevice(@RequestParam("id") Integer id) {
+        DeviceDO device = deviceService.getDevice(id);
+        return success(BeanUtils.toBean(device, DeviceRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "鑾峰緱璁惧鍒嗛〉")
+    @PreAuthorize("@ss.hasPermission('ecg:device:query')")
+    public CommonResult<PageResult<DeviceRespVO>> getDevicePage(@Valid DevicePageReqVO pageReqVO) {
+        PageResult<DeviceDO> pageResult = deviceService.getDevicePage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, DeviceRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "瀵煎嚭璁惧 Excel")
+    @PreAuthorize("@ss.hasPermission('ecg:device:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportDeviceExcel(@Valid DevicePageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<DeviceDO> list = deviceService.getDevicePage(pageReqVO).getList();
+        // 瀵煎嚭 Excel
+        ExcelUtils.write(response, "璁惧.xls", "鏁版嵁", DeviceRespVO.class,
+                        BeanUtils.toBean(list, DeviceRespVO.class));
+    }
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DevicePageReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DevicePageReqVO.java
new file mode 100644
index 0000000..7b3ae93
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DevicePageReqVO.java
@@ -0,0 +1,40 @@
+package cn.lihu.jh.module.ecg.controller.admin.devmanage.vo;
+
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.lihu.jh.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.lihu.jh.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "绠$悊鍚庡彴 - 璁惧鍒嗛〉 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class DevicePageReqVO extends PageParam {
+
+    @Schema(description = "璁惧缂栧彿", example = "5317")
+    private String devId;
+
+    @Schema(description = "鍒嗙被鍚�")
+    private String category;
+
+    @Schema(description = "鍝佺墝")
+    private String brand;
+
+    @Schema(description = "鍨嬪彿")
+    private String model;
+
+    @Schema(description = "閲囪喘鏃ユ湡")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDate[] purchaseDate;
+
+    @Schema(description = "鍒涘缓鏃堕棿")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java
new file mode 100644
index 0000000..6f9e245
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java
@@ -0,0 +1,45 @@
+package cn.lihu.jh.module.ecg.controller.admin.devmanage.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "绠$悊鍚庡彴 - 璁惧 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class DeviceRespVO {
+
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15567")
+    @ExcelProperty("id")
+    private Integer id;
+
+    @Schema(description = "璁惧缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED, example = "5317")
+    @ExcelProperty("璁惧缂栧彿")
+    private String devId;
+
+    @Schema(description = "鍒嗙被鍚�", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("鍒嗙被鍚�")
+    private String category;
+
+    @Schema(description = "鍝佺墝", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("鍝佺墝")
+    private String brand;
+
+    @Schema(description = "鍨嬪彿", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("鍨嬪彿")
+    private String model;
+
+    @Schema(description = "閲囪喘鏃ユ湡")
+    @ExcelProperty("閲囪喘鏃ユ湡")
+    private LocalDate purchaseDate;
+
+    @Schema(description = "鍒涘缓鏃堕棿", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("鍒涘缓鏃堕棿")
+    private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceSaveReqVO.java
new file mode 100644
index 0000000..1934255
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceSaveReqVO.java
@@ -0,0 +1,36 @@
+package cn.lihu.jh.module.ecg.controller.admin.devmanage.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import javax.validation.constraints.NotEmpty;
+import java.time.LocalDate;
+import java.util.*;
+
+@Schema(description = "绠$悊鍚庡彴 - 璁惧鏂板/淇敼 Request VO")
+@Data
+public class DeviceSaveReqVO {
+
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15567")
+    private Integer id;
+
+    @Schema(description = "璁惧缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED, example = "5317")
+    @NotEmpty(message = "璁惧缂栧彿涓嶈兘涓虹┖")
+    private String devId;
+
+    @Schema(description = "鍒嗙被鍚�", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "鍒嗙被鍚嶄笉鑳戒负绌�")
+    private String category;
+
+    @Schema(description = "鍝佺墝", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "鍝佺墝涓嶈兘涓虹┖")
+    private String brand;
+
+    @Schema(description = "鍨嬪彿", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "鍨嬪彿涓嶈兘涓虹┖")
+    private String model;
+
+    @Schema(description = "閲囪喘鏃ユ湡")
+    private LocalDate purchaseDate;
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java
new file mode 100644
index 0000000..454b115
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java
@@ -0,0 +1,53 @@
+package cn.lihu.jh.module.ecg.dal.dataobject.devmanage;
+
+import lombok.*;
+
+import java.time.LocalDate;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.lihu.jh.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 璁惧 DO
+ *
+ * @author majianbo
+ */
+@TableName("device")
+@KeySequence("device_seq") // 鐢ㄤ簬 Oracle銆丳ostgreSQL銆並ingbase銆丏B2銆丠2 鏁版嵁搴撶殑涓婚敭鑷銆傚鏋滄槸 MySQL 绛夋暟鎹簱锛屽彲涓嶅啓銆�
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class DeviceDO extends BaseDO {
+
+    /**
+     * id
+     */
+    @TableId
+    private Integer id;
+    /**
+     * 璁惧缂栧彿
+     */
+    private String devId;
+    /**
+     * 鍒嗙被鍚�
+     */
+    private String category;
+    /**
+     * 鍝佺墝
+     */
+    private String brand;
+    /**
+     * 鍨嬪彿
+     */
+    private String model;
+    /**
+     * 閲囪喘鏃ユ湡
+     */
+    private LocalDate purchaseDate;
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java
new file mode 100644
index 0000000..f26353d
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java
@@ -0,0 +1,31 @@
+package cn.lihu.jh.module.ecg.dal.mysql.devmanage;
+
+import java.util.*;
+
+import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX;
+import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.lihu.jh.module.ecg.controller.admin.devmanage.vo.*;
+
+/**
+ * 璁惧 Mapper
+ *
+ * @author majianbo
+ */
+@Mapper
+public interface DeviceMapper extends BaseMapperX<DeviceDO> {
+
+    default PageResult<DeviceDO> selectPage(DevicePageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceDO>()
+                .eqIfPresent(DeviceDO::getDevId, reqVO.getDevId())
+                .eqIfPresent(DeviceDO::getCategory, reqVO.getCategory())
+                .eqIfPresent(DeviceDO::getBrand, reqVO.getBrand())
+                .eqIfPresent(DeviceDO::getModel, reqVO.getModel())
+                .betweenIfPresent(DeviceDO::getPurchaseDate, reqVO.getPurchaseDate())
+                .betweenIfPresent(DeviceDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(DeviceDO::getId));
+    }
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devmanage/DeviceService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devmanage/DeviceService.java
new file mode 100644
index 0000000..b5ba2f1
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devmanage/DeviceService.java
@@ -0,0 +1,56 @@
+package cn.lihu.jh.module.ecg.service.devmanage;
+
+import java.util.*;
+import cn.lihu.jh.module.ecg.controller.admin.devmanage.vo.*;
+import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO;
+import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.framework.common.pojo.PageParam;
+
+import javax.validation.Valid;
+
+/**
+ * 璁惧 Service 鎺ュ彛
+ *
+ * @author majianbo
+ */
+public interface DeviceService {
+
+    /**
+     * 鍒涘缓璁惧
+     *
+     * @param createReqVO 鍒涘缓淇℃伅
+     * @return 缂栧彿
+     */
+    Integer createDevice(@Valid DeviceSaveReqVO createReqVO);
+
+    /**
+     * 鏇存柊璁惧
+     *
+     * @param updateReqVO 鏇存柊淇℃伅
+     */
+    void updateDevice(@Valid DeviceSaveReqVO updateReqVO);
+
+    /**
+     * 鍒犻櫎璁惧
+     *
+     * @param id 缂栧彿
+     */
+    void deleteDevice(Integer id);
+
+    /**
+     * 鑾峰緱璁惧
+     *
+     * @param id 缂栧彿
+     * @return 璁惧
+     */
+    DeviceDO getDevice(Integer id);
+
+    /**
+     * 鑾峰緱璁惧鍒嗛〉
+     *
+     * @param pageReqVO 鍒嗛〉鏌ヨ
+     * @return 璁惧鍒嗛〉
+     */
+    PageResult<DeviceDO> getDevicePage(DevicePageReqVO pageReqVO);
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devmanage/DeviceServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devmanage/DeviceServiceImpl.java
new file mode 100644
index 0000000..3b4445b
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devmanage/DeviceServiceImpl.java
@@ -0,0 +1,75 @@
+package cn.lihu.jh.module.ecg.service.devmanage;
+
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.lihu.jh.module.ecg.controller.admin.devmanage.vo.*;
+import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO;
+import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.framework.common.pojo.PageParam;
+import cn.lihu.jh.framework.common.util.object.BeanUtils;
+
+import cn.lihu.jh.module.ecg.dal.mysql.devmanage.DeviceMapper;
+
+import javax.annotation.Resource;
+
+import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
+
+/**
+ * 璁惧 Service 瀹炵幇绫�
+ *
+ * @author majianbo
+ */
+@Service
+@Validated
+public class DeviceServiceImpl implements DeviceService {
+
+    @Resource
+    private DeviceMapper deviceMapper;
+
+    @Override
+    public Integer createDevice(DeviceSaveReqVO createReqVO) {
+        // 鎻掑叆
+        DeviceDO device = BeanUtils.toBean(createReqVO, DeviceDO.class);
+        deviceMapper.insert(device);
+        // 杩斿洖
+        return device.getId();
+    }
+
+    @Override
+    public void updateDevice(DeviceSaveReqVO updateReqVO) {
+        // 鏍¢獙瀛樺湪
+        validateDeviceExists(updateReqVO.getId());
+        // 鏇存柊
+        DeviceDO updateObj = BeanUtils.toBean(updateReqVO, DeviceDO.class);
+        deviceMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteDevice(Integer id) {
+        // 鏍¢獙瀛樺湪
+        validateDeviceExists(id);
+        // 鍒犻櫎
+        deviceMapper.deleteById(id);
+    }
+
+    private void validateDeviceExists(Integer id) {
+        if (deviceMapper.selectById(id) == null) {
+            throw exception(DEVICE_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public DeviceDO getDevice(Integer id) {
+        return deviceMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<DeviceDO> getDevicePage(DevicePageReqVO pageReqVO) {
+        return deviceMapper.selectPage(pageReqVO);
+    }
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/devmanage/DeviceMapper.xml b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/devmanage/DeviceMapper.xml
new file mode 100644
index 0000000..dfae8d8
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/devmanage/DeviceMapper.xml
@@ -0,0 +1,12 @@
+<?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="cn.lihu.jh.module.ecg.dal.mysql.devmanage.DeviceMapper">
+
+    <!--
+        涓�鑸儏鍐典笅锛屽敖鍙兘浣跨敤 Mapper 杩涜 CRUD 澧炲垹鏀规煡鍗冲彲銆�
+        鏃犳硶婊¤冻鐨勫満鏅紝渚嬪璇村琛ㄥ叧鑱旀煡璇紝鎵嶄娇鐢� XML 缂栧啓 SQL銆�
+        浠g爜鐢熸垚鍣ㄦ殏鏃跺彧鐢熸垚 Mapper XML 鏂囦欢鏈韩锛屾洿澶氭帹鑽� MybatisX 蹇�熷紑鍙戞彃浠舵潵鐢熸垚鏌ヨ銆�
+        鏂囨。鍙锛歨ttps://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.3