Commit 6be73a8a794b74ecff37093f801ef29d16dba25a

Authored by fangcheng
1 parent 554a118466
Exists in master

添加末次诊断

Showing 10 changed files with 63 additions and 32 deletions

parent/base.common/src/main/java/com/lyms/base/common/dao/conf/DiagnoseMapsMapper.xml View file @ 6be73a8
... ... @@ -6,14 +6,14 @@
6 6 <resultMap id="BaseResultMap" type="com.lyms.base.common.entity.conf.DiagnoseMaps">
7 7 <result column="ID" property="id" />
8 8 <result column="DIAGNOSE_ID" property="diagnoseId" />
9   - <result column="SOURCE_ID" property="sourceId" />
  9 + <result column="CONF_ID" property="confId" />
10 10 </resultMap>
11 11  
12 12 <!-- 通用查询映射结果 -->
13 13 <resultMap id="MapsResultMap" type="com.lyms.base.common.entity.conf.DiagnoseMaps">
14 14 <result column="ID" property="id" />
15 15 <result column="DIAGNOSE_ID" property="diagnoseId" />
16   - <result column="SOURCE_ID" property="sourceId" />
  16 + <result column="CONF_ID" property="confId" />
17 17 <result column="NAME" property="name" />
18 18 <result column="GROUPNAME" property="groupname" />
19 19 <result column="GROUPORDER" property="grouporder" />
20 20  
21 21  
22 22  
... ... @@ -22,20 +22,19 @@
22 22  
23 23 <!-- 通用查询结果列 -->
24 24 <sql id="Base_Column_List">
25   - ID AS id, DIAGNOSE_ID AS diagnoseId, SOURCE_ID AS sourceId
  25 + ID AS id, DIAGNOSE_ID AS diagnoseId, CONF_ID AS confId
26 26 </sql>
27 27  
28 28 <!-- 关系查询结果列 -->
29 29 <sql id="Maps_Column_List">
30   - m.ID AS id, m.DIAGNOSE_ID AS diagnoseId, m.SOURCE_ID AS sourceId,
  30 + m.ID AS id, m.DIAGNOSE_ID AS diagnoseId, m.CONF_ID AS confId,
31 31 NAME AS name, GROUPNAME AS groupname, GROUPORDER AS grouporder, ITEMORDER AS itemorder
32 32 </sql>
33 33  
34   - <!-- 根据uid获取用户的权限列表-->
35 34 <select id="selectByDiagnoseId" resultMap="MapsResultMap">
36 35 select
37 36 <include refid="Maps_Column_List"></include>
38   - from DIAGNOSE_MAPS m left join DIAGNOSE_CONF c on m.SOURCE_ID = c.SOURCE_ID where m.DIAGNOSE_ID = #{id}
  37 + from DIAGNOSE_MAPS m left join DIAGNOSE_CONF c on m.CONF_ID = c.ID where m.DIAGNOSE_ID = #{id}
39 38 </select>
40 39 </mapper>
parent/base.common/src/main/java/com/lyms/base/common/dao/conf/HighriskMapsMapper.xml View file @ 6be73a8
... ... @@ -6,14 +6,14 @@
6 6 <resultMap id="BaseResultMap" type="com.lyms.base.common.entity.conf.HighriskMaps">
7 7 <result column="ID" property="id" />
8 8 <result column="DIAGNOSE_ID" property="diagnoseId" />
9   - <result column="SOURCE_ID" property="sourceId" />
  9 + <result column="CONF_ID" property="confId" />
10 10 </resultMap>
11 11  
12 12 <!-- 通用查询映射结果 -->
13 13 <resultMap id="HighriskMapsResult" type="com.lyms.base.common.entity.conf.HighriskMaps">
14 14 <result column="ID" property="id" />
15 15 <result column="DIAGNOSE_ID" property="diagnoseId" />
16   - <result column="SOURCE_ID" property="sourceId" />
  16 + <result column="CONF_ID" property="confId" />
17 17 <result column="NAME" property="name" />
18 18 <result column="COLORCODE" property="colorcode" />
19 19 <result column="COLORTEXT" property="colortext" />
20 20  
21 21  
22 22  
... ... @@ -24,21 +24,20 @@
24 24  
25 25 <!-- 通用查询结果列 -->
26 26 <sql id="Base_Column_List">
27   - ID AS id, DIAGNOSE_ID AS diagnoseId, SOURCE_ID AS sourceId
  27 + ID AS id, DIAGNOSE_ID AS diagnoseId, CONF_ID AS confId
28 28 </sql>
29 29  
30 30 <!-- 关系查询结果列 -->
31 31 <sql id="Maps_Column_List">
32   - m.ID AS id, m.DIAGNOSE_ID AS diagnoseId, m.SOURCE_ID AS sourceId,
  32 + m.ID AS id, m.DIAGNOSE_ID AS diagnoseId, m.CONF_ID AS confId,
33 33 NAME AS name, COLORCODE AS colorcode, COLORTEXT AS colortext, GROUPORDER AS grouporder,
34 34 ITEMORDER AS itemorder, GRADE AS grade
35 35 </sql>
36 36  
37   - <!-- 根据uid获取用户的权限列表-->
38 37 <select id="selectByDiagnoseId" resultMap="HighriskMapsResult">
39 38 select
40 39 <include refid="Maps_Column_List"></include>
41   - from HIGHRISK_MAPS m left join HIGHRISK_CONF c on m.SOURCE_ID = c.SOURCE_ID where m.DIAGNOSE_ID = #{id}
  40 + from HIGHRISK_MAPS m left join HIGHRISK_CONF c on m.CONF_ID = c.ID where m.DIAGNOSE_ID = #{id}
42 41 </select>
43 42 </mapper>
parent/base.common/src/main/java/com/lyms/base/common/entity/conf/DiagnoseMaps.java View file @ 6be73a8
... ... @@ -31,8 +31,8 @@
31 31 /**
32 32 * 诊断项资源ID
33 33 */
34   - @TableField(value="SOURCE_ID")
35   - private String sourceId;
  34 + @TableField(value="CONF_ID")
  35 + private String confId;
36 36  
37 37  
38 38 public String getId() {
39 39  
... ... @@ -51,13 +51,14 @@
51 51 this.diagnoseId = diagnoseId;
52 52 }
53 53  
54   - public String getSourceId() {
55   - return sourceId;
56   - }
  54 + public String getConfId() {
  55 + return confId;
  56 + }
57 57  
58   - public void setSourceId(String sourceId) {
59   - this.sourceId = sourceId;
60   - }
  58 + public void setConfId(String confId) {
  59 + this.confId = confId;
  60 + }
  61 +
61 62  
62 63 }
parent/base.common/src/main/java/com/lyms/base/common/entity/conf/HighriskMaps.java View file @ 6be73a8
... ... @@ -31,8 +31,8 @@
31 31 /**
32 32 * 高危项定义资源表ID
33 33 */
34   - @TableField(value="SOURCE_ID")
35   - private String sourceId;
  34 + @TableField(value="CONF_ID")
  35 + private String confId;
36 36  
37 37 @TableField(value = "NAME")
38 38 private String name;
39 39  
... ... @@ -79,13 +79,13 @@
79 79 this.diagnoseId = diagnoseId;
80 80 }
81 81  
82   - public String getSourceId() {
83   - return sourceId;
84   - }
  82 + public String getConfId() {
  83 + return confId;
  84 + }
85 85  
86   - public void setSourceId(String sourceId) {
87   - this.sourceId = sourceId;
88   - }
  86 + public void setConfId(String confId) {
  87 + this.confId = confId;
  88 + }
89 89  
90 90 public String getName() {
91 91 return name;
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/diagnose/DiagnoseInfoMapper.java View file @ 6be73a8
1 1 package com.lyms.hospital.dao.diagnose;
2 2  
  3 +import com.lyms.base.common.entity.conf.DiagnoseConf;
3 4 import com.lyms.base.common.entity.conf.HighriskConf;
4 5 import com.lyms.hospital.entity.diagnose.DiagnoseInfo;
5 6 import com.baomidou.mybatisplus.mapper.BaseMapper;
... ... @@ -20,6 +21,8 @@
20 21 public Integer deleteLogicById(Serializable id);
21 22  
22 23 public List<HighriskConf> getLastHighrisk(Serializable personId);
  24 +
  25 + public List<DiagnoseConf> getLastDiagnose(Serializable personId);
23 26  
24 27 }
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/diagnose/DiagnoseInfoMapper.xml View file @ 6be73a8
... ... @@ -94,16 +94,27 @@
94 94  
95 95 <select id="getLastHighrisk" resultType="HighriskConf">
96 96 select c.* from (
97   - select m.* from DIAGNOSE_MAPS m where m.DIAGNOSE_ID in (
  97 + select m.* from HIGHRISK_MAPS m where m.DIAGNOSE_ID in (
98 98 select id from (
99 99 select * from DIAGNOSE_INFO d where d.person_id = #{personId} and d.HAS_HIGHRISK = 1 ORDER BY d.DIAGNOSE_TIME desc limit 0,1
100 100 ) as t
101 101 )
102   - ) m left join HIGHRISK_CONF c on m.SOURCE_ID = c.id
  102 + ) m left join HIGHRISK_CONF c on m.CONF_ID = c.id
103 103 union all
104 104 select * from (
105 105 select null as ID,'other' as source_ID , null as VERSION_ID,cus_hr_name as name,CUS_HR_COLORCODE as colorcode,CUS_HR_COLORTEXT as colortext ,999 as grouporder,999 as itemorder,dd.cus_hr_grade as grade,1 as enable from DIAGNOSE_INFO dd where dd.person_id = #{personId} and dd.HAS_HIGHRISK = 1 ORDER BY dd.DIAGNOSE_TIME desc limit 0,1
106 106 ) as tt
  107 + </select>
  108 +
  109 + <select id="getLastDiagnose" resultType="DiagnoseConf">
  110 + select c.* from (
  111 + select m.* from DIAGNOSE_MAPS m where m.DIAGNOSE_ID in (
  112 + select id from (
  113 + select * from DIAGNOSE_INFO d where d.person_id = #{personId} and d.HAS_DIAGNOSE = 1 ORDER BY d.DIAGNOSE_TIME desc limit 0,1
  114 + ) as t
  115 + )
  116 + ) m left join DIAGNOSE_CONF c on m.CONF_ID = c.id
  117 +
107 118 </select>
108 119 </mapper>
parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/DiagnoseInfoService.java View file @ 6be73a8
... ... @@ -3,6 +3,7 @@
3 3 import java.io.Serializable;
4 4 import java.util.List;
5 5  
  6 +import com.lyms.base.common.entity.conf.DiagnoseConf;
6 7 import com.lyms.base.common.entity.conf.HighriskConf;
7 8 import com.lyms.hospital.entity.assist.DiagnoseAssit;
8 9 import com.lyms.hospital.entity.diagnose.DiagnoseInfo;
... ... @@ -50,6 +51,17 @@
50 51 * <li>修改时间:
51 52 */
52 53 public List<HighriskConf> getLastHighrisk(Serializable personId);
  54 +
  55 + /**
  56 + * <li>@Description:根据居民ID获取末次诊断
  57 + * <li>@param personId
  58 + * <li>@return
  59 + * <li>创建人:方承
  60 + * <li>创建时间:2017年5月8日
  61 + * <li>修改人:
  62 + * <li>修改时间:
  63 + */
  64 + public List<DiagnoseConf> getLastDiagnose(Serializable personId);
53 65  
54 66 }
parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/impl/DiagnoseInfoServiceImpl.java View file @ 6be73a8
... ... @@ -10,6 +10,7 @@
10 10  
11 11 import com.baomidou.mybatisplus.mapper.EntityWrapper;
12 12 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
  13 +import com.lyms.base.common.entity.conf.DiagnoseConf;
13 14 import com.lyms.base.common.entity.conf.HighriskConf;
14 15 import com.lyms.hospital.dao.diagnose.DiagnoseInfoMapper;
15 16 import com.lyms.hospital.entity.assist.DiagnoseAssit;
... ... @@ -152,5 +153,10 @@
152 153 public List<HighriskConf> getLastHighrisk(Serializable personId) {
153 154 return baseMapper.getLastHighrisk(personId);
154 155 }
  156 +
  157 + @Override
  158 + public List<DiagnoseConf> getLastDiagnose(Serializable personId) {
  159 + return baseMapper.getLastDiagnose(personId);
  160 + }
155 161 }
parent/hospital.web/src/test/java/test/hospital/diagnose/DiagnoseMapsTest.java View file @ 6be73a8
... ... @@ -36,7 +36,7 @@
36 36 DiagnoseMaps entity = new DiagnoseMaps();
37 37 entity.setId(StrUtils.uuid());
38 38 entity.setDiagnoseId("1");
39   - entity.setSourceId("123");
  39 + entity.setConfId("123");
40 40 diagnoseMapsService.insert(entity);
41 41 }
42 42  
parent/hospital.web/src/test/java/test/hospital/highrisk/HighriskMapsTest.java View file @ 6be73a8
... ... @@ -31,7 +31,7 @@
31 31 HighriskMaps entity = new HighriskMaps();
32 32 entity.setId(StrUtils.uuid());
33 33 entity.setDiagnoseId("1");
34   - entity.setSourceId("123");
  34 + entity.setConfId("123");
35 35 highriskMapsService.insert(entity);
36 36 }
37 37 }