瀏覽代碼

Merge branch 'develop' into dev/mrman0609_standard_case

gaodm 5 年之前
父節點
當前提交
751c5eba7d
共有 31 個文件被更改,包括 1827 次插入23 次删除
  1. 1062 0
      docs/037.20200615病历条目和质控类型关心映射/qc_init.sql
  2. 11 0
      docs/037.20200615病历条目和质控类型关心映射/qc_initv1.3.4.sql
  3. 3 1
      ltkg-service/src/main/java/com/diagbot/facade/KgFacade.java
  4. 7 2
      ltkg-service/src/main/java/com/diagbot/web/KgController.java
  5. 1 1
      ltkg-service/src/main/resources/mapper/KgMapper.xml
  6. 1 0
      mrman-service/src/main/java/com/diagbot/dto/GetUpdateInfoDetialDTO.java
  7. 10 0
      mrman-service/src/main/java/com/diagbot/dto/QcCasesEntryAllDTO.java
  8. 28 0
      mrman-service/src/main/java/com/diagbot/dto/QcEntryTypeDTO.java
  9. 27 0
      mrman-service/src/main/java/com/diagbot/dto/QcEntryTypeDetailDTO.java
  10. 26 0
      mrman-service/src/main/java/com/diagbot/dto/QcTypeByEntryDTO.java
  11. 18 0
      mrman-service/src/main/java/com/diagbot/dto/QcTypeSimpDTO.java
  12. 10 0
      mrman-service/src/main/java/com/diagbot/entity/QcCasesEntry.java
  13. 7 3
      mrman-service/src/main/java/com/diagbot/facade/CasesEntryHospitalFacade.java
  14. 134 15
      mrman-service/src/main/java/com/diagbot/facade/QcCacesEntryFacade.java
  15. 4 0
      mrman-service/src/main/java/com/diagbot/mapper/CasesEntryHospitalMapper.java
  16. 18 0
      mrman-service/src/main/java/com/diagbot/mapper/QcCasesEntryMapper.java
  17. 3 0
      mrman-service/src/main/java/com/diagbot/service/CasesEntryHospitalService.java
  18. 18 0
      mrman-service/src/main/java/com/diagbot/service/QcCasesEntryService.java
  19. 6 0
      mrman-service/src/main/java/com/diagbot/service/impl/CasesEntryHospitalServiceImpl.java
  20. 34 0
      mrman-service/src/main/java/com/diagbot/service/impl/QcCasesEntryServiceImpl.java
  21. 10 0
      mrman-service/src/main/java/com/diagbot/vo/InsertByHospitalVO.java
  22. 10 0
      mrman-service/src/main/java/com/diagbot/vo/QcCasesEntryAllVO.java
  23. 18 0
      mrman-service/src/main/java/com/diagbot/vo/QcEntryTypeIndexVO.java
  24. 28 0
      mrman-service/src/main/java/com/diagbot/vo/QcEntryTypePageVO.java
  25. 22 0
      mrman-service/src/main/java/com/diagbot/vo/QcEntryTypeSaveVO.java
  26. 18 0
      mrman-service/src/main/java/com/diagbot/vo/QcEntryTypeVO.java
  27. 14 0
      mrman-service/src/main/java/com/diagbot/vo/QcTypeHospitalVO.java
  28. 105 0
      mrman-service/src/main/java/com/diagbot/web/QcEntryTypeController.java
  29. 26 0
      mrman-service/src/main/resources/mapper/CasesEntryHospitalMapper.xml
  30. 147 0
      mrman-service/src/main/resources/mapper/QcCasesEntryMapper.xml
  31. 1 1
      mrman-service/src/test/java/com/diagbot/CodeGeneration.java

文件差異過大導致無法顯示
+ 1062 - 0
docs/037.20200615病历条目和质控类型关心映射/qc_init.sql


+ 11 - 0
docs/037.20200615病历条目和质控类型关心映射/qc_initv1.3.4.sql

@@ -0,0 +1,11 @@
+use `qc`;
+
+ALTER TABLE `qc_cases_entry` ADD `dev_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '开发状态标识: 0-未开发  1-已开发' AFTER `rule_type`;
+ALTER TABLE `qc_cases_entry` ADD `accuracy_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '准确率类型:0-极高,1-高,2-中,3-低' AFTER `dev_type`;
+
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('291', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '15', '未开发', '0', '1', '0', '开发状态标识');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('292', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '15', '已开发', '1', '1', '1', '开发状态标识');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('293', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '极高', '0', '1', '0', '准确率类型');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('294', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '高', '1', '1', '1', '准确率类型');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('295', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '中', '2', '1', '2', '准确率类型');
+INSERT INTO `qc`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('296', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '低', '3', '1', '3', '准确率类型');

+ 3 - 1
ltkg-service/src/main/java/com/diagbot/facade/KgFacade.java

@@ -119,7 +119,9 @@ public class KgFacade extends KgServiceImpl {
                 && (kgTreeVO.getSubType() == 1 || kgTreeVO.getSubType() == 2 || kgTreeVO.getSubType() == 3))
                 || (kgTreeVO.getType() == 2 && (kgTreeVO.getSubType() == 0))
                 || (kgTreeVO.getType() == 3 && (kgTreeVO.getSubType() == 0))
-                || (kgTreeVO.getType() == 4 && (kgTreeVO.getSubType() == 0))) {
+                || (kgTreeVO.getType() == 4 && (kgTreeVO.getSubType() == 0))
+                || (kgTreeVO.getType() == 5 && (kgTreeVO.getSubType() == 0))
+                || (kgTreeVO.getType() == 6 && (kgTreeVO.getSubType() == 0))) {
             // KgQueryVO kgQueryVO = new KgQueryVO();
             // kgQueryVO.setLabelName("诊断依据");
             // kgQueryVO.setInputStr("诊断依据");

+ 7 - 2
ltkg-service/src/main/java/com/diagbot/web/KgController.java

@@ -57,8 +57,13 @@ public class KgController {
     }
 
     @ApiOperation(value = "获取树形分类",
-            notes = "获取树形分类(疾病ICD10:t:1,st:1)" +
-                    "(疾病科室:t:1,st:2)")
+            notes = "获取树形分类(疾病ICD10:t:1,st:1)<br>" +
+                    "(疾病科室:t:1,st:2)<br>" +
+                    "(药品:t:2,st:0)<br>" +
+                    "(症状:t:3,st:0)<br>" +
+                    "(手术和操作:t:4,st:0)<br>" +
+                    "(实验室检查:t:5,st:0)<br>" +
+                    "(辅助检查:t:6,st:0)<br>")
     @PostMapping("/getTree")
     @SysLogger("getTree")
     @Cacheable(value = KGTREECACHE, key = "'kgtree:t_' + #kgTreeVO.type + '_st_' + #kgTreeVO.subType")

+ 1 - 1
ltkg-service/src/main/resources/mapper/KgMapper.xml

@@ -38,7 +38,7 @@
     <select id="getGraph" parameterType='com.diagbot.vo.KgQueryVO' resultMap="GraphResultMap">
         MATCH (n:${labelName})-[r]->(m)
         where n.name = #{inputStr}
-        OPTIONAL MATCH p=(m)-[]->(o) where head(Labels(m)) in ["疾病","症状","药品通用名"]
+        OPTIONAL MATCH p=(m)-[]->(o) where head(Labels(m)) in ["疾病","症状","药品通用名","手术和操作","实验室检查","辅助检查"]
         RETURN head(Labels(n)) as sLabel,n.name as sName,Type (r) as rType, head(Labels(m)) as eLabel,m.name as eName, count(p) as pCount
         ORDER BY rType
         LIMIT 100

+ 1 - 0
mrman-service/src/main/java/com/diagbot/dto/GetUpdateInfoDetialDTO.java

@@ -16,5 +16,6 @@ public class GetUpdateInfoDetialDTO {
     private String hospitalName;
     private BigDecimal score;
     private Integer isUsed;
+    private Integer isReject;
     private String msg;
 }

+ 10 - 0
mrman-service/src/main/java/com/diagbot/dto/QcCasesEntryAllDTO.java

@@ -45,6 +45,16 @@ public class QcCasesEntryAllDTO {
      */
     private Integer ruleType;
 
+    /**
+     * 开发状态标识: 0-未开发  1-已开发
+     */
+    private Integer devType;
+
+    /**
+     * 准确率类型:0-极高,1-高,2-中,3-低
+     */
+    private Integer accuracyType;
+
     private String precond;
 
     /**

+ 28 - 0
mrman-service/src/main/java/com/diagbot/dto/QcEntryTypeDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/3/30 16:54
+ */
+@Getter
+@Setter
+public class QcEntryTypeDTO {
+    // 医院id
+    private Long hospitalId;
+    // 条目id
+    private Long entryId;
+    // 条目名称
+    private String entryName;
+    // 质控类型集
+    private String typeStr;
+    // 条目编码
+    private String code;
+    // 所属模块
+    private String casesName;
+    // 所属模块
+    private String casesId;
+}

+ 27 - 0
mrman-service/src/main/java/com/diagbot/dto/QcEntryTypeDetailDTO.java

@@ -0,0 +1,27 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/3/30 16:54
+ */
+@Getter
+@Setter
+public class QcEntryTypeDetailDTO {
+    // 医院id
+    private Long hospitalId;
+    // 条目id
+    private Long entryId;
+    // 模块名称
+    private String casesName;
+    // 条目名称
+    private String entryName;
+    // 已选择质控类型列表
+    private List<QcTypeSimpDTO> qcTypeSimpDTOList = new ArrayList<>();
+}

+ 26 - 0
mrman-service/src/main/java/com/diagbot/dto/QcTypeByEntryDTO.java

@@ -0,0 +1,26 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/3/30 16:54
+ */
+@Getter
+@Setter
+public class QcTypeByEntryDTO {
+    // 医院id
+    private Long hospitalId;
+    // 条目id
+    private Long entryId;
+    // 条目名称
+    private String entryName;
+    // 条目名称
+    private String casesName;
+    // 质控类型名称
+    private String typeName;
+    // 质控类型id
+    private Long typeId;
+}

+ 18 - 0
mrman-service/src/main/java/com/diagbot/dto/QcTypeSimpDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Getter
+@Setter
+public class QcTypeSimpDTO {
+    // 质控id
+    private Long id;
+    // 质控类型名称
+    private String name;
+}

+ 10 - 0
mrman-service/src/main/java/com/diagbot/entity/QcCasesEntry.java

@@ -50,6 +50,16 @@ public class QcCasesEntry implements Serializable {
      */
     private Integer ruleType;
 
+    /**
+     * 开发状态标识: 0-未开发  1-已开发
+     */
+    private Integer devType;
+
+    /**
+     * 准确率类型:0-极高,1-高,2-中,3-低
+     */
+    private Integer accuracyType;
+
     private String precond;
 
     /**

+ 7 - 3
mrman-service/src/main/java/com/diagbot/facade/CasesEntryHospitalFacade.java

@@ -88,6 +88,7 @@ public class CasesEntryHospitalFacade extends CasesEntryHospitalServiceImpl {
                     getAllByHospitalDetialDTO.setModeName(qcCasesEntry.getModeName());
                     getAllByHospitalDetialDTO.setMsg(casesEntryHospitalMap.get(qcCasesEntry.getId()).getMsg());
                     getAllByHospitalDetialDTO.setIsUsed(casesEntryHospitalMap.get(qcCasesEntry.getId()).getIsUsed());
+                    getAllByHospitalDetialDTO.setIsReject(casesEntryHospitalMap.get(qcCasesEntry.getId()).getIsReject());
                     getAllByHospitalDetialDTO.setScore(casesEntryHospitalMap.get(qcCasesEntry.getId()).getScore());
                     getAllByHospitalDetialDTO.setPrecond(qcCasesEntry.getPrecond());
                     getAllByHospitalDetialDTO.setName(qcCasesEntry.getName());
@@ -114,11 +115,14 @@ public class CasesEntryHospitalFacade extends CasesEntryHospitalServiceImpl {
         casesEntryHospitalQueryWrapper
                 .eq("is_deleted",IsDeleteEnum.N.getKey())
                 .in("hospital_id",updateByHospitalVO.getHospitalIds());
-        this.remove(casesEntryHospitalQueryWrapper);
+
+        boolean res = this.remove(casesEntryHospitalQueryWrapper);
         //添加新的
-        casesEntryHospitalService.saveBatch(updateByHospitalVO.getCasesEntryHospitals());
+        if(res){
+           res = casesEntryHospitalService.saveAll(updateByHospitalVO.getCasesEntryHospitals());
+        }
 
-        return true;
+        return res;
     }
 
     /**

+ 134 - 15
mrman-service/src/main/java/com/diagbot/facade/QcCacesEntryFacade.java

@@ -7,22 +7,39 @@ import com.diagbot.dto.GetUpdateInfoDTO;
 import com.diagbot.dto.GetUpdateInfoDetialDTO;
 import com.diagbot.dto.QcCasesEntryAllDTO;
 import com.diagbot.dto.QcCasesEntrySimpleDTO;
+import com.diagbot.dto.QcEntryTypeDTO;
+import com.diagbot.dto.QcEntryTypeDetailDTO;
 import com.diagbot.dto.QcHospitalInfoAllDTO;
+import com.diagbot.dto.QcTypeByEntryDTO;
+import com.diagbot.dto.QcTypeSimpDTO;
 import com.diagbot.entity.CasesEntryHospital;
 import com.diagbot.entity.QcCasesEntry;
 import com.diagbot.entity.QcQuestionEntry;
 import com.diagbot.entity.QcTypeCasesEntry;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.QcTypeCasesEntryService;
 import com.diagbot.service.impl.QcCasesEntryServiceImpl;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.UserUtils;
 import com.diagbot.vo.GetUpdateInfoVO;
 import com.diagbot.vo.QcCasesEntryAllVO;
 import com.diagbot.vo.QcCasesEntryIndexVO;
 import com.diagbot.vo.QcEntryHospitalVO;
+import com.diagbot.vo.QcEntryTypeIndexVO;
+import com.diagbot.vo.QcEntryTypePageVO;
+import com.diagbot.vo.QcEntryTypeSaveVO;
+import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -44,6 +61,11 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
     QcQuestionEntryFacade qcQuestionEntryFacade;
     @Autowired
     QcTypeCasesEntryFacade qcTypeCasesEntryFacade;
+    @Autowired
+    @Qualifier("qcTypeCasesEntryServiceImpl")
+    QcTypeCasesEntryService qcTypeCasesEntryService;
+    @Autowired
+    QcTypeFacade qcTypeFacade;
 
     /**
      * 分页获取病例条目
@@ -51,7 +73,7 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
      * @param qcCasesEntryAllVO
      * @return
      */
-    public IPage<QcCasesEntryAllDTO> getAll(QcCasesEntryAllVO qcCasesEntryAllVO){
+    public IPage<QcCasesEntryAllDTO> getAll(QcCasesEntryAllVO qcCasesEntryAllVO) {
         return this.getAllQcCasesEntry(qcCasesEntryAllVO);
     }
 
@@ -61,7 +83,7 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
      * @param qcCasesEntryIndexVO
      * @return
      */
-    public IPage<QcCasesEntryAllDTO> getAllQcCasesEntryIndexFac(QcCasesEntryIndexVO qcCasesEntryIndexVO){
+    public IPage<QcCasesEntryAllDTO> getAllQcCasesEntryIndexFac(QcCasesEntryIndexVO qcCasesEntryIndexVO) {
         return this.getAllQcCasesEntryIndex(qcCasesEntryIndexVO);
     }
 
@@ -71,29 +93,30 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
      * @param getUpdateInfoVO
      * @return
      */
-    public List<GetUpdateInfoDTO>  getUpdateInfo(GetUpdateInfoVO getUpdateInfoVO){
+    public List<GetUpdateInfoDTO> getUpdateInfo(GetUpdateInfoVO getUpdateInfoVO) {
         QueryWrapper<QcCasesEntry> qcCasesEntryQueryWrapper = new QueryWrapper<>();
         qcCasesEntryQueryWrapper
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id",getUpdateInfoVO.getId());
+                .eq("id", getUpdateInfoVO.getId());
         QcCasesEntry qcCasesEntry = qcCacesEntryFacade.getOne(qcCasesEntryQueryWrapper);
         QueryWrapper<CasesEntryHospital> casesEntryHospitalQueryWrapper = new QueryWrapper<>();
         casesEntryHospitalQueryWrapper
-                .eq("is_deleted",IsDeleteEnum.N.getKey())
-                .eq("cases_entry_id",qcCasesEntry.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("cases_entry_id", qcCasesEntry.getId())
                 .groupBy("hospital_id");
         List<CasesEntryHospital> casesEntryHospitals = casesEntryHospitalFacade.list(casesEntryHospitalQueryWrapper);
         List<GetUpdateInfoDTO> getUpdateInfoDTOS = new ArrayList<>();
         GetUpdateInfoDTO getUpdateInfoDTO = new GetUpdateInfoDTO();
         List<GetUpdateInfoDetialDTO> getUpdateInfoDetialDTOS = new ArrayList<>();
         GetUpdateInfoDetialDTO getUpdateInfoDetialDTO = new GetUpdateInfoDetialDTO();
-        BeanUtil.copyProperties(qcCasesEntry,getUpdateInfoDTO);
-        Map<Long,String> hospitalNameMap = qcHospitalInfoFacade.getHospitalInfoAll().stream().collect(Collectors.toMap(QcHospitalInfoAllDTO::getId,qcHospitalInfoAllDTO -> qcHospitalInfoAllDTO.getName()));
-        for (CasesEntryHospital casesEntryHospital: casesEntryHospitals) {
+        BeanUtil.copyProperties(qcCasesEntry, getUpdateInfoDTO);
+        Map<Long, String> hospitalNameMap = qcHospitalInfoFacade.getHospitalInfoAll().stream().collect(Collectors.toMap(QcHospitalInfoAllDTO::getId, qcHospitalInfoAllDTO -> qcHospitalInfoAllDTO.getName()));
+        for (CasesEntryHospital casesEntryHospital : casesEntryHospitals) {
             getUpdateInfoDetialDTO = new GetUpdateInfoDetialDTO();
             getUpdateInfoDetialDTO.setHospitalName(hospitalNameMap.get(casesEntryHospital.getHospitalId()));
             getUpdateInfoDetialDTO.setMsg(casesEntryHospital.getMsg());
             getUpdateInfoDetialDTO.setIsUsed(casesEntryHospital.getIsUsed());
+            getUpdateInfoDetialDTO.setIsReject(casesEntryHospital.getIsReject());
             getUpdateInfoDetialDTO.setScore(casesEntryHospital.getScore());
             getUpdateInfoDetialDTOS.add(getUpdateInfoDetialDTO);
             getUpdateInfoDTO.setGetUpdateInfoDetialDTOS(getUpdateInfoDetialDTOS);
@@ -108,24 +131,24 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
      * @param getUpdateInfoVO
      * @return
      */
-    public Boolean deleteQcCasesEntry(GetUpdateInfoVO getUpdateInfoVO){
-       //删除条目
+    public Boolean deleteQcCasesEntry(GetUpdateInfoVO getUpdateInfoVO) {
+        //删除条目
         QueryWrapper<QcCasesEntry> qcCasesEntryQueryWrapper = new QueryWrapper<>();
-        qcCasesEntryQueryWrapper.eq("id",getUpdateInfoVO.getId());
+        qcCasesEntryQueryWrapper.eq("id", getUpdateInfoVO.getId());
         boolean res = this.remove(qcCasesEntryQueryWrapper);
         //删除明细
         QueryWrapper<CasesEntryHospital> casesEntryHospitalQueryWrapper = new QueryWrapper<>();
-        casesEntryHospitalQueryWrapper.eq("cases_entry_id",getUpdateInfoVO.getId());
+        casesEntryHospitalQueryWrapper.eq("cases_entry_id", getUpdateInfoVO.getId());
         casesEntryHospitalFacade.remove(casesEntryHospitalQueryWrapper);
         //删除模块
         UpdateWrapper<QcQuestionEntry> qcQuescQuestionInfoUpdate = new UpdateWrapper<>();
         qcQuescQuestionInfoUpdate
-                .eq("cases_entry_id",getUpdateInfoVO.getId());
+                .eq("cases_entry_id", getUpdateInfoVO.getId());
         qcQuestionEntryFacade.remove(qcQuescQuestionInfoUpdate);
         //删除质控类型
         UpdateWrapper<QcTypeCasesEntry> qcTypeCasesEntryUpdateWrapper = new UpdateWrapper<>();
         qcTypeCasesEntryUpdateWrapper
-                .eq("case_entry_id",getUpdateInfoVO.getId());
+                .eq("case_entry_id", getUpdateInfoVO.getId());
         qcTypeCasesEntryFacade.remove(qcTypeCasesEntryUpdateWrapper);
         return res;
 
@@ -134,4 +157,100 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
     public List<QcCasesEntrySimpleDTO> getEntryByHospitalFac(QcEntryHospitalVO qcEntryHospitalVO) {
         return this.getEntryByHospital(qcEntryHospitalVO);
     }
+
+
+    /********************************质控条目和质控类型关系映射开始******************************************/
+    /**
+     * 质控条目和质控类型关系映射【分页】
+     *
+     * @param qcEntryTypePageVO
+     * @returnFac
+     */
+    public IPage<QcEntryTypeDTO> entryTypePageFac(QcEntryTypePageVO qcEntryTypePageVO) {
+        return this.entryTypePage(qcEntryTypePageVO);
+    }
+
+    /**
+     * 质控条目和质控类型关系映射【明细】
+     *
+     * @param qcEntryTypeVO
+     * @returnFac
+     */
+    public QcEntryTypeDetailDTO getByIdFac(QcEntryTypeVO qcEntryTypeVO) {
+        QcEntryTypeDetailDTO res = new QcEntryTypeDetailDTO();
+        List<QcTypeByEntryDTO> qcEntryTypeDTOList = entryTypeDetail(qcEntryTypeVO);
+        if (ListUtil.isNotEmpty(qcEntryTypeDTOList)) {
+            BeanUtil.copyProperties(qcEntryTypeDTOList.get(0), res);
+            List<QcTypeSimpDTO> qcTypeSimpDTOList = new ArrayList<>();
+            qcEntryTypeDTOList.forEach(r -> {
+                QcTypeSimpDTO qcTypeSimpDTO = new QcTypeSimpDTO();
+                qcTypeSimpDTO.setId(r.getTypeId());
+                qcTypeSimpDTO.setName(r.getTypeName());
+                qcTypeSimpDTOList.add(qcTypeSimpDTO);
+            });
+            res.setQcTypeSimpDTOList(qcTypeSimpDTOList);
+        } else {
+            QcCasesEntry qcCasesEntry = this.getOne(new QueryWrapper<QcCasesEntry>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("id", qcEntryTypeVO.getEntryId())
+            );
+            if (qcCasesEntry == null) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前质控条目不存在");
+            }
+            res.setEntryName(qcCasesEntry.getName());
+            res.setHospitalId(qcEntryTypeVO.getHospitalId());
+            res.setEntryId(qcEntryTypeVO.getEntryId());
+            res.setCasesName(qcCasesEntry.getCasesName());
+        }
+        return res;
+    }
+
+    /**
+     * 根据医院和条目检索未被选择的质控类型
+     *
+     * @param qcEntryTypeIndexVO
+     * @return
+     */
+    public List<QcTypeSimpDTO> indexFac(QcEntryTypeIndexVO qcEntryTypeIndexVO){
+        return indexQcType(qcEntryTypeIndexVO);
+    }
+
+    /**
+     * 保存
+     * @param qcEntryTypeSaveVO
+     * @return
+     */
+    public Boolean saveOrUpdate(QcEntryTypeSaveVO qcEntryTypeSaveVO) {
+        // 删除映射关系
+        this.deleteQcTypeEntry(qcEntryTypeSaveVO);
+        // 新增映射关系
+        if (ListUtil.isNotEmpty(qcEntryTypeSaveVO.getTypeIdList())) {
+            List<QcTypeCasesEntry> list = new ArrayList<>();
+            Date now = DateUtil.now();
+            String person = UserUtils.getCurrentPrincipleID();
+            for (Long id : qcEntryTypeSaveVO.getTypeIdList()) {
+                QcTypeCasesEntry qcTypeCasesEntry = new QcTypeCasesEntry();
+                qcTypeCasesEntry.setTypeId(id);
+                qcTypeCasesEntry.setCaseEntryId(qcEntryTypeSaveVO.getEntryId());
+                qcTypeCasesEntry.setGmtCreate(now);
+                qcTypeCasesEntry.setGmtModified(now);
+                qcTypeCasesEntry.setCreator(person);
+                qcTypeCasesEntry.setModifier(person);
+                list.add(qcTypeCasesEntry);
+            }
+            qcTypeCasesEntryService.saveBatch(list);
+        }
+        return true;
+    }
+
+    /**
+     * 根据医院获取质控类型列表
+     *
+     * @param qcTypeHospitalVO
+     * @return
+     */
+    public List<QcTypeSimpDTO> getTypeByHospitalFac(QcTypeHospitalVO qcTypeHospitalVO) {
+        return this.getTypeByHospital(qcTypeHospitalVO);
+    }
+    /********************************质控条目和质控类型关系映射结束******************************************/
 }

+ 4 - 0
mrman-service/src/main/java/com/diagbot/mapper/CasesEntryHospitalMapper.java

@@ -2,6 +2,9 @@ package com.diagbot.mapper;
 
 import com.diagbot.entity.CasesEntryHospital;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface CasesEntryHospitalMapper extends BaseMapper<CasesEntryHospital> {
 
+    boolean saveAll(@Param("list") List<CasesEntryHospital> casesEntryHospitals);
 }

+ 18 - 0
mrman-service/src/main/java/com/diagbot/mapper/QcCasesEntryMapper.java

@@ -5,10 +5,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.QcCasesEntryAllDTO;
 import com.diagbot.dto.QcCasesEntryDTO;
 import com.diagbot.dto.QcCasesEntrySimpleDTO;
+import com.diagbot.dto.QcEntryTypeDTO;
+import com.diagbot.dto.QcTypeByEntryDTO;
+import com.diagbot.dto.QcTypeSimpDTO;
 import com.diagbot.entity.QcCasesEntry;
 import com.diagbot.vo.QcCasesEntryAllVO;
 import com.diagbot.vo.QcCasesEntryIndexVO;
 import com.diagbot.vo.QcEntryHospitalVO;
+import com.diagbot.vo.QcEntryTypeIndexVO;
+import com.diagbot.vo.QcEntryTypePageVO;
+import com.diagbot.vo.QcEntryTypeSaveVO;
+import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
 import com.diagbot.vo.QcTypeIndexVO;
 import org.apache.ibatis.annotations.Param;
 
@@ -41,4 +49,14 @@ public interface QcCasesEntryMapper extends BaseMapper<QcCasesEntry> {
     public List<QcCasesEntrySimpleDTO> index(QcTypeIndexVO qcTypeIndexVO);
 
     public List<QcCasesEntrySimpleDTO> getEntryByHospital(QcEntryHospitalVO qcEntryHospitalVO);
+
+    public IPage<QcEntryTypeDTO> entryTypePage(QcEntryTypePageVO qcEntryTypePageVO);
+
+    public List<QcTypeByEntryDTO> entryTypeDetail(QcEntryTypeVO qcEntryTypeVO);
+
+    public List<QcTypeSimpDTO> indexQcType(QcEntryTypeIndexVO qcEntryTypeIndexVO);
+
+    public void deleteQcTypeEntry(QcEntryTypeSaveVO qcEntryTypeSaveVO);
+
+    public List<QcTypeSimpDTO> getTypeByHospital(QcTypeHospitalVO qcTypeHospitalVO);
 }

+ 3 - 0
mrman-service/src/main/java/com/diagbot/service/CasesEntryHospitalService.java

@@ -3,6 +3,8 @@ package com.diagbot.service;
 import com.diagbot.entity.CasesEntryHospital;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 病历条目 服务类
@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface CasesEntryHospitalService extends IService<CasesEntryHospital> {
 
+    boolean saveAll(List<CasesEntryHospital> casesEntryHospitals);
 }

+ 18 - 0
mrman-service/src/main/java/com/diagbot/service/QcCasesEntryService.java

@@ -5,10 +5,18 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.dto.QcCasesEntryAllDTO;
 import com.diagbot.dto.QcCasesEntryDTO;
 import com.diagbot.dto.QcCasesEntrySimpleDTO;
+import com.diagbot.dto.QcEntryTypeDTO;
+import com.diagbot.dto.QcTypeByEntryDTO;
+import com.diagbot.dto.QcTypeSimpDTO;
 import com.diagbot.entity.QcCasesEntry;
 import com.diagbot.vo.QcCasesEntryAllVO;
 import com.diagbot.vo.QcCasesEntryIndexVO;
 import com.diagbot.vo.QcEntryHospitalVO;
+import com.diagbot.vo.QcEntryTypeIndexVO;
+import com.diagbot.vo.QcEntryTypePageVO;
+import com.diagbot.vo.QcEntryTypeSaveVO;
+import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
 import com.diagbot.vo.QcTypeIndexVO;
 
 import java.util.List;
@@ -41,4 +49,14 @@ public interface QcCasesEntryService extends IService<QcCasesEntry> {
     public List<QcCasesEntrySimpleDTO> index(QcTypeIndexVO qcTypeIndexVO);
 
     public List<QcCasesEntrySimpleDTO> getEntryByHospital(QcEntryHospitalVO qcEntryHospitalVO);
+
+    public IPage<QcEntryTypeDTO> entryTypePage(QcEntryTypePageVO qcEntryTypePageVO);
+
+    public List<QcTypeByEntryDTO> entryTypeDetail(QcEntryTypeVO qcEntryTypeVO);
+
+    public List<QcTypeSimpDTO> indexQcType(QcEntryTypeIndexVO qcEntryTypeIndexVO);
+
+    public void deleteQcTypeEntry(QcEntryTypeSaveVO qcEntryTypeSaveVO);
+
+    public List<QcTypeSimpDTO> getTypeByHospital(QcTypeHospitalVO qcTypeHospitalVO);
 }

+ 6 - 0
mrman-service/src/main/java/com/diagbot/service/impl/CasesEntryHospitalServiceImpl.java

@@ -6,6 +6,8 @@ import com.diagbot.service.CasesEntryHospitalService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 病历条目 服务实现类
@@ -17,4 +19,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class CasesEntryHospitalServiceImpl extends ServiceImpl<CasesEntryHospitalMapper, CasesEntryHospital> implements CasesEntryHospitalService {
 
+    @Override
+    public boolean saveAll(List<CasesEntryHospital> casesEntryHospitals) {
+        return baseMapper.saveAll(casesEntryHospitals);
+    }
 }

+ 34 - 0
mrman-service/src/main/java/com/diagbot/service/impl/QcCasesEntryServiceImpl.java

@@ -5,12 +5,20 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.QcCasesEntryAllDTO;
 import com.diagbot.dto.QcCasesEntryDTO;
 import com.diagbot.dto.QcCasesEntrySimpleDTO;
+import com.diagbot.dto.QcEntryTypeDTO;
+import com.diagbot.dto.QcTypeByEntryDTO;
+import com.diagbot.dto.QcTypeSimpDTO;
 import com.diagbot.entity.QcCasesEntry;
 import com.diagbot.mapper.QcCasesEntryMapper;
 import com.diagbot.service.QcCasesEntryService;
 import com.diagbot.vo.QcCasesEntryAllVO;
 import com.diagbot.vo.QcCasesEntryIndexVO;
 import com.diagbot.vo.QcEntryHospitalVO;
+import com.diagbot.vo.QcEntryTypeIndexVO;
+import com.diagbot.vo.QcEntryTypePageVO;
+import com.diagbot.vo.QcEntryTypeSaveVO;
+import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
 import com.diagbot.vo.QcTypeIndexVO;
 import org.springframework.stereotype.Service;
 
@@ -56,4 +64,30 @@ public class QcCasesEntryServiceImpl extends ServiceImpl<QcCasesEntryMapper, QcC
     public List<QcCasesEntrySimpleDTO> getEntryByHospital(QcEntryHospitalVO qcEntryHospitalVO) {
         return baseMapper.getEntryByHospital(qcEntryHospitalVO);
     }
+
+    @Override
+    public IPage<QcEntryTypeDTO> entryTypePage(QcEntryTypePageVO qcEntryTypePageVO) {
+        return baseMapper.entryTypePage(qcEntryTypePageVO);
+    }
+
+    @Override
+    public List<QcTypeByEntryDTO> entryTypeDetail(QcEntryTypeVO qcEntryTypeVO) {
+        return baseMapper.entryTypeDetail(qcEntryTypeVO);
+    }
+
+    @Override
+    public List<QcTypeSimpDTO> indexQcType(QcEntryTypeIndexVO qcEntryTypeIndexVO) {
+        return baseMapper.indexQcType(qcEntryTypeIndexVO);
+    }
+
+    @Override
+    public void deleteQcTypeEntry(QcEntryTypeSaveVO qcEntryTypeSaveVO) {
+        baseMapper.deleteQcTypeEntry(qcEntryTypeSaveVO);
+    }
+
+    @Override
+    public List<QcTypeSimpDTO> getTypeByHospital(QcTypeHospitalVO qcTypeHospitalVO) {
+        return baseMapper.getTypeByHospital(qcTypeHospitalVO);
+    }
+
 }

+ 10 - 0
mrman-service/src/main/java/com/diagbot/vo/InsertByHospitalVO.java

@@ -59,6 +59,16 @@ public class InsertByHospitalVO {
      */
     private Integer ruleType;
 
+    /**
+     * 开发状态标识: 0-未开发  1-已开发
+     */
+    private Integer devType;
+
+    /**
+     * 准确率类型:0-极高,1-高,2-中,3-低
+     */
+    private Integer accuracyType;
+
     private String precond;
 
     private Long modeId;

+ 10 - 0
mrman-service/src/main/java/com/diagbot/vo/QcCasesEntryAllVO.java

@@ -37,4 +37,14 @@ public class QcCasesEntryAllVO extends Page {
      * 规则类型(0:无,1:空项,2:错误)
      */
     private Integer ruleType;
+
+    /**
+     * 开发状态标识: 0-未开发  1-已开发
+     */
+    private Integer devType;
+
+    /**
+     * 准确率类型:0-极高,1-高,2-中,3-低
+     */
+    private Integer accuracyType;
 }

+ 18 - 0
mrman-service/src/main/java/com/diagbot/vo/QcEntryTypeIndexVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/29 15:09
+ */
+@Getter
+@Setter
+public class QcEntryTypeIndexVO {
+    // 医院id
+    private Long hospitalId;
+    // 条目Id
+    private Long entryId;
+}

+ 28 - 0
mrman-service/src/main/java/com/diagbot/vo/QcEntryTypePageVO.java

@@ -0,0 +1,28 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 质控条目与质控类型关系映射列表入参
+ * @Author: ztg
+ * @Date: 2018/12/13 10:07
+ */
+@Getter
+@Setter
+public class QcEntryTypePageVO extends Page {
+
+    // 医院id
+    private Long hospitalId;
+    // 条目名称
+    private String entryName;
+    // 质控类型名称
+    private String typeName;
+    // 条目编码
+    private String code;
+    // 所属模块
+    private String casesId;
+    // 质控类型为空标识 1:质控类型为空数据
+    private int typeIsNull;
+}

+ 22 - 0
mrman-service/src/main/java/com/diagbot/vo/QcEntryTypeSaveVO.java

@@ -0,0 +1,22 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2018/8/6 10:16
+ */
+@Getter
+@Setter
+public class QcEntryTypeSaveVO {
+    // 医院id
+    private Long hospitalId;
+    // 条目id
+    private Long entryId;
+    // 质控类型id列表
+    private List<Long> typeIdList;
+}

+ 18 - 0
mrman-service/src/main/java/com/diagbot/vo/QcEntryTypeVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2018/8/6 10:16
+ */
+@Getter
+@Setter
+public class QcEntryTypeVO {
+    // 条目id
+    private Long entryId;
+    // 医院id
+    private Long hospitalId;
+}

+ 14 - 0
mrman-service/src/main/java/com/diagbot/vo/QcTypeHospitalVO.java

@@ -0,0 +1,14 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Data
+public class QcTypeHospitalVO {
+    // 医院id
+    private Long hospitalId;
+}

+ 105 - 0
mrman-service/src/main/java/com/diagbot/web/QcEntryTypeController.java

@@ -0,0 +1,105 @@
+package com.diagbot.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.QcEntryTypeDTO;
+import com.diagbot.dto.QcEntryTypeDetailDTO;
+import com.diagbot.dto.QcTypeSimpDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.QcCacesEntryFacade;
+import com.diagbot.vo.QcEntryTypeIndexVO;
+import com.diagbot.vo.QcEntryTypePageVO;
+import com.diagbot.vo.QcEntryTypeSaveVO;
+import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+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 java.util.List;
+
+/**
+ * <p>
+ * 质控条目与质控类型映射 前端控制器
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-05-14
+ */
+@RestController
+@RequestMapping("/qc/qcEntryType")
+@SuppressWarnings("unchecked")
+@Api(value = "质控条目与质控类型关系映射相关API", tags = { "质控条目与质控类型关系映射相关API" })
+public class QcEntryTypeController {
+
+    @Autowired
+    QcCacesEntryFacade qcCacesEntryFacade;
+
+    @ApiOperation(value = "保存[by:zhoutg]",
+            notes = "// 医院id\n" +
+                    " Long hospitalId;\n" +
+                    "// 条目id\n" +
+                    " Long entryId;\n" +
+                    "// 质控类型id列表\n" +
+                    " List<Long> typeIdList;")
+    @PostMapping("/saveOrUpdate")
+    @SysLogger("saveOrUpdate")
+    @Transactional
+    public RespDTO<Boolean> saveOrUpdate(@RequestBody QcEntryTypeSaveVO qcEntryTypeSaveVO) {
+        qcCacesEntryFacade.saveOrUpdate(qcEntryTypeSaveVO);
+        return RespDTO.onSuc(true);
+    }
+
+    @ApiOperation(value = "分页列表[by:zhoutg]",
+            notes = " // 医院id\n" +
+                    " Long hospitalId;\n" +
+                    "// 条目名称\n" +
+                    " String entryName;\n" +
+                    "// 质控类型名称\n" +
+                    " String typeName;")
+    @PostMapping("/page")
+    @SysLogger("page")
+    public RespDTO<IPage<QcEntryTypeDTO>> list(@RequestBody QcEntryTypePageVO qcEntryTypePageVO) {
+        IPage<QcEntryTypeDTO> data = qcCacesEntryFacade.entryTypePageFac(qcEntryTypePageVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "根据医院和条目检索未被选择的质控类型[by:zhoutg]",
+            notes = "// 医院id\n" +
+                    " Long hospitalId;\n" +
+                    "// 条目Id\n" +
+                    " Long entryId;")
+    @PostMapping("/index")
+    @SysLogger("index")
+    public RespDTO<List<QcTypeSimpDTO>> index(@RequestBody QcEntryTypeIndexVO qcEntryTypeIndexVO) {
+        List<QcTypeSimpDTO>data = qcCacesEntryFacade.indexFac(qcEntryTypeIndexVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "根据entryId和医院id返回内容[by:zhoutg]",
+            notes = "// 条目id\n" +
+                    " Long entryId;\n" +
+                    "// 医院id\n" +
+                    " Long hospitalId;")
+    @PostMapping("/getById")
+    @SysLogger("getById")
+    public RespDTO<QcEntryTypeDetailDTO> getById(@RequestBody QcEntryTypeVO qcEntryTypeVO) {
+        QcEntryTypeDetailDTO data = qcCacesEntryFacade.getByIdFac(qcEntryTypeVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "根据医院获取质控类型列表[by:zhoutg]",
+            notes = "// 医院id\n" +
+                    " Long hospitalId;")
+    @PostMapping("/getTypeByHospital")
+    @SysLogger("getTypeByHospital")
+    public RespDTO<List<QcTypeSimpDTO>> getTypeByHospital(@RequestBody QcTypeHospitalVO qcTypeHospitalVO) {
+        List<QcTypeSimpDTO> data = qcCacesEntryFacade.getTypeByHospitalFac(qcTypeHospitalVO);
+        return RespDTO.onSuc(data);
+    }
+}

+ 26 - 0
mrman-service/src/main/resources/mapper/CasesEntryHospitalMapper.xml

@@ -19,4 +19,30 @@
         <result column="remark" property="remark" />
     </resultMap>
 
+    <insert id="saveAll" parameterType="java.util.List">
+        <if test="list.size !=0 ">
+        INSERT INTO
+        qc_cases_entry_hospital
+        (
+        cases_entry_id,
+        hospital_id,
+        score,
+         msg,
+        is_used,
+        is_reject,
+        remark) VALUES
+        <foreach collection="list" item="data" index="index"
+                 separator=",">
+            (
+            #{data.casesEntryId},
+            #{data.hospitalId},
+            #{data.score},
+            #{data.msg},
+            #{data.isUsed},
+            #{data.isReject},
+            #{data.remark}
+            )
+        </foreach>
+        </if>
+    </insert>
 </mapper>

+ 147 - 0
mrman-service/src/main/resources/mapper/QcCasesEntryMapper.xml

@@ -10,6 +10,9 @@
         <result column="mode_id" property="modeId" />
         <result column="code" property="code" />
         <result column="name" property="name" />
+        <result column="rule_type" property="ruleType" />
+        <result column="dev_type" property="devType" />
+        <result column="accuracy_type" property="accuracyType" />
         <result column="precond" property="precond" />
         <result column="order_no" property="orderNo" />
         <result column="remark" property="remark" />
@@ -33,6 +36,12 @@
         <if test="ruleType != null">
             AND a.rule_type = #{ruleType}
         </if>
+        <if test="devType != null">
+            AND a.dev_type = #{devType}
+        </if>
+        <if test="accuracyType != null">
+            AND a.accuracy_type = #{accuracyType}
+        </if>
         <if test="name != null and name != ''">
             AND  UPPER(a.name) LIKE CONCAT('%', UPPER(trim(#{name})), '%')
         </if>
@@ -147,4 +156,142 @@
         AND t2.hospital_id = #{hospitalId}
         ORDER BY t3.order_no,t1.order_no
     </select>
+
+    <select id="entryTypePage" resultType="com.diagbot.dto.QcEntryTypeDTO">
+        SELECT
+            t.*, qc.cases_id,
+            qc.cases_name,
+            qc.`code`,
+            qc.`name` entry_name
+        FROM
+            (
+                SELECT
+                    a1.entry_id,
+                    a1.hospital_id,
+                    GROUP_CONCAT(b1. NAME) type_str
+                FROM
+                    (
+                        SELECT
+                            t1.id entry_id,
+                            t2.hospital_id
+                        FROM
+                            qc_cases_entry t1,
+                            qc_cases_entry_hospital t2
+                        WHERE
+                            t1.is_deleted = 'N'
+                        AND t2.is_deleted = 'N'
+                        AND t1.id = t2.cases_entry_id
+                    ) a1
+                LEFT JOIN (
+                    SELECT
+                        a1. NAME,
+                        a2.case_entry_id,
+                        a1.hospital_id
+                    FROM
+                        qc_type a1,
+                        qc_type_cases_entry a2
+                    WHERE
+                        a1.is_deleted = 'N'
+                    AND a2.is_deleted = 'N'
+                    AND a1.id = a2.type_id
+                ) b1 ON a1.entry_id = b1.case_entry_id
+                AND a1.hospital_id = b1.hospital_id
+                GROUP BY
+                    a1.entry_id,
+                    a1.hospital_id
+            ) t,
+            qc_cases_entry qc
+        WHERE
+            t.entry_id = qc.id
+        <if test="hospitalId != null">
+            and t.hospital_id = #{hospitalId}
+        </if>
+        <if test="entryName != null and entryName != ''">
+            and qc.name like concat('%', #{entryName}, '%')
+        </if>
+        <if test="code != null and code != ''">
+            and qc.code like concat('%', #{code}, '%')
+        </if>
+        <if test="casesId != null and casesId != ''">
+            and qc.cases_id = #{casesId}
+        </if>
+        <if test="typeName != null and typeName != ''">
+            and t.type_str like concat('%', #{typeName}, '%')
+        </if>
+        <if test="typeIsNull != null and typeIsNull == 1">
+            and t.type_str is null
+        </if>
+    </select>
+
+    <select id="entryTypeDetail" resultType="com.diagbot.dto.QcTypeByEntryDTO">
+        SELECT
+            t1.id entry_id,
+            t1.`name` entry_name,
+            t2.hospital_id,
+            t4.NAME type_name,
+            t4.id type_id,
+            t1.cases_name
+        FROM
+            qc_cases_entry t1,
+            qc_cases_entry_hospital t2,
+            qc_type_cases_entry t3,
+            qc_type t4
+        WHERE
+            t1.is_deleted = 'N'
+        AND t2.is_deleted = 'N'
+        AND t3.is_deleted = 'N'
+        AND t4.is_deleted = 'N'
+        AND t1.id = t2.cases_entry_id
+        AND t1.id = t3.case_entry_id
+        AND t3.type_id = t4.id
+        AND t2.hospital_id = t4.hospital_id
+        AND t2.hospital_id = #{hospitalId}
+        AND t1.id = #{entryId}
+        ORDER BY
+            t4.id
+    </select>
+
+    <select id="indexQcType" resultType="com.diagbot.dto.QcTypeSimpDTO">
+        SELECT
+            *
+        FROM
+            `qc_type` t1
+        WHERE
+            t1.is_deleted = 'N'
+        AND t1.hospital_id = #{hospitalId}
+        AND t1.id NOT IN (
+            SELECT DISTINCT
+                type_id
+            FROM
+                qc_type_cases_entry t2
+            WHERE
+                t2.is_deleted = 'N'
+            AND t2.case_entry_id = #{entryId}
+        )
+    </select>
+    
+    <delete id="deleteQcTypeEntry">
+        DELETE t2
+        FROM
+            qc_type t1,
+            qc_type_cases_entry t2
+        WHERE
+            t1.hospital_id = #{hospitalId}
+        AND t1.id = t2.type_id
+        AND t2.case_entry_id = #{entryId}
+    </delete>
+
+    <select id="getTypeByHospital" resultType="com.diagbot.dto.QcTypeSimpDTO">
+        SELECT DISTINCT
+            NAME
+        FROM
+            `qc_type`
+        WHERE
+            is_deleted = 'N'
+        <if test="hospitalId != null">
+            and hospital_id = #{hospitalId}
+        </if>
+        ORDER BY
+            id
+    </select>
 </mapper>

+ 1 - 1
mrman-service/src/test/java/com/diagbot/CodeGeneration.java

@@ -56,7 +56,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
 //        strategy.setTablePrefix(new String[] { "icss_" });// 此处可以修改为您的表前缀
          strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "med_module_mapping", "med_record_analyze"}); // 需要生成的表
+        strategy.setInclude(new String[] { "qc_cases_entry"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);