From 613977d01ffaabfbd638b200428f4f0e84f888d4 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期一, 12 八月 2024 11:40:56 +0800
Subject: [PATCH] 新增 门诊室 配置
---
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java | 2
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java | 28 +++
jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/room/RoomMapper.xml | 12 +
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java | 24 +++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java | 99 ++++++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java | 29 +++
sql/mysql/jh.sql | 35 ++-
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java | 31 +++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java | 76 +++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/room/RoomDO.java | 39 ++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java | 57 +++++++
11 files changed, 416 insertions(+), 16 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 40a118a..970d307 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
@@ -10,5 +10,5 @@
public interface ErrorCodeConstants {
ErrorCode APPOINTMENT_NOT_EXISTS = new ErrorCode(1_010_000_000, "棰勭害涓嶅瓨鍦�");
-
+ ErrorCode ROOM_NOT_EXISTS = new ErrorCode(1_010_000_001, "璇婂鍜岃瘖鐤楀簥涓嶅瓨鍦�");
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java
new file mode 100644
index 0000000..cb0abad
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java
@@ -0,0 +1,99 @@
+package cn.lihu.jh.module.ecg.controller.admin.room;
+
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO;
+import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
+import cn.lihu.jh.module.ecg.service.room.RoomService;
+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 javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+import static cn.lihu.jh.framework.apilog.core.enums.OperateTypeEnum.*;
+
+
+@Tag(name = "绠$悊鍚庡彴 - 璇婂鍜岃瘖鐤楀簥")
+@RestController
+@RequestMapping("/clinic/room")
+@Validated
+public class RoomController {
+
+ @Resource
+ private RoomService roomService;
+
+ @PostMapping("/create")
+ @Operation(summary = "鍒涘缓璇婂鍜岃瘖鐤楀簥")
+ @PreAuthorize("@ss.hasPermission('clinic:room:create')")
+ public CommonResult<Integer> createRoom(@Valid @RequestBody RoomSaveReqVO createReqVO) {
+ return success(roomService.createRoom(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "鏇存柊璇婂鍜岃瘖鐤楀簥")
+ @PreAuthorize("@ss.hasPermission('clinic:room:update')")
+ public CommonResult<Boolean> updateRoom(@Valid @RequestBody RoomSaveReqVO updateReqVO) {
+ roomService.updateRoom(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "鍒犻櫎璇婂鍜岃瘖鐤楀簥")
+ @Parameter(name = "id", description = "缂栧彿", required = true)
+ @PreAuthorize("@ss.hasPermission('clinic:room:delete')")
+ public CommonResult<Boolean> deleteRoom(@RequestParam("id") Integer id) {
+ roomService.deleteRoom(id);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "鑾峰緱璇婂鍜岃瘖鐤楀簥")
+ @Parameter(name = "id", description = "缂栧彿", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('clinic:room:query')")
+ public CommonResult<RoomRespVO> getRoom(@RequestParam("id") Integer id) {
+ RoomDO room = roomService.getRoom(id);
+ return success(BeanUtils.toBean(room, RoomRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "鑾峰緱璇婂鍜岃瘖鐤楀簥鍒嗛〉")
+ @PreAuthorize("@ss.hasPermission('clinic:room:query')")
+ public CommonResult<PageResult<RoomRespVO>> getRoomPage(@Valid RoomPageReqVO pageReqVO) {
+ PageResult<RoomDO> pageResult = roomService.getRoomPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, RoomRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "瀵煎嚭璇婂鍜岃瘖鐤楀簥 Excel")
+ @PreAuthorize("@ss.hasPermission('clinic:room:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportRoomExcel(@Valid RoomPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List<RoomDO> list = roomService.getRoomPage(pageReqVO).getList();
+ // 瀵煎嚭 Excel
+ ExcelUtils.write(response, "璇婂鍜岃瘖鐤楀簥.xls", "鏁版嵁", RoomRespVO.class,
+ BeanUtils.toBean(list, RoomRespVO.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/room/vo/RoomPageReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java
new file mode 100644
index 0000000..fe50f1f
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java
@@ -0,0 +1,28 @@
+package cn.lihu.jh.module.ecg.controller.admin.room.vo;
+
+import lombok.*;
+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 RoomPageReqVO extends PageParam {
+
+ @Schema(description = "璇婂缂栧彿")
+ private String roomNo;
+
+ @Schema(description = "璇婄枟搴婄紪鍙�")
+ private String bedNo;
+
+ @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/room/vo/RoomRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java
new file mode 100644
index 0000000..13cde0d
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java
@@ -0,0 +1,31 @@
+package cn.lihu.jh.module.ecg.controller.admin.room.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+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 RoomRespVO {
+
+ @Schema(description = "缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("缂栧彿")
+ private Integer id;
+
+ @Schema(description = "璇婂缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("璇婂缂栧彿")
+ private String roomNo;
+
+ @Schema(description = "璇婄枟搴婄紪鍙�", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("璇婄枟搴婄紪鍙�")
+ private String bedNo;
+
+ @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/room/vo/RoomSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java
new file mode 100644
index 0000000..dcc8700
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java
@@ -0,0 +1,24 @@
+package cn.lihu.jh.module.ecg.controller.admin.room.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.*;
+
+
+@Schema(description = "绠$悊鍚庡彴 - 璇婂鍜岃瘖鐤楀簥鏂板/淇敼 Request VO")
+@Data
+public class RoomSaveReqVO {
+
+ private Integer id;
+
+ @Schema(description = "璇婂缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "璇婂缂栧彿涓嶈兘涓虹┖")
+ private String roomNo;
+
+ @Schema(description = "璇婄枟搴婄紪鍙�", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "璇婄枟搴婄紪鍙蜂笉鑳戒负绌�")
+ private String bedNo;
+
+}
\ 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/room/RoomDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/room/RoomDO.java
new file mode 100644
index 0000000..6ad268c
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/room/RoomDO.java
@@ -0,0 +1,39 @@
+package cn.lihu.jh.module.ecg.dal.dataobject.room;
+
+import lombok.*;
+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 鑺嬮亾婧愮爜
+ */
+@TableName("clinic_room")
+@KeySequence("clinic_room_seq") // 鐢ㄤ簬 Oracle銆丳ostgreSQL銆並ingbase銆丏B2銆丠2 鏁版嵁搴撶殑涓婚敭鑷銆傚鏋滄槸 MySQL 绛夋暟鎹簱锛屽彲涓嶅啓銆�
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class RoomDO extends BaseDO {
+
+ /**
+ * id
+ */
+ @TableId
+ private Integer id;
+ /**
+ * 璇婂缂栧彿
+ */
+ private String roomNo;
+ /**
+ * 璇婄枟搴婄紪鍙�
+ */
+ private String bedNo;
+
+}
\ 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/room/RoomMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
new file mode 100644
index 0000000..951d5e9
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
@@ -0,0 +1,29 @@
+package cn.lihu.jh.module.ecg.dal.mysql.room;
+
+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.controller.admin.room.vo.RoomPageReqVO;
+import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 璇婂鍜岃瘖鐤楀簥 Mapper
+ *
+ * @author 鑺嬮亾婧愮爜
+ */
+@Mapper
+public interface RoomMapper extends BaseMapperX<RoomDO> {
+
+ default PageResult<RoomDO> selectPage(RoomPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX<RoomDO>()
+ .eqIfPresent(RoomDO::getRoomNo, reqVO.getRoomNo())
+ .eqIfPresent(RoomDO::getBedNo, reqVO.getBedNo())
+ .betweenIfPresent(RoomDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(RoomDO::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/room/RoomService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java
new file mode 100644
index 0000000..11b5bb4
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java
@@ -0,0 +1,57 @@
+package cn.lihu.jh.module.ecg.service.room;
+
+import java.util.*;
+import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.framework.common.pojo.PageParam;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO;
+import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
+
+import javax.validation.Valid;
+
+/**
+ * 璇婂鍜岃瘖鐤楀簥 Service 鎺ュ彛
+ *
+ * @author 鑺嬮亾婧愮爜
+ */
+public interface RoomService {
+
+ /**
+ * 鍒涘缓璇婂鍜岃瘖鐤楀簥
+ *
+ * @param createReqVO 鍒涘缓淇℃伅
+ * @return 缂栧彿
+ */
+ Integer createRoom(@Valid RoomSaveReqVO createReqVO);
+
+ /**
+ * 鏇存柊璇婂鍜岃瘖鐤楀簥
+ *
+ * @param updateReqVO 鏇存柊淇℃伅
+ */
+ void updateRoom(@Valid RoomSaveReqVO updateReqVO);
+
+ /**
+ * 鍒犻櫎璇婂鍜岃瘖鐤楀簥
+ *
+ * @param id 缂栧彿
+ */
+ void deleteRoom(Integer id);
+
+ /**
+ * 鑾峰緱璇婂鍜岃瘖鐤楀簥
+ *
+ * @param id 缂栧彿
+ * @return 璇婂鍜岃瘖鐤楀簥
+ */
+ RoomDO getRoom(Integer id);
+
+ /**
+ * 鑾峰緱璇婂鍜岃瘖鐤楀簥鍒嗛〉
+ *
+ * @param pageReqVO 鍒嗛〉鏌ヨ
+ * @return 璇婂鍜岃瘖鐤楀簥鍒嗛〉
+ */
+ PageResult<RoomDO> getRoomPage(RoomPageReqVO 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/room/RoomServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java
new file mode 100644
index 0000000..f48dcac
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java
@@ -0,0 +1,76 @@
+package cn.lihu.jh.module.ecg.service.room;
+
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO;
+import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
+import cn.lihu.jh.module.ecg.dal.mysql.room.RoomMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+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 javax.annotation.Resource;
+
+import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.ROOM_NOT_EXISTS;
+
+
+/**
+ * 璇婂鍜岃瘖鐤楀簥 Service 瀹炵幇绫�
+ *
+ * @author 鑺嬮亾婧愮爜
+ */
+@Service
+@Validated
+public class RoomServiceImpl implements RoomService {
+
+ @Resource
+ private RoomMapper roomMapper;
+
+ @Override
+ public Integer createRoom(RoomSaveReqVO createReqVO) {
+ // 鎻掑叆
+ RoomDO room = BeanUtils.toBean(createReqVO, RoomDO.class);
+ roomMapper.insert(room);
+ // 杩斿洖
+ return room.getId();
+ }
+
+ @Override
+ public void updateRoom(RoomSaveReqVO updateReqVO) {
+ // 鏍¢獙瀛樺湪
+ validateRoomExists(updateReqVO.getId());
+ // 鏇存柊
+ RoomDO updateObj = BeanUtils.toBean(updateReqVO, RoomDO.class);
+ roomMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteRoom(Integer id) {
+ // 鏍¢獙瀛樺湪
+ validateRoomExists(id);
+ // 鍒犻櫎
+ roomMapper.deleteById(id);
+ }
+
+ private void validateRoomExists(Integer id) {
+ if (roomMapper.selectById(id) == null) {
+ throw exception(ROOM_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public RoomDO getRoom(Integer id) {
+ return roomMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult<RoomDO> getRoomPage(RoomPageReqVO pageReqVO) {
+ return roomMapper.selectPage(pageReqVO);
+ }
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/room/RoomMapper.xml b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/room/RoomMapper.xml
new file mode 100644
index 0000000..62c2445
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/room/RoomMapper.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.clinic.dal.mysql.room.RoomMapper">
+
+ <!--
+ 涓�鑸儏鍐典笅锛屽敖鍙兘浣跨敤 Mapper 杩涜 CRUD 澧炲垹鏀规煡鍗冲彲銆�
+ 鏃犳硶婊¤冻鐨勫満鏅紝渚嬪璇村琛ㄥ叧鑱旀煡璇紝鎵嶄娇鐢� XML 缂栧啓 SQL銆�
+ 浠g爜鐢熸垚鍣ㄦ殏鏃跺彧鐢熸垚 Mapper XML 鏂囦欢鏈韩锛屾洿澶氭帹鑽� MybatisX 蹇�熷紑鍙戞彃浠舵潵鐢熸垚鏌ヨ銆�
+ 鏂囨。鍙锛歨ttps://www.iocoder.cn/MyBatis/x-plugins/
+ -->
+
+</mapper>
\ No newline at end of file
diff --git a/sql/mysql/jh.sql b/sql/mysql/jh.sql
index 5184016..61ccf03 100644
--- a/sql/mysql/jh.sql
+++ b/sql/mysql/jh.sql
@@ -28,12 +28,12 @@
`book_check_type` tinyint(1) DEFAULT NULL COMMENT '棰勭害妫�鏌ョ被鍨�',
`book_src` tinyint(1) NOT NULL COMMENT '棰勭害鏉ユ簮锛歑绯荤粺銆佹姢澹墜鍔ㄩ绾�',
`sync_time` datetime DEFAULT NULL COMMENT '浠庢暟鎹钩鍙板悓姝ユ椂闂�',
+ `tenant_id` int NOT NULL COMMENT '绉熸埛缂栧彿',
`creator` varchar(10) DEFAULT '' COMMENT '鍒涘缓鑰�',
`create_time` datetime NOT NULL COMMENT '鍒涘缓鏃堕棿',
`updater` varchar(10) DEFAULT '' COMMENT '鏇存柊鑰�',
`update_time` datetime NOT NULL COMMENT '鏇存柊鏃堕棿',
`deleted` bit(1) DEFAULT 0 COMMENT '鍒犻櫎鏍囪',
- `tenant_id` bigint NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='棰勭害琛�';
@@ -56,26 +56,31 @@
`expired` tinyint(1) NOT NULL COMMENT '棰勭害杩囨湡鏍囪',
`room_num` varchar(10) DEFAULT NULL COMMENT '璇婂缂栧彿',
`bed_num` varchar(10) DEFAULT NULL COMMENT '璇婄枟搴婄紪鍙�',
- `create_time` datetime DEFAULT NULL COMMENT '鍒涘缓鏃堕棿',
- `update_time` datetime DEFAULT NULL COMMENT '鏇存柊鏃堕棿',
- `tenant_id` bigint NOT NULL,
+ `tenant_id` int NOT NULL COMMENT '绉熸埛缂栧彿',
+ `creator` varchar(10) DEFAULT '' COMMENT '鍒涘缓鑰�',
+ `create_time` datetime NOT NULL COMMENT '鍒涘缓鏃堕棿',
+ `updater` varchar(10) DEFAULT '' COMMENT '鏇存柊鑰�',
+ `update_time` datetime NOT NULL COMMENT '鏇存柊鏃堕棿',
+ `deleted` bit(1) DEFAULT 0 COMMENT '鍒犻櫎鏍囪',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_seq_id` (`seq_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='鎺掗槦琛�';
-- ----------------------------
--- Table structure for room_bed
+-- Table structure for clinic_room
-- ----------------------------
-DROP TABLE IF EXISTS `room_bed`;
-CREATE TABLE `room_bed` (
+DROP TABLE IF EXISTS `clinic_room`;
+CREATE TABLE `clinic_room` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
`room_no` varchar(10) NOT NULL COMMENT '璇婂缂栧彿',
`bed_no` varchar(10) NOT NULL COMMENT '璇婄枟搴婄紪鍙�',
+ `tenant_id` int NOT NULL COMMENT '绉熸埛缂栧彿',
+ `creator` varchar(10) DEFAULT '' COMMENT '鍒涘缓鑰�',
`create_time` datetime NOT NULL COMMENT '鍒涘缓鏃堕棿',
+ `updater` varchar(10) DEFAULT '' COMMENT '鏇存柊鑰�',
`update_time` datetime NOT NULL COMMENT '鏇存柊鏃堕棿',
- `deleted` bit(1) DEFAULT NULL COMMENT '鍒犻櫎鏍囪',
- `tenant_id` bigint NOT NULL,
+ `deleted` bit(1) DEFAULT 0 COMMENT '鍒犻櫎鏍囪',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='璇婂鍜岃瘖鐤楀簥琛�';
@@ -89,10 +94,10 @@
`category` varchar(45) DEFAULT NULL COMMENT '鍒嗙被鍚�',
`brand` varchar(45) DEFAULT NULL COMMENT '鍝佺墝',
`model` varchar(45) DEFAULT NULL COMMENT '鍨嬪彿',
+ `tenant_id` int NOT NULL COMMENT '绉熸埛缂栧彿',
`create_time` datetime NOT NULL COMMENT '鍒涘缓鏃堕棿',
`update_time` datetime NOT NULL COMMENT '鏇存柊鏃堕棿',
- `deleted` bit(1) DEFAULT NULL COMMENT '鍒犻櫎鏍囪',
- `tenant_id` bigint NOT NULL,
+ `deleted` bit(1) DEFAULT 0 COMMENT '鍒犻櫎鏍囪',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='璁惧鍨嬪彿琛�';
@@ -108,10 +113,10 @@
`brand` varchar(45) DEFAULT NULL COMMENT '鍝佺墝',
`model` varchar(45) DEFAULT NULL COMMENT '鍨嬪彿',
`purchase_date` date DEFAULT NULL COMMENT '閲囪喘鏃ユ湡',
+ `tenant_id` int NOT NULL COMMENT '绉熸埛缂栧彿',
`create_time` datetime NOT NULL COMMENT '鍒涘缓鏃堕棿',
`update_time` datetime NOT NULL COMMENT '鏇存柊鏃堕棿',
- `deleted` bit(1) DEFAULT NULL COMMENT '鍒犻櫎鏍囪',
- `tenant_id` bigint NOT NULL,
+ `deleted` bit(1) DEFAULT 0 COMMENT '鍒犻櫎鏍囪',
PRIMARY KEY (`id`),
UNIQUE KEY `dev_id_UNIQUE` (`dev_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='璁惧琛�';
@@ -132,10 +137,10 @@
`baseline` varchar(100) DEFAULT NULL COMMENT '鍩虹嚎绮�',
`detachment` varchar(100) DEFAULT NULL COMMENT '鑴辩',
`remark` varchar(100) DEFAULT NULL COMMENT '澶囨敞',
+ `tenant_id` int NOT NULL COMMENT '绉熸埛缂栧彿',
`create_time` datetime NOT NULL COMMENT '鍒涘缓鏃堕棿',
`update_time` datetime NOT NULL COMMENT '鏇存柊鏃堕棿',
- `deleted` bit(1) DEFAULT NULL,
- `tenant_id` bigint NOT NULL,
+ `deleted` bit(1) DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='瑁呮満鎷嗘満琛�';
--
Gitblit v1.9.3