Browse Source

Merge remote-tracking branch 'origin/dev/subhos_defplan_20211009' into dev/subhos_defplan_20211009

gaodm 3 years atrás
parent
commit
05ae17622d

+ 19 - 0
doc/003.20211009子医院映射/cdss_init.sql

@@ -0,0 +1,19 @@
+use `cdss`;
+
+DROP TABLE IF EXISTS `tran_hospital_relation`;
+CREATE TABLE `tran_hospital_relation` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `code` varchar(255) NOT NULL DEFAULT '' COMMENT '子医院编码',
+  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '子医院名称',
+  `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '父医院id',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `code_name` (`code`,`name`) USING BTREE,
+  KEY `name` (`name`) USING BTREE,
+  KEY `hospital_id` (`hospital_id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='医院关联表';

+ 74 - 0
src/main/java/com/diagbot/entity/TranHospitalRelation.java

@@ -0,0 +1,74 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 医院关联表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-09
+ */
+@Data
+public class TranHospitalRelation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 子医院编码
+     */
+    private String code;
+
+    /**
+     * 子医院名称
+     */
+    private String name;
+
+    /**
+     * 父医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 14 - 0
src/main/java/com/diagbot/facade/TranHospitalRelationFacade.java

@@ -0,0 +1,14 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.TranHospitalRelationServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author zhoutg
+ * @Description:
+ * @date 2020-07-29 11:08
+ */
+@Component
+public class TranHospitalRelationFacade extends TranHospitalRelationServiceImpl {
+
+}

+ 16 - 0
src/main/java/com/diagbot/mapper/TranHospitalRelationMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.TranHospitalRelation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 医院关联表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-09
+ */
+public interface TranHospitalRelationMapper extends BaseMapper<TranHospitalRelation> {
+
+}

+ 16 - 0
src/main/java/com/diagbot/service/TranHospitalRelationService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.TranHospitalRelation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 医院关联表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-09
+ */
+public interface TranHospitalRelationService extends IService<TranHospitalRelation> {
+
+}

+ 20 - 0
src/main/java/com/diagbot/service/impl/TranHospitalRelationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.TranHospitalRelation;
+import com.diagbot.mapper.TranHospitalRelationMapper;
+import com.diagbot.service.TranHospitalRelationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 医院关联表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-09
+ */
+@Service
+public class TranHospitalRelationServiceImpl extends ServiceImpl<TranHospitalRelationMapper, TranHospitalRelation> implements TranHospitalRelationService {
+
+}

+ 20 - 0
src/main/java/com/diagbot/web/TranHospitalRelationController.java

@@ -0,0 +1,20 @@
+package com.diagbot.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 医院关联表 前端控制器
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-09
+ */
+@Controller
+@RequestMapping("/tranHospitalRelation")
+public class TranHospitalRelationController {
+
+}

+ 19 - 0
src/main/resources/mapper/TranHospitalRelationMapper.xml

@@ -0,0 +1,19 @@
+<?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.diagbot.mapper.TranHospitalRelationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.TranHospitalRelation">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="code" property="code" />
+        <result column="name" property="name" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 4 - 3
src/test/java/com/diagbot/CodeGeneration.java

@@ -28,12 +28,13 @@ public class CodeGeneration {
         // 全局配置
         GlobalConfig gc = new GlobalConfig();
         gc.setOutputDir("E://code//cdss");
+        // gc.setOutputDir(System.getProperty("user.dir") + "//src//main//java");
         gc.setFileOverride(true);
         gc.setActiveRecord(false);// 不需要ActiveRecord特性的请改为false
         gc.setEnableCache(false);// XML 二级缓存
         gc.setBaseResultMap(true);// XML ResultMap
         gc.setBaseColumnList(false);// XML columList
-        gc.setAuthor("gaodm");// 作者
+        gc.setAuthor("zhoutg");// 作者
 
         // 自定义文件命名,注意 %s 会自动填充表实体属性!
         gc.setControllerName("%sController");
@@ -54,9 +55,9 @@ public class CodeGeneration {
 
         // 策略配置
         StrategyConfig strategy = new StrategyConfig();
-        strategy.setTablePrefix(new String[] { "demo_" });// 此处可以修改为您的表前缀
+        // strategy.setTablePrefix(new String[] { "demo_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "demo_mrtest_info"}); // 需要生成的表
+        strategy.setInclude(new String[] { "tran_hospital_relation"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);