Переглянути джерело

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

wangyu 6 роки тому
батько
коміт
32c4934b28
40 змінених файлів з 2257 додано та 19 видалено
  1. 3 0
      config-server/src/main/resources/shared/icss-service-dev.yml
  2. 3 0
      config-server/src/main/resources/shared/icss-service-local.yml
  3. 3 0
      config-server/src/main/resources/shared/icss-service-pro.yml
  4. 3 0
      config-server/src/main/resources/shared/icss-service-test.yml
  5. 20 0
      icss-service/src/main/java/com/diagbot/client/AIServiceClient.java
  6. 53 0
      icss-service/src/main/java/com/diagbot/client/bean/AlgorithmClassify.java
  7. 159 0
      icss-service/src/main/java/com/diagbot/client/bean/Constants.java
  8. 202 0
      icss-service/src/main/java/com/diagbot/client/bean/Feature.java
  9. 34 0
      icss-service/src/main/java/com/diagbot/client/bean/FeatureRate.java
  10. 190 0
      icss-service/src/main/java/com/diagbot/client/bean/Response.java
  11. 77 0
      icss-service/src/main/java/com/diagbot/client/bean/ResponseData.java
  12. 259 0
      icss-service/src/main/java/com/diagbot/client/bean/SearchData.java
  13. 132 0
      icss-service/src/main/java/com/diagbot/client/bean/Status.java
  14. 23 0
      icss-service/src/main/java/com/diagbot/client/hystrix/AIServiceHystrix.java
  15. 23 0
      icss-service/src/main/java/com/diagbot/dto/PushDTO.java
  16. 1 2
      icss-service/src/main/java/com/diagbot/dto/QuestionDTO.java
  17. 29 0
      icss-service/src/main/java/com/diagbot/dto/TemplateInfoDTO.java
  18. 10 0
      icss-service/src/main/java/com/diagbot/entity/QuestionDetail.java
  19. 3 11
      icss-service/src/main/java/com/diagbot/entity/QuestionInfo.java
  20. 7 1
      icss-service/src/main/java/com/diagbot/entity/QuestionMapping.java
  21. 214 0
      icss-service/src/main/java/com/diagbot/entity/TemplateInfo.java
  22. 54 0
      icss-service/src/main/java/com/diagbot/enums/QuestionTypeEnum.java
  23. 13 0
      icss-service/src/main/java/com/diagbot/facade/DeptVitalFacade.java
  24. 167 0
      icss-service/src/main/java/com/diagbot/facade/PushFacade.java
  25. 145 0
      icss-service/src/main/java/com/diagbot/facade/TemplateInfoFacade.java
  26. 13 0
      icss-service/src/main/java/com/diagbot/facade/VitalOrderFacade.java
  27. 22 0
      icss-service/src/main/java/com/diagbot/mapper/TemplateInfoMapper.java
  28. 25 0
      icss-service/src/main/java/com/diagbot/service/TemplateInfoService.java
  29. 34 0
      icss-service/src/main/java/com/diagbot/service/impl/TemplateInfoServiceImpl.java
  30. 28 0
      icss-service/src/main/java/com/diagbot/vo/PushVO.java
  31. 39 0
      icss-service/src/main/java/com/diagbot/vo/TemplateInfoRevampVO.java
  32. 28 0
      icss-service/src/main/java/com/diagbot/vo/TemplateInfoVO.java
  33. 19 0
      icss-service/src/main/java/com/diagbot/vo/TemplateInfosIdVO.java
  34. 32 0
      icss-service/src/main/java/com/diagbot/vo/TemplateInfosVO.java
  35. 37 0
      icss-service/src/main/java/com/diagbot/web/PushController.java
  36. 89 0
      icss-service/src/main/java/com/diagbot/web/TemplateInfoController.java
  37. 2 0
      icss-service/src/main/resources/mapper/QuestionDetailMapper.xml
  38. 1 3
      icss-service/src/main/resources/mapper/QuestionInfoMapper.xml
  39. 2 2
      icss-service/src/main/resources/mapper/QuestionMappingMapper.xml
  40. 59 0
      icss-service/src/main/resources/mapper/TemplateInfoMapper.xml

+ 3 - 0
config-server/src/main/resources/shared/icss-service-dev.yml

@@ -92,3 +92,6 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
+ai:
+  server:
+    address: http://192.168.2.234:8080

+ 3 - 0
config-server/src/main/resources/shared/icss-service-local.yml

@@ -92,3 +92,6 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
+ai:
+  server:
+    address: http://192.168.2.234:8080

+ 3 - 0
config-server/src/main/resources/shared/icss-service-pro.yml

@@ -92,3 +92,6 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
+ai:
+  server:
+    address: http://192.168.2.234:8080

+ 3 - 0
config-server/src/main/resources/shared/icss-service-test.yml

@@ -92,3 +92,6 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
+ai:
+  server:
+    address: http://192.168.2.234:8080

+ 20 - 0
icss-service/src/main/java/com/diagbot/client/AIServiceClient.java

@@ -0,0 +1,20 @@
+package com.diagbot.client;
+
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.ResponseData;
+import com.diagbot.client.bean.SearchData;
+import com.diagbot.client.hystrix.AIServiceHystrix;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 13:15
+ */
+@FeignClient(name = "AI", url = "${ai.server.address}", fallback = AIServiceHystrix.class)
+public interface AIServiceClient {
+    @PostMapping(value = "/web/doc/algorithm/neural")
+    Response<ResponseData> bayesPageData(@RequestBody SearchData searchData);
+}

+ 53 - 0
icss-service/src/main/java/com/diagbot/client/bean/AlgorithmClassify.java

@@ -0,0 +1,53 @@
+package com.diagbot.client.bean;
+
+/**
+ * @Auther: fyeman
+ * @Date: 2018/7/19/019 10:37
+ * @Description:
+ */
+public enum AlgorithmClassify {
+    NEURAL("0"), BAYES("1"), EMERGENCY_NEURAL("2"), OUTPATIENT_NEURAL("3"),
+    NEURAL_SYMPTOM("11"),
+    NEURAL_DIAG("21"),
+    NEURAL_VITAL("31"),
+    NEURAL_LIS("41"),
+    NEURAL_PACS("51"),
+    NEURAL_DIAG_SYMPTOM("111"),
+    NEURAL_DIAG_VITAL("131"),
+    NEURAL_DIAG_LIS("141"),
+    NEURAL_DIAG_PACS("151");
+
+    private String value;
+
+    AlgorithmClassify(String value) {
+        this.value = value;
+    }
+
+    public String toString() {
+        return value;
+    }
+
+    public static AlgorithmClassify parse(String value) {
+        switch (value) {
+            case "11":
+                return AlgorithmClassify.NEURAL_SYMPTOM;
+            case "21":
+                return AlgorithmClassify.NEURAL_DIAG;
+            case "31":
+                return AlgorithmClassify.NEURAL_VITAL;
+            case "41":
+                return AlgorithmClassify.NEURAL_LIS;
+            case "51":
+                return AlgorithmClassify.NEURAL_PACS;
+            case "111":
+                return AlgorithmClassify.NEURAL_DIAG_SYMPTOM;
+            case "131":
+                return AlgorithmClassify.NEURAL_DIAG_VITAL;
+            case "141":
+                return AlgorithmClassify.NEURAL_DIAG_LIS;
+            case "151":
+                return AlgorithmClassify.NEURAL_DIAG_PACS;
+        }
+        return AlgorithmClassify.NEURAL_DIAG;
+    }
+}

+ 159 - 0
icss-service/src/main/java/com/diagbot/client/bean/Constants.java

@@ -0,0 +1,159 @@
+/**
+ * @Company: 杭州朗通信息技术有限公司
+ * @Department: 系统软件部
+ * @Description: 朗通智能辅助诊疗系统
+ * @Address: 浙江省杭州市西湖区西斗门路3号 天堂软件园D-7B
+ */
+package com.diagbot.client.bean;
+
+/**
+ * @Title: Constants.java
+ * @Package org.diagbot.public
+ * @Description: 通用常数接口定义
+ * @author 楼辉荣(Fyeman)
+ * @date 2015年4月23日 下午11:25:37
+ * @version V1.0
+ */
+public interface Constants {
+    /**
+     * 操作名称
+     */
+    String OP_NAME = "op";
+    /**
+     * 消息key
+     */
+    String MESSAGE = "message";
+    /**
+     * 错误key
+     */
+    String ERROR = "error";
+    /**
+     * 上个页面地址
+     */
+    String BACK_URL = "BackURL";
+    String IGNORE_BACK_URL = "ignoreBackURL";
+    /**
+     * 当前请求的地址 带参数
+     */
+    String CURRENT_URL = "currentURL";
+    /**
+     * 当前请求的地址 不带参数
+     */
+    String NO_QUERYSTRING_CURRENT_URL = "noQueryStringCurrentURL";
+    /**
+     * 上下文
+     */
+    String CONTEXT_PATH = "ctx";
+    /**
+     * 当前登录的用户
+     */
+    String CURRENT_APPLICATION = "c_app";
+    String CURRENT_USER = "c_user";
+    String CURRENT_USERNAME = "username";
+    String USER_MENUS = "menus";
+
+    /**
+     * 管理控制台应用ID=0
+     */
+    long ADMIN_APPLICATION = 0;
+    /**
+     * 一级菜单grade标识
+     */
+    int FIRST_MENU = 1;
+    /**
+     * 二级菜单grade标识
+     */
+    int SECOND_MENU = 2;
+    /**
+     * 操作按钮等级标识
+     */
+    int MENU_GRADE = 3;
+    /**
+     * 最高级资源grade标识
+     */
+    int TOP_REC = 0;
+    /**
+     * 编码方式
+     */
+    String ENCODING = "UTF-8";
+    /**
+     * 系统用户状态--启用
+     */
+    int USER_STATUS_UNLOCK = 1;
+    /**
+     * 系统用户状态--禁用
+     */
+    int USER_STATUS_LOCK = 0;
+    /**
+     * 通用值0
+     */
+    int COMMON_INT_0 = 0;
+    /**
+     * 通用值1
+     */
+    int COMMON_INT_1 = 1;
+    /**
+     * 通用值-1
+     */
+    int COMMON_INT_NEG_1 = -1;
+    /**
+     * 通用值0
+     */
+    long COMMON_LONG_0 = 0L;
+    /**
+     * 通用值1
+     */
+    long COMMON_LONG_1 = 1L;
+    /**
+     * 通用值-1
+     */
+    long COMMON_LONG_NEG_1 = -1L;
+    /**
+     * 通用值"0"
+     */
+    String COMMON_STRING_0 = "0";
+    /**
+     * 通用值"1"
+     */
+    String COMMON_STRING_1 = "1";
+    /**
+     * 通用值"-1"
+     */
+    String COMMON_STRING_NEG_1 = "-1";
+
+    /**
+     * 通用值"-1"
+     */
+    String COMMON_STRING_99 = "99";
+    /**
+     * 登录页面
+     */
+    String LOGIN_URL = "/login";
+    /**
+     * 上传文件夹
+     */
+    String UPLOAD_FOLDER_NAME = "upload";
+    /**
+     * 临时文件夹
+     */
+    String TEMP_FOLDER_NAME = "temp";
+    /**
+     * 地域标示
+     */
+    public static final String DEFAULT_LOCALE = "zh_CN";
+    /**
+     * 缺省字符集
+     */
+    public static final String DEFAULT_ENCODE = "UTF-8";
+    /**
+     * 以下为接口返回公共属性定义常量
+     */
+    public static final String MSG_SUCCESS = "操作成功";    //操作成功
+    public static final String MSG_FALURE = "操作失败";    //操作失败
+
+    public static final long INVALIDATE_VALUE = -1;        //起止时间定义
+    public static final int RET_SUCCESS = 0;            //成功
+    public static final int RET_FAIL = 1;                //失败
+    public static final int RET_ERROR_PARAM = -1;        //参数校验失败
+    public static final int RET_NO_TOKEN = -2;    //用户token丢失
+}

+ 202 - 0
icss-service/src/main/java/com/diagbot/client/bean/Feature.java

@@ -0,0 +1,202 @@
+package com.diagbot.client.bean;
+
+import java.io.Serializable;
+
+/**
+ * @Title: Feature.java
+ * @Package: com.zjlantone.nlp.web.doc.dao.model
+ * @Description: 数据库操作接口类
+ * @author: 楼辉荣
+ * @date: 2016年8月8日 下午17:16:23
+ * @version: V1.0
+ */
+
+@SuppressWarnings("serial")
+public class Feature implements Serializable {
+    /****/
+    private Long id;
+    /****/
+    private String rdn = "";
+    /****/
+    private String sex;
+    /****/
+    private int age;
+
+    private String partbody = "";
+
+    /****/
+    private String featureName = "";
+
+    /****/
+    private String featureType = "";
+
+    //是否推送
+    private String isPush = "0";
+
+    /**
+     * 特征顺序号
+     **/
+    private int sn;
+
+    /****/
+    private String negative = "";
+
+    private float duration;
+
+    private String property;
+
+    /****/
+    private Float threshold;
+
+    /****/
+    private String tfIdf;
+
+    /**
+     * 区分住院门诊
+     **/
+    private String resourceType;
+
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return this.id;
+    }
+
+    public void setRdn(String rdn) {
+        this.rdn = rdn;
+    }
+
+    public String getRdn() {
+        return this.rdn;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getSex() {
+        return this.sex;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public int getAge() {
+        return this.age;
+    }
+
+    public void setFeatureName(String featureName) {
+        this.featureName = featureName;
+    }
+
+    public String getFeatureName() {
+        return this.featureName;
+    }
+
+    public void setFeatureType(String featureType) {
+        this.featureType = featureType;
+    }
+
+    public String getFeatureType() {
+        return this.featureType;
+    }
+
+    public String getIsPush() {
+        return isPush;
+    }
+
+    public void setIsPush(String isPush) {
+        this.isPush = isPush;
+    }
+
+    public int getSn() {
+        return sn;
+    }
+
+    public void setSn(int sn) {
+        this.sn = sn;
+    }
+
+    public void setNegative(String negative) {
+        this.negative = negative;
+    }
+
+    public String getNegative() {
+        return this.negative;
+    }
+
+    public String getPartbody() {
+        return partbody;
+    }
+
+    public void setPartbody(String partbody) {
+        this.partbody = partbody;
+    }
+
+    public float getDuration() {
+        return duration;
+    }
+
+    public void setDuration(float duration) {
+        this.duration = duration;
+    }
+
+    public String getProperty() {
+        return property;
+    }
+
+    public void setProperty(String property) {
+        this.property = property;
+    }
+
+    public void setThreshold(Float threshold) {
+        this.threshold = threshold;
+    }
+
+    public Float getThreshold() {
+        return this.threshold;
+    }
+
+    public void setTfIdf(String tfIdf) {
+        this.tfIdf = tfIdf;
+    }
+
+    public String getTfIdf() {
+        return this.tfIdf;
+    }
+
+    public String getResourceType() {
+        return resourceType;
+    }
+
+    public void setResourceType(String resourceType) {
+        this.resourceType = resourceType;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        Feature feature = (Feature) o;
+        if (id != feature.id) {
+            return false;
+        }
+        return rdn.equals(feature.rdn) && partbody.equals(feature.partbody) && featureName.equals(feature.featureName)
+                && featureType.equals(feature.featureType) && negative.equals(feature.negative);
+    }
+
+    @Override
+    public int hashCode() {
+        int result = id.hashCode();
+        result = 31 * result + rdn.hashCode() + partbody.hashCode() + featureName.hashCode() + featureType.hashCode() + negative.hashCode();
+        return result;
+    }
+}

+ 34 - 0
icss-service/src/main/java/com/diagbot/client/bean/FeatureRate.java

@@ -0,0 +1,34 @@
+package com.diagbot.client.bean;
+
+/**
+ * Created by fyeman on 2018/1/17.
+ */
+public class FeatureRate {
+    private String featureName;
+    private String extraProperty;
+    private String rate;
+
+    public String getFeatureName() {
+        return featureName;
+    }
+
+    public void setFeatureName(String featureName) {
+        this.featureName = featureName;
+    }
+
+    public String getRate() {
+        return rate;
+    }
+
+    public void setRate(String rate) {
+        this.rate = rate;
+    }
+
+    public String getExtraProperty() {
+        return extraProperty;
+    }
+
+    public void setExtraProperty(String extraProperty) {
+        this.extraProperty = extraProperty;
+    }
+}

+ 190 - 0
icss-service/src/main/java/com/diagbot/client/bean/Response.java

@@ -0,0 +1,190 @@
+package com.diagbot.client.bean;
+
+/**
+ * ClassName: org.diagbot.pub.api.Response
+ * Function: API接口提供标准返回数据包, 数据包格式如下:
+ * {
+ * status:"OK",
+ * startTime:8206448610408,
+ * endTime:8206448610418,
+ * version:"1.0",
+ * msg:"操作成功",
+ * ret:"0",
+ * timeConsum:10,
+ * data:{
+ * ..。
+ * }
+ * }
+ * date: 2015年7月6日 下午1:36:58
+ *
+ * @author 楼辉荣(Fyeman)
+ * @version 1.0
+ * @since JDK 1.7
+ */
+public class Response<T> implements java.io.Serializable {
+    private static final long serialVersionUID = 8206448610408409499L;
+    private Status status = Status.PENDING;  //状态
+    private long startTime = Constants.INVALIDATE_VALUE;                                  //起始时间
+    private long endTime = Constants.INVALIDATE_VALUE;                                    //结束时间
+    private String version = "1.0";
+    private String msg = Constants.MSG_SUCCESS;                                  //消息
+    private T data = null;                                                                //序列化后的结果数据
+    // 返回结果标志,默认成功0,失败 1 参数错误 -1 token丢失-2
+    private int ret = Constants.RET_SUCCESS;
+
+    private String token;
+    //耗时
+    private long timeConsum;
+
+    public int getRet() {
+        return ret;
+    }
+
+    public void setRet(int ret) {
+        this.ret = ret;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public long getTimeConsum() {
+        return timeConsum;
+    }
+
+    public void setTimeConsum(long timeConsum) {
+        this.timeConsum = timeConsum;
+    }
+
+    public Response() {
+        super();
+    }
+
+    public Status getStatus() {
+        return status;
+    }
+
+    /**
+     * 在调用end()方法时,会自动设置状态,因此,如果调用了end()方法,就不要调用这个方法
+     *
+     * @param status
+     */
+    public Response<T> setStatus(Status status) {
+        this.status = status;
+        return this;
+    }
+
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    public long getStartTime() {
+        return startTime;
+    }
+
+    public Response<T> setStartTime(long startTime) {
+        this.startTime = startTime;
+        return this;
+    }
+
+    public long getEndTime() {
+        return endTime;
+    }
+
+    public Response<T> setEndTime(long endTime) {
+        this.endTime = endTime;
+        return this;
+    }
+
+    public T getData() {
+        return data;
+    }
+
+    public void setData(T data) {
+        this.data = data;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    /**
+     * 设置状态和起始时间,表示操作正在进行
+     */
+    public Response<T> start() {
+        this.setStatus(Status.RUNNING);
+        this.setStartTime(System.currentTimeMillis());
+        return this;
+    }
+
+    /**
+     * 设置状态和时间,表示操作结束,没有失败
+     */
+    public Response<T> end() {
+        this.setEndTime(System.currentTimeMillis());
+        this.setTimeConsum(this.endTime - this.startTime);
+        this.setStatus(Status.OK);
+        return this;
+    }
+
+    /**
+     * 设置状态和时间,表示操作结束,并且失败
+     */
+    public Response<T> endAndFailed() {
+        this.setStatus(Status.FAIL);
+        this.setEndTime(System.currentTimeMillis());
+        return this;
+    }
+
+    /**
+     * 非参数错误通用失败信息
+     */
+    public Response<T> failure(String msg) {
+        this.msg = msg;
+        this.ret = Constants.RET_FAIL;
+        this.end();
+        return this;
+    }
+
+    /**
+     * 参数错误信息
+     */
+    public Response<T> paramFailure(String msg) {
+        this.msg = msg;
+        this.ret = Constants.RET_ERROR_PARAM;
+        this.end();
+        return this;
+    }
+
+    /**
+     * 用户信息丢失
+     */
+    public Response<T> tokenFailure(String msg) {
+        this.msg = msg;
+        this.ret = Constants.RET_NO_TOKEN;
+        this.end();
+        return this;
+    }
+
+    /**
+     * 通用成功
+     */
+    public Response<T> success() {
+        this.end();
+        return this;
+    }
+
+}

+ 77 - 0
icss-service/src/main/java/com/diagbot/client/bean/ResponseData.java

@@ -0,0 +1,77 @@
+package com.diagbot.client.bean;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by fyeman on 2018/2/2.
+ */
+public class ResponseData {
+    private String participleSymptom = "";
+
+    private List<FeatureRate> symptom = new ArrayList<>(10);
+    private List<FeatureRate> vitals = new ArrayList<>(10);
+    private List<FeatureRate> dis = new ArrayList<>(10);
+    private List<FeatureRate> labs = new ArrayList<>(10);
+    private List<FeatureRate> pacs = new ArrayList<>(10);
+
+    private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.5f);
+
+    public String getParticipleSymptom() {
+        return participleSymptom;
+    }
+
+    public void setParticipleSymptom(String participleSymptom) {
+        this.participleSymptom = participleSymptom;
+    }
+
+    public List<FeatureRate> getSymptom() {
+        return symptom;
+    }
+
+    public void setSymptom(List<FeatureRate> symptom) {
+        this.symptom = symptom;
+    }
+
+    public List<FeatureRate> getVitals() {
+        return vitals;
+    }
+
+    public void setVitals(List<FeatureRate> vitals) {
+        this.vitals = vitals;
+    }
+
+    public List<FeatureRate> getDis() {
+        return dis;
+    }
+
+    public void setDis(List<FeatureRate> dis) {
+        this.dis = dis;
+    }
+
+    public List<FeatureRate> getLabs() {
+        return labs;
+    }
+
+    public void setLabs(List<FeatureRate> labs) {
+        this.labs = labs;
+    }
+
+    public List<FeatureRate> getPacs() {
+        return pacs;
+    }
+
+    public void setPacs(List<FeatureRate> pacs) {
+        this.pacs = pacs;
+    }
+
+    public Map<String, Map<String, String>> getInputs() {
+        return inputs;
+    }
+
+    public void setInputs(Map<String, Map<String, String>> inputs) {
+        this.inputs = inputs;
+    }
+}

+ 259 - 0
icss-service/src/main/java/com/diagbot/client/bean/SearchData.java

@@ -0,0 +1,259 @@
+package com.diagbot.client.bean;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by fyeman on 2018/1/31.
+ */
+public class SearchData {
+    private int length = 10;
+    private int age_start = 0;
+    private int age_end = 200;
+    private int age = 0;
+    private String sex;
+    // 搜索结果的贝叶斯阈值
+    private String threshold = "0";
+
+    private String symptom = "";
+    private String vital = "";
+    private String lis = "";
+    private String pacs = "";
+    private String diag = "";
+    private String past = "";
+    private String other = "";
+
+    //特征类别
+    private String featureType;
+    //特征类别对","进行分割后数据
+    private String[] featureTypes;
+    //门诊 住院分类
+    private String resourceType;
+    //模型
+    private AlgorithmClassify algorithmClassify[];
+    //模型
+    private String algorithmClassifyValue;
+    //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
+    private String sysCode;
+
+    private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.8f);
+
+
+    private List<Feature> symptomFeatureList = new ArrayList<>();
+    private List<Feature> vitalFeatureList = new ArrayList<>();
+    private List<Feature> lisFeatureList = new ArrayList<>();
+    private List<Feature> pacsFeatureList = new ArrayList<>();
+    private List<Feature> diagFeatureList = new ArrayList<>();
+    private List<Feature> symptompropertyFeatureList = new ArrayList<>();
+
+    public int getLength() {
+        return length;
+    }
+
+    public void setLength(int length) {
+        this.length = length;
+    }
+
+    public int getAge_start() {
+        return age_start;
+    }
+
+    public void setAge_start(int age_start) {
+        this.age_start = age_start;
+    }
+
+    public int getAge_end() {
+        return age_end;
+    }
+
+    public void setAge_end(int age_end) {
+        this.age_end = age_end;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getSymptom() {
+        return symptom;
+    }
+
+    public void setSymptom(String symptom) {
+        this.symptom = symptom;
+    }
+
+    public String getVital() {
+        return vital;
+    }
+
+    public void setVital(String vital) {
+        this.vital = vital;
+    }
+
+    public String getLis() {
+        return lis;
+    }
+
+    public void setLis(String lis) {
+        this.lis = lis;
+    }
+
+    public String getPacs() {
+        return pacs;
+    }
+
+    public void setPacs(String pacs) {
+        this.pacs = pacs;
+    }
+
+    public String getDiag() {
+        return diag;
+    }
+
+    public void setDiag(String diag) {
+        this.diag = diag;
+    }
+
+    public String getPast() {
+        return past;
+    }
+
+    public void setPast(String past) {
+        this.past = past;
+    }
+
+    public String getOther() {
+        return other;
+    }
+
+    public void setOther(String other) {
+        this.other = other;
+    }
+
+    public String getFeatureType() {
+        return featureType;
+    }
+
+    public void setFeatureType(String featureType) {
+        this.featureType = featureType;
+    }
+
+    public String[] getFeatureTypes() {
+        return featureTypes;
+    }
+
+    public void setFeatureTypes(String[] featureTypes) {
+        this.featureTypes = featureTypes;
+    }
+
+    public String getResourceType() {
+        return resourceType;
+    }
+
+    public void setResourceType(String resourceType) {
+        this.resourceType = resourceType;
+    }
+
+    public String getSysCode() {
+        return sysCode;
+    }
+
+    public void setSysCode(String sysCode) {
+        this.sysCode = sysCode;
+    }
+
+    public void setThreshold(String threshold) {
+        this.threshold = threshold;
+    }
+
+    public float getThreshold() {
+        return Float.parseFloat(threshold);
+    }
+
+    public List<Feature> getSymptomFeatureList() {
+        return symptomFeatureList;
+    }
+
+    public void setSymptomFeatureList(List<Feature> symptomFeatureList) {
+        this.symptomFeatureList = symptomFeatureList;
+    }
+
+    public List<Feature> getVitalFeatureList() {
+        return vitalFeatureList;
+    }
+
+    public void setVitalFeatureList(List<Feature> vitalFeatureList) {
+        this.vitalFeatureList = vitalFeatureList;
+    }
+
+    public List<Feature> getLisFeatureList() {
+        return lisFeatureList;
+    }
+
+    public void setLisFeatureList(List<Feature> lisFeatureList) {
+        this.lisFeatureList = lisFeatureList;
+    }
+
+    public List<Feature> getPacsFeatureList() {
+        return pacsFeatureList;
+    }
+
+    public void setPacsFeatureList(List<Feature> pacsFeatureList) {
+        this.pacsFeatureList = pacsFeatureList;
+    }
+
+
+    public List<Feature> getSymptompropertyFeatureList() {
+        return symptompropertyFeatureList;
+    }
+
+    public void setSymptompropertyFeatureList(List<Feature> symptompropertyFeatureList) {
+        this.symptompropertyFeatureList = symptompropertyFeatureList;
+    }
+
+    public List<Feature> getDiagFeatureList() {
+        return diagFeatureList;
+    }
+
+    public void setDiagFeatureList(List<Feature> diagFeatureList) {
+        this.diagFeatureList = diagFeatureList;
+    }
+
+    public Map<String, Map<String, String>> getInputs() {
+        return inputs;
+    }
+
+    public void setInputs(Map<String, Map<String, String>> inputs) {
+        this.inputs = inputs;
+    }
+
+    public AlgorithmClassify[] getAlgorithmClassify() {
+        return algorithmClassify;
+    }
+
+    public void setAlgorithmClassify(AlgorithmClassify[] algorithmClassify) {
+        this.algorithmClassify = algorithmClassify;
+    }
+
+    public String getAlgorithmClassifyValue() {
+        return algorithmClassifyValue;
+    }
+
+    public void setAlgorithmClassifyValue(String algorithmClassifyValue) {
+        this.algorithmClassifyValue = algorithmClassifyValue;
+    }
+}

+ 132 - 0
icss-service/src/main/java/com/diagbot/client/bean/Status.java

@@ -0,0 +1,132 @@
+package com.diagbot.client.bean;
+
+public enum Status {
+    /**
+     * <code>PENDING = 1;</code>
+     *
+     * <pre>
+     * 操作尚未开始
+     * </pre>
+     */
+    PENDING(1),
+    /**
+     * <code>RUNNING = 2;</code>
+     *
+     * <pre>
+     * 操作开始
+     * </pre>
+     */
+    RUNNING(2),
+    /**
+     * <code>OK = 3;</code>
+     *
+     * <pre>
+     * 操作正常结束
+     * </pre>
+     */
+    OK(3),
+    /**
+     * <code>WARN = 4;</code>
+     *
+     * <pre>
+     * 有警告,但是正常结束
+     * </pre>
+     */
+    WARN(4),
+    /**
+     * <code>ERROR = 5;</code>
+     *
+     * <pre>
+     * 有错误,但是完整结束
+     * </pre>
+     */
+    ERROR(5),
+    /**
+     * <code>FAIL = 6;</code>
+     *
+     * <pre>
+     * 操作失败
+     * </pre>
+     */
+    FAIL(6),
+    ;
+
+    /**
+     * <code>PENDING = 1;</code>
+     *
+     * <pre>
+     * 操作尚未开始
+     * </pre>
+     */
+    public static final int PENDING_VALUE = 1;
+    /**
+     * <code>RUNNING = 2;</code>
+     *
+     * <pre>
+     * 操作开始
+     * </pre>
+     */
+    public static final int RUNNING_VALUE = 2;
+    /**
+     * <code>OK = 3;</code>
+     *
+     * <pre>
+     * 操作正常结束
+     * </pre>
+     */
+    public static final int OK_VALUE = 3;
+    /**
+     * <code>WARN = 4;</code>
+     *
+     * <pre>
+     * 有警告,但是正常结束
+     * </pre>
+     */
+    public static final int WARN_VALUE = 4;
+    /**
+     * <code>ERROR = 5;</code>
+     *
+     * <pre>
+     * 有错误,但是完整结束
+     * </pre>
+     */
+    public static final int ERROR_VALUE = 5;
+    /**
+     * <code>FAIL = 6;</code>
+     *
+     * <pre>
+     * 操作失败
+     * </pre>
+     */
+    public static final int FAIL_VALUE = 6;
+
+    public final int getNumber() {
+        return value;
+    }
+
+    public static Status valueOf(int value) {
+        switch (value) {
+            case 1:
+                return PENDING;
+            case 2:
+                return RUNNING;
+            case 3:
+                return OK;
+            case 4:
+                return WARN;
+            case 5:
+                return ERROR;
+            case 6:
+                return FAIL;
+            default:
+                return null;
+        }
+    }
+
+    private final int value;
+
+    private Status(int value) {
+        this.value = value;
+    }
+
+}

+ 23 - 0
icss-service/src/main/java/com/diagbot/client/hystrix/AIServiceHystrix.java

@@ -0,0 +1,23 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.AIServiceClient;
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.ResponseData;
+import com.diagbot.client.bean.SearchData;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 13:15
+ */
+@Component
+@Slf4j
+public class AIServiceHystrix implements AIServiceClient {
+    @Override
+    public Response<ResponseData> bayesPageData(SearchData searchData) {
+        log.error("【hystrix】调用{}异常", "bayesPageData");
+        return null;
+    }
+}

+ 23 - 0
icss-service/src/main/java/com/diagbot/dto/PushDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 13:44
+ */
+@Getter
+@Setter
+public class PushDTO {
+
+    private Map<String, Object> symptomMap;
+    private Map<String, Object> vitalMap;
+    private Map<String, Object> disMap;
+    private Map<String, Object> labMap;
+    private Map<String, Object> pacsMap;
+
+}

+ 1 - 2
icss-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -23,14 +23,13 @@ public class QuestionDTO {
     private Integer type;//类型(1:主诉 2:现病史 3:其他史 4:查体,5:化验 6:辅检 7:诊断)
     private Integer controlType; //控件类型
     private Integer subType; //子类型
-    private String isGroup; //组合项标识(0:单项  1:组合项)
+    private String tagType; //标签标识(0:单项  1:组合项 2:填充项)
     private String addLine; //添加换行符(0:不换行,1:换行)
     private String labelPrefix; //前置内容
     private String labelSuffix; //后置内容
     private BigDecimal minValue; //最小值
     private BigDecimal maxValue; //最大值
     private String judgeType; //判断类型(0:本身异常;1:本身正常;2:数字范围;3:计算公式;9:无需判断)
-    private String tagQuestions; //标签关联questions
     private String copyType;//是否显示 + (0:不显示 1 :显示)
     private List<QuestionDetail> questionDetailList = new ArrayList<>(); //标签明细表
     private List<QuestionDTO> questionMapping = new ArrayList<>();     //下级标签

+ 29 - 0
icss-service/src/main/java/com/diagbot/dto/TemplateInfoDTO.java

@@ -0,0 +1,29 @@
+package com.diagbot.dto;
+
+import java.util.Date;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: 医生病例模板出参
+ * @date 2018年11月16日 上午10:40:27
+ */
+@Getter
+@Setter
+public class TemplateInfoDTO {
+	 private Long id;//模板id
+	 private Date  gmtCreate;//创建时间
+	 private String creator;//创建人id
+	 private String modeName;//模板名字
+	 private Long doctorId;//医生id
+	 private Long hospitalId;//医院id
+	 private Long hospitalDeptId;//部门id
+	 private String modeType;//模板类型
+	 private String  preview;//预览文字
+	 private String dataJson;//模板数据
+	 private String remark;//备注
+
+}

+ 10 - 0
icss-service/src/main/java/com/diagbot/entity/QuestionDetail.java

@@ -31,6 +31,16 @@ public class QuestionDetail implements Serializable {
      */
     private String name;
 
+    /**
+     * 前置内容
+     */
+    private String labelPrefix;
+
+    /**
+     * 后置内容
+     */
+    private String labelSuffix;
+
     /**
      * question_id
      */

+ 3 - 11
icss-service/src/main/java/com/diagbot/entity/QuestionInfo.java

@@ -58,14 +58,10 @@ public class QuestionInfo implements Serializable {
     private Integer type;
 
     /**
-     * 控件类型(0:标签 1:下拉单选 2:下拉多选 3:联合下拉单选 4:联合下拉多选 5:占位标签)
+     * 控件类型
      */
     private Integer controlType;
 
-    /**
-     * 输入框的格式
-     */
-    private Integer inputFormat;
 
     /**
      * 子类型,(31:既往史 32:家族史 33:个人史 34:月经史 35:婚育史)
@@ -73,9 +69,9 @@ public class QuestionInfo implements Serializable {
     private Integer subType;
 
     /**
-     * 组合项标识(0:单项  1:组合项)
+     * 标签标识(0:单项  1:组合项 2:填充项)
      */
-    private String isGroup;
+    private String tagType;
 
     /**
      * 添加换行符(0:不换行,1:换行)
@@ -107,10 +103,6 @@ public class QuestionInfo implements Serializable {
      */
     private String judgeType;
 
-    /**
-     * 标签关联questions
-     */
-    private String tagQuestions;
 
     /**
      * 是否显示 + (0:不显示 1 :显示)

+ 7 - 1
icss-service/src/main/java/com/diagbot/entity/QuestionMapping.java

@@ -74,7 +74,13 @@ public class QuestionMapping implements Serializable {
     /**
      * 主症状和伴随症状对应的question类型(0:症状公用 1:主症状特有 2:伴随症状特有 )
      */
-    private Integer type;
+    private Integer symptomType;
+
+    /**
+     * 互斥类型
+     */
+    private Integer exclusionType;
+
 
     /**
      * 备注

+ 214 - 0
icss-service/src/main/java/com/diagbot/entity/TemplateInfo.java

@@ -0,0 +1,214 @@
+package com.diagbot.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+/**
+ * <p>
+ * 模板表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-11-19
+ */
+@TableName("icss_template_info")
+public class TemplateInfo 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 name;
+
+    /**
+     * 医生id
+     */
+    private Long doctorId;
+
+    /**
+     * 医生科室id
+     */
+    private Long hospitalDeptId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 分类(1:结构化模板,2:文本输入模板)
+     */
+    private String type;
+
+    /**
+     * 预览文字
+     */
+    private String preview;
+
+    /**
+     * 内容JSON字符串(模板内容)
+     */
+    private String dataJson;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public Long getDoctorId() {
+        return doctorId;
+    }
+
+    public void setDoctorId(Long doctorId) {
+        this.doctorId = doctorId;
+    }
+   
+    public Long getHospitalDeptId() {
+		return hospitalDeptId;
+	}
+
+	public void setHospitalDeptId(Long hospitalDeptId) {
+		this.hospitalDeptId = hospitalDeptId;
+	}
+
+	public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+    public String getPreview() {
+        return preview;
+    }
+
+    public void setPreview(String preview) {
+        this.preview = preview;
+    }
+    public String getDataJson() {
+        return dataJson;
+    }
+
+    public void setDataJson(String dataJson) {
+        this.dataJson = dataJson;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "TemplateInfo{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", name=" + name +
+        ", doctorId=" + doctorId +
+        ", hospitalDeptId=" + hospitalDeptId +
+        ", hospitalId=" + hospitalId +
+        ", type=" + type +
+        ", preview=" + preview +
+        ", dataJson=" + dataJson +
+        ", remark=" + remark +
+        "}";
+    }
+}

+ 54 - 0
icss-service/src/main/java/com/diagbot/enums/QuestionTypeEnum.java

@@ -0,0 +1,54 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:标签类型
+ * @Author:zhaops
+ * @time: 2018/11/21 11:39
+ */
+public enum QuestionTypeEnum implements KeyedNamed {
+    Mainsuit(1, "主诉"),
+    Symptom(2, "现病史"),
+    Other(3, "其他史"),
+    Vital(4, "查体"),
+    Lis(5, "化验"),
+    Pacs(6, "辅检"),
+    Disease(7, "诊断");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    QuestionTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static QuestionTypeEnum getEnum(Integer key) {
+        for (QuestionTypeEnum item : QuestionTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        QuestionTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 13 - 0
icss-service/src/main/java/com/diagbot/facade/DeptVitalFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.DeptVitalServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 17:16
+ */
+@Component
+public class DeptVitalFacade extends DeptVitalServiceImpl {
+}

+ 167 - 0
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -0,0 +1,167 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.AIServiceClient;
+import com.diagbot.client.bean.FeatureRate;
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.ResponseData;
+import com.diagbot.client.bean.SearchData;
+import com.diagbot.dto.PushDTO;
+import com.diagbot.entity.DeptInfo;
+import com.diagbot.entity.DeptVital;
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.entity.VitalOrder;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.vo.PushVO;
+import com.diagbot.web.DeptInfoController;
+import com.google.common.collect.Lists;
+import com.sun.corba.se.impl.ior.OldJIDLObjectKeyTemplate;
+import com.sun.xml.internal.ws.config.metro.dev.FeatureReader;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 11:18
+ */
+@Component
+public class PushFacade {
+    @Autowired
+    private AIServiceClient aiServiceClient;
+    @Autowired
+    private QuestionFacade questionFacade;
+    @Autowired
+    private DeptInfoFacade deptInfoFacade;
+    @Autowired
+    private DeptVitalFacade deptVitalFacade;
+    @Autowired
+    private VitalOrderFacade vitalOrderFacade;
+
+    /**
+     * 推理接口
+     *
+     * @param pushVO
+     * @return
+     */
+    public PushDTO push(PushVO pushVO) {
+        PushDTO pushDTO = new PushDTO();
+        SearchData searchData = new SearchData();
+        searchData.setAge(pushVO.getAge());
+        searchData.setSymptom(pushVO.getSymptom());
+        searchData.setVital(pushVO.getVital());
+        searchData.setLis(pushVO.getLis());
+        searchData.setPacs(pushVO.getPacs());
+        searchData.setPast(pushVO.getPast());
+        searchData.setOther(pushVO.getOther());
+        switch (pushVO.getSex()) {
+            case 1:
+                searchData.setSex("M");
+                break;
+            case 2:
+                searchData.setSex("F");
+                break;
+            case 3:
+                searchData.setSex("A");
+                break;
+            default:
+                throw new CommonException(CommonErrorCode.PARAM_ERROR, "性别参数错误");
+        }
+        String featureType = pushVO.getFeatureType();
+        String[] featureTypes = featureType.split(",|,");
+        Set<String> featureTypeSet = new HashSet(Arrays.asList(featureTypes));
+
+
+        searchData.setFeatureType(pushVO.getFeatureType());
+        searchData.setSysCode("1");
+        searchData.setLength(10);
+
+        Response<ResponseData> res = aiServiceClient.bayesPageData(searchData);
+        List<FeatureRate> symptom = res.getData().getSymptom();
+        List<FeatureRate> dis = res.getData().getDis();
+        List<FeatureRate> pacs = res.getData().getPacs();
+        List<FeatureRate> labs = res.getData().getLabs();
+
+        Map<String, Object> symptomMap = list2Map(symptom);
+        Map<String, Object> vitalMap = new HashMap<>();
+        Map<String, Object> disMap = list2Map(dis);
+        Map<String, Object> labMap = list2Map(labs);
+        Map<String, Object> pacsMap = list2Map(pacs);
+
+        //症状(主诉 type=1;现病史 type=2) 返回 tagName+id
+        if (featureTypeSet.contains("1") || featureTypeSet.contains("2")) {
+            QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper();
+            questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).in("tag_name", symptomMap.keySet()).eq("type", "2");
+            List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
+            Map<String, QuestionInfo> questionInfoMap = EntityUtil.makeEntityMap(questionInfoList, "tagName");
+            for (Map.Entry<String, Object> entry : symptomMap.entrySet()) {
+                entry.setValue(questionInfoMap.get(entry.getKey()).getId());
+            }
+            pushDTO.setSymptomMap(symptomMap);
+        }
+
+        pushDTO.setDisMap(disMap);
+        pushDTO.setPacsMap(pacsMap);
+        pushDTO.setLabMap(labMap);
+
+        //查体 返回模板
+        if (featureTypeSet.contains("4") && dis != null && dis.size() > 0) {
+            String deptName = dis.get(0).getExtraProperty();
+            QueryWrapper<DeptInfo> deptInfoQueryWrapper = new QueryWrapper<>();
+            deptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("name", deptName);
+            DeptInfo deptInfo = deptInfoFacade.getOne(deptInfoQueryWrapper);
+            if (deptInfo == null) {
+                throw new CommonException(CommonErrorCode.NOT_EXISTS, "科室信息不存在");
+            }
+
+            QueryWrapper<DeptVital> deptVitalQueryWrapper = new QueryWrapper<>();
+            deptVitalQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("dept_id", deptInfo.getId());
+            List<DeptVital> deptVitalList = deptVitalFacade.list(deptVitalQueryWrapper);
+            if (deptVitalList.size() > 0) {
+                Map<Long, DeptVital> deptVitalMap = EntityUtil.makeEntityMap(deptVitalList, "vitalId");
+                //排序
+                QueryWrapper<VitalOrder> vitalOrderQueryWrapper = new QueryWrapper<>();
+                vitalOrderQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).in("question_id", deptVitalMap.keySet()).orderByAsc("order_no");
+                List<VitalOrder> vitalOrderList = vitalOrderFacade.list(vitalOrderQueryWrapper);
+                Map<Long, VitalOrder> vitalOrderMap = EntityUtil.makeEntityMap(vitalOrderList, "id");
+                //标签列表
+                QueryWrapper<QuestionInfo> vitalQueryWrapper = new QueryWrapper<>();
+                vitalQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).in("id", deptVitalMap.keySet());
+                List<QuestionInfo> vitalList = questionFacade.list(vitalQueryWrapper);
+                Map<Long, QuestionInfo> vitalQuestionMap = EntityUtil.makeEntityMap(vitalList, "id");
+                for (Map.Entry<Long, VitalOrder> entry : vitalOrderMap.entrySet()) {
+                    QuestionInfo vitalQuestion = vitalQuestionMap.get(entry.getKey());
+                    if (vitalQuestion != null) {
+                        vitalMap.put(vitalQuestion.getTagName(), vitalQuestion);
+                    }
+                }
+                pushDTO.setVitalMap(vitalMap);
+            }
+        }
+        return pushDTO;
+    }
+
+    /**
+     * 将list 转换成 map
+     * @param list
+     * @return
+     */
+    public Map<String, Object> list2Map(List<FeatureRate> list) {
+        Map<String, Object> map = new HashMap<>();
+        for (FeatureRate featureRate : list) {
+            map.put(featureRate.getFeatureName(), null);
+        }
+        return map;
+    }
+}

+ 145 - 0
icss-service/src/main/java/com/diagbot/facade/TemplateInfoFacade.java

@@ -0,0 +1,145 @@
+package com.diagbot.facade;
+
+import java.util.List;
+
+import org.springframework.stereotype.Component;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.diagbot.dto.TemplateInfoDTO;
+import com.diagbot.entity.TemplateInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.TemplateInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.vo.TemplateInfoRevampVO;
+import com.diagbot.vo.TemplateInfoVO;
+import com.diagbot.vo.TemplateInfosIdVO;
+import com.diagbot.vo.TemplateInfosVO;
+
+/**
+ * @author wangfeng
+ * @Description: 病例模板
+ * @date 2018年11月16日 上午11:24:36
+ */
+@Component
+public class TemplateInfoFacade extends TemplateInfoServiceImpl {
+
+	/**
+	 * 
+	 * @param templateInfo
+	 * @return 医生病例模板信息
+	 */
+	public List<TemplateInfoDTO> findByDoctorIdTemplates(TemplateInfoVO templateInfoVO) {
+		//根据传入的医生id和部门id还有医院id在数据表中查出相应的模板数据
+		TemplateInfo templateInfo = new TemplateInfo();
+		templateInfo.setDoctorId(templateInfoVO.getDoctorId());//医生id
+		templateInfo.setHospitalDeptId(templateInfoVO.getHospitalDeptId());//部门id
+		templateInfo.setHospitalId(templateInfoVO.getHospitalId());//医院id
+		List<TemplateInfoDTO> data = findByDoctorIdTemplate(templateInfo);
+		
+		return data;
+	}
+
+	/**
+	 * 根据模板id 修改模板名
+	 * 
+	 * @param templateInfoRevampVO
+	 * @return
+	 */
+	public boolean updateByIdUsName(TemplateInfoRevampVO templateInfoRevampVO) {
+		//1.先判断数据是否存在有效
+		QueryWrapper<TemplateInfo> templateInfoFand = new QueryWrapper<>();
+		templateInfoFand.eq("is_deleted", IsDeleteEnum.N.getKey())
+		                .eq("id", templateInfoRevampVO.getId());
+		TemplateInfo data = getOne(templateInfoFand);
+		if (data == null) {
+			throw new CommonException(CommonErrorCode.NOT_EXISTS, "该模板不存在");
+		}
+		//2.再判断该医生下模板名是否重复重在
+		QueryWrapper<TemplateInfo> templates = new QueryWrapper<>();
+		       templates.eq("name", templateInfoRevampVO.getModeName())
+		                .eq("doctor_id", templateInfoRevampVO.getDoctorId())
+				        .eq("hospital_dept_id", templateInfoRevampVO.getHospitalDeptId())
+				        .eq("hospital_id", templateInfoRevampVO.getHospitalId())
+				        .eq("is_deleted", IsDeleteEnum.N.getKey());
+		TemplateInfo datas = getOne(templates);
+		if (datas != null) {
+			throw new CommonException(CommonErrorCode.NOT_EXISTS, "该模板名已存在");
+		}
+		//3.修改表数据的模板名字
+		TemplateInfo templateInfo = new TemplateInfo();
+		templateInfo.setId(templateInfoRevampVO.getId());//模板id
+		templateInfo.setName(templateInfoRevampVO.getModeName());//模板名称
+		templateInfo.setGmtModified(DateUtil.now());//修改时间
+		boolean res = updateById(templateInfo);
+		if (!res) {
+			throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+		}
+		
+		return res;
+	}
+
+	/**
+	 * 保存模板
+	 * 
+	 * @param templateInfoRevampVO
+	 * @return
+	 */
+	public boolean saveTemplateInfo(TemplateInfosVO templateInfosVO) {
+        //1.判断该医生下是否存在模板名相同的数据
+		TemplateInfo templateInfo = new TemplateInfo();
+		QueryWrapper<TemplateInfo> templateInfoFand = new QueryWrapper<>();
+		templateInfoFand.eq("name", templateInfosVO.getModeName())
+		                .eq("doctor_id", templateInfosVO.getDoctorId())
+				        .eq("hospital_dept_id", templateInfosVO.getHospitalDeptId())
+				        .eq("hospital_id", templateInfosVO.getHospitalId())
+				        .eq("is_deleted", IsDeleteEnum.N.getKey());
+		TemplateInfo data = getOne(templateInfoFand);
+		if (data != null) {
+			throw new CommonException(CommonErrorCode.NOT_EXISTS, "该模板名存在");
+		}
+		//2.获取传入的数据,保存到数据表中。
+		templateInfo.setCreator(templateInfosVO.getDoctorId().toString());//创建人id
+		templateInfo.setDoctorId(templateInfosVO.getDoctorId());//医生id
+		templateInfo.setGmtCreate(DateUtil.now());//创建时间
+		templateInfo.setHospitalDeptId(templateInfosVO.getHospitalDeptId());//部门id
+		templateInfo.setHospitalId(templateInfosVO.getHospitalId());//医院id
+		templateInfo.setPreview(templateInfosVO.getPreview());//文本的展示
+		templateInfo.setDataJson(templateInfosVO.getDataJson());//页面json
+		templateInfo.setName(templateInfosVO.getModeName());//模板名称
+		templateInfo.setType(templateInfosVO.getModeType());//模板类型
+		boolean res = save(templateInfo);
+		if (!res) {
+			throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED);
+		}
+		
+		return res;
+	}
+
+	/**
+	 * 根据模板id批量删除模板
+	 * 
+	 * @param templateInfosIdVO
+	 * @return
+	 */
+	public boolean cancelTemplateInfo(TemplateInfosIdVO templateInfosIdVO) {
+		//1.获取传入的ids数据
+		String ids = templateInfosIdVO.getIds();
+		//2.截取到最后一个
+		String substring = ids.substring(0, ids.length());
+		//System.out.println(substring);
+		//3.以逗号分割
+		String[] splitIds = substring.split(",");
+		//把分割的id数据传入对象中,在表中批量删除
+		UpdateWrapper<TemplateInfo> templateInfoNew = new UpdateWrapper<>();
+		templateInfoNew.in("id", splitIds)
+		               .eq("is_deleted", IsDeleteEnum.N.getKey())
+		               .set("is_deleted",IsDeleteEnum.Y.getKey());
+		boolean res = update(new TemplateInfo(), templateInfoNew);
+		
+		return res;
+	}
+
+}

+ 13 - 0
icss-service/src/main/java/com/diagbot/facade/VitalOrderFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.VitalOrderServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 17:17
+ */
+@Component
+public class VitalOrderFacade extends VitalOrderServiceImpl {
+}

+ 22 - 0
icss-service/src/main/java/com/diagbot/mapper/TemplateInfoMapper.java

@@ -0,0 +1,22 @@
+package com.diagbot.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.TemplateInfoDTO;
+import com.diagbot.entity.TemplateInfo;
+
+/**
+ * <p>
+ * 模板表 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-11-16
+ */
+public interface TemplateInfoMapper extends BaseMapper<TemplateInfo> {
+	
+	//根据医生id查询该医生保存的病例模板
+	public List<TemplateInfoDTO> findByDoctorIdTemplate(TemplateInfo templateInfo);
+
+}

+ 25 - 0
icss-service/src/main/java/com/diagbot/service/TemplateInfoService.java

@@ -0,0 +1,25 @@
+package com.diagbot.service;
+
+import com.diagbot.dto.TemplateInfoDTO;
+import com.diagbot.entity.TemplateInfo;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 模板表 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-11-16
+ */
+public interface TemplateInfoService extends IService<TemplateInfo> {
+	
+	//根据医生id查询该医生保存的病例模板
+	public List<TemplateInfoDTO> findByDoctorIdTemplate(TemplateInfo templateInfo);
+	
+	public boolean updateById(TemplateInfo templateInfo);
+
+}

+ 34 - 0
icss-service/src/main/java/com/diagbot/service/impl/TemplateInfoServiceImpl.java

@@ -0,0 +1,34 @@
+package com.diagbot.service.impl;
+
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.TemplateInfoDTO;
+import com.diagbot.entity.TemplateInfo;
+import com.diagbot.mapper.TemplateInfoMapper;
+import com.diagbot.service.TemplateInfoService;
+
+/**
+ * <p>
+ * 模板表 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-11-16
+ */
+@Service
+public class TemplateInfoServiceImpl extends ServiceImpl<TemplateInfoMapper, TemplateInfo> implements TemplateInfoService {
+
+	/**
+	 * 根据医生id查询该医生保存的病例模板
+	 */
+	@Override
+	public List<TemplateInfoDTO> findByDoctorIdTemplate(TemplateInfo templateInfo) {
+		
+		 return baseMapper.findByDoctorIdTemplate(templateInfo);
+	}
+	
+	
+}

+ 28 - 0
icss-service/src/main/java/com/diagbot/vo/PushVO.java

@@ -0,0 +1,28 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 13:38
+ */
+@Getter
+@Setter
+public class PushVO {
+    @NotNull(message = "请输入年龄")
+    private Integer age;
+    @NotNull(message = "请输入性别")
+    private Integer sex;
+    private String symptom;
+    private String diag;
+    private String vital;
+    private String lis;
+    private String pacs;
+    private String past;
+    private String other;
+    private String featureType;
+}

+ 39 - 0
icss-service/src/main/java/com/diagbot/vo/TemplateInfoRevampVO.java

@@ -0,0 +1,39 @@
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: 修改模板名入参
+ * @date 2018年11月16日 下午2:41:01
+ */
+@Getter
+@Setter
+public class TemplateInfoRevampVO {
+	@NotNull(message = "请输入模板id")
+	private Long id;//模板id
+	@NotBlank(message = "请输入模板名")
+	private String modeName;//模板名
+	/**
+     * 医生id
+     */
+	@NotNull(message = "请输入医生id")
+    private Long doctorId;
+
+    /**
+     * 医院编码
+     */
+	@NotNull(message = "请输入医院Id")
+    private Long hospitalId;
+	/**
+	 * 部门id
+	 */
+	@NotNull(message = "请输入部门id")
+	private Long hospitalDeptId;//部门id
+	
+}

+ 28 - 0
icss-service/src/main/java/com/diagbot/vo/TemplateInfoVO.java

@@ -0,0 +1,28 @@
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotNull;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class TemplateInfoVO {
+	
+	/**
+     * 医生id
+     */
+	@NotNull(message = "请输入医生id")
+    private Long doctorId;
+
+    /**
+     * 医院编码
+     */
+	@NotNull(message = "请输入医院Id")
+    private Long hospitalId;
+	/**
+	 * 部门id
+	 */
+	@NotNull(message = "请输入部门id")
+	private Long hospitalDeptId;//部门id
+}

+ 19 - 0
icss-service/src/main/java/com/diagbot/vo/TemplateInfosIdVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotBlank;
+
+import lombok.Getter;
+import lombok.Setter;
+/***
+ * 
+ * @author wangfeng
+ * @Description: 批量删除
+ * @date 2018年11月16日 下午4:57:25
+ */
+@Getter
+@Setter
+public class TemplateInfosIdVO {
+	@NotBlank(message = "请输入模板id")
+	private String ids;
+
+}

+ 32 - 0
icss-service/src/main/java/com/diagbot/vo/TemplateInfosVO.java

@@ -0,0 +1,32 @@
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: 病例保存
+ * @date 2018年11月16日 下午3:35:05
+ */
+@Getter
+@Setter
+public class TemplateInfosVO {
+	@NotBlank(message = "请输入模板名字")
+	private String modeName;//模板名字
+	@NotNull(message = "请输入医生id")
+	private Long doctorId;//医生id
+	@NotNull(message = "请输入医院id")
+	private Long hospitalId;//医院id
+	@NotNull(message = "请输入部门id")
+	private Long hospitalDeptId;//部门id
+	@NotBlank(message = "请输入模板类型")
+	private String modeType;//模板类型
+	@NotBlank(message = "请输入预览文本")
+	private String preview;//预览文本
+	@NotBlank(message = "请输入模板数据")
+	private String dataJson;//模板数据
+}

+ 37 - 0
icss-service/src/main/java/com/diagbot/web/PushController.java

@@ -0,0 +1,37 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.PushFacade;
+import com.diagbot.vo.PushVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 11:17
+ */
+@RestController
+@RequestMapping("/push")
+@Api(value = "推理相关API", tags = { "推理相关API" })
+public class PushController {
+    @Autowired
+    PushFacade pushFacade;
+    @ApiOperation(value = "推理接口[by:zhaops]",
+            notes = "age: 年龄(必填)<br>" +
+                    "sex:性别,1:男,2:女(必填)<br>")
+    @PostMapping("/push")
+    @SysLogger("push")
+    public RespDTO<PushDTO> push(@RequestBody @Valid PushVO pushVO) {
+        return RespDTO.onSuc(pushFacade.push(pushVO));
+    }
+}

+ 89 - 0
icss-service/src/main/java/com/diagbot/web/TemplateInfoController.java

@@ -0,0 +1,89 @@
+package com.diagbot.web;
+
+
+import java.util.List;
+
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TemplateInfoDTO;
+import com.diagbot.entity.TemplateInfo;
+import com.diagbot.facade.TemplateInfoFacade;
+import com.diagbot.vo.TemplateInfoRevampVO;
+import com.diagbot.vo.TemplateInfoVO;
+import com.diagbot.vo.TemplateInfosIdVO;
+import com.diagbot.vo.TemplateInfosVO;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description:  病例模板表 前端控制器
+ * @date 2018年11月16日 上午9:14:51
+ */
+@RestController
+@RequestMapping("/templateInfo")
+@Api(value = "病例模板API[by:wangfeng]", tags = { "病例模板API" })
+@SuppressWarnings("unchecked")
+public class TemplateInfoController {
+	
+	@Autowired
+	TemplateInfoFacade templateInfoFacade;
+	
+    @ApiOperation(value = "根据医生id、医院id、部门id返回病例模板内容[by:wangfeng]",
+    		notes = "doctorId: 医生id<br>" +"dospitalId:医院编码<br>"+"deptId:部门id<br>")
+    @PostMapping("/getByDoctorIdTemplates")
+    @SysLogger("getByDoctorIdTemplates")
+    @Transactional
+    public RespDTO<TemplateInfo> getByDoctorIdTemplate(@Valid @RequestBody TemplateInfoVO templateInfoVO) {
+
+        List<TemplateInfoDTO> data = templateInfoFacade.findByDoctorIdTemplates(templateInfoVO);
+        
+        return RespDTO.onSuc(data);
+    }
+   
+    @ApiOperation(value = "根据模板id修改模板名称[by:wangfeng]",notes = "id: 模板id<br>" +"name:模板名称<br>")
+    @PostMapping("/updateByIdUsNames")
+    @SysLogger("updateByIdUsNames")
+    @Transactional
+    public RespDTO<Boolean> updateByIdUsNames(@Valid @RequestBody TemplateInfoRevampVO templateInfoRevampVO ){
+    	
+    	boolean res = templateInfoFacade.updateByIdUsName(templateInfoRevampVO);
+    	
+    	return RespDTO.onSuc(res);
+    }
+
+
+    @ApiOperation(value = "保存病例模板[by:wangfeng]",notes = "保存病例模板")
+    @PostMapping("/saveTemplateInfo")
+    @SysLogger("saveTemplateInfo")
+    @Transactional
+    public RespDTO<Boolean> saveTemplateInfo(@Valid @RequestBody TemplateInfosVO templateInfosVO){
+    	
+        boolean res = templateInfoFacade.saveTemplateInfo(templateInfosVO);
+    	
+    	return RespDTO.onSuc(res);
+    }
+    
+    @ApiOperation(value = "根据模板id批量删除病例模板[by:wangfeng]",notes = "ids: 模板ids<br>'ids':'1,2,3,4,5,6'")
+    @PostMapping("/cancelTemplateInfos")
+    @SysLogger("cancelTemplateInfos")
+    @Transactional
+    public RespDTO<Boolean> cancelTemplateInfos(@Valid @RequestBody TemplateInfosIdVO templateInfosIdVO){
+    	
+		boolean res = templateInfoFacade.cancelTemplateInfo(templateInfosIdVO);
+    	
+    	return RespDTO.onSuc(res);
+    } 
+    
+}

+ 2 - 0
icss-service/src/main/resources/mapper/QuestionDetailMapper.xml

@@ -6,6 +6,8 @@
     <resultMap id="BaseResultMap" type="com.diagbot.entity.QuestionDetail">
         <id column="id" property="id" />
         <result column="name" property="name" />
+        <result column="label_prefix" property="labelPrefix" />
+        <result column="label_suffix" property="labelSuffix" />
         <result column="question_id" property="questionId" />
         <result column="order_no" property="orderNo" />
         <result column="default_select" property="defaultSelect" />

+ 1 - 3
icss-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -12,16 +12,14 @@
         <result column="age_end" property="ageEnd" />
         <result column="type" property="type" />
         <result column="control_type" property="controlType" />
-        <result column="input_format" property="inputFormat" />
         <result column="sub_type" property="subType" />
-        <result column="is_group" property="isGroup" />
+        <result column="tag_type" property="tagType" />
         <result column="add_line" property="addLine" />
         <result column="label_prefix" property="labelPrefix" />
         <result column="label_suffix" property="labelSuffix" />
         <result column="min_value" property="minValue" />
         <result column="max_value" property="maxValue" />
         <result column="judge_type" property="judgeType" />
-        <result column="tag_questions" property="tagQuestions" />
         <result column="copy_type" property="copyType" />
         <result column="remark" property="remark" />
     </resultMap>

+ 2 - 2
icss-service/src/main/resources/mapper/QuestionMappingMapper.xml

@@ -13,8 +13,8 @@
         <result column="parent_question" property="parentQuestion" />
         <result column="son_question" property="sonQuestion" />
         <result column="order_no" property="orderNo" />
-        <result column="show_type" property="showType" />
-        <result column="type" property="type" />
+        <result column="symptom_type" property="symptomType" />
+        <result column="exclusion_type" property="exclusionType" />
         <result column="remark" property="remark" />
     </resultMap>
 

+ 59 - 0
icss-service/src/main/resources/mapper/TemplateInfoMapper.xml

@@ -0,0 +1,59 @@
+<?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.TemplateInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.TemplateInfo">
+        <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="name" property="name" />
+        <result column="doctor_id" property="doctorId" />
+        <result column="hospital_dept_id" property="hospitalDeptId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="type" property="type" />
+        <result column="preview" property="preview" />
+        <result column="data_json" property="dataJson" />
+        <result column="remark" property="remark" />
+    </resultMap>
+    <!--根据医生id查询该医生保存的病例模板 -->
+	<select id="findByDoctorIdTemplate" resultType="com.diagbot.dto.TemplateInfoDTO">
+	SELECT
+		id AS id,
+		gmt_create AS gmtCreate,
+		creator AS creator,
+		NAME AS modeName,
+		doctor_id AS doctorId,
+		hospital_id AS hospitalId,
+		hospital_dept_id As hospitalDeptId,
+		TYPE AS modeType,
+		preview AS preview,
+		data_json AS dataJson,
+		remark AS remark
+	FROM
+		icss_template_info WHERE is_deleted = "N"
+		<if test="id != null and id != ''">
+			and id = #{id}
+		</if>
+		<if test="name != null and name != ''">
+			and name = #{name}
+		</if>
+	    <if test="hospitalDeptId != null and hospitalDeptId != ''">
+			and hospital_dept_id = #{hospitalDeptId}
+		</if>
+		<if test="doctorId != null and doctorId != ''">
+			and doctor_id = #{doctorId}
+		</if>
+		<if test="hospitalId != null and hospitalId != ''">
+			and hospital_id = #{hospitalId}
+		</if>
+		<if test="type != null and type != ''">
+			and type = #{type}
+		</if>
+		ORDER BY gmt_create DESC
+
+	</select>
+</mapper>