Browse Source

新增缺陷反馈记录相关接口

zhanghang 3 years ago
parent
commit
07cbce1e76

+ 16 - 0
doc/046.20220420v2.5.0_个性化版_湘雅人工质控缺陷反馈/qc_init_v2.5.0_个性化版_湘雅人工质控缺陷反馈.sql

@@ -75,3 +75,19 @@ INSERT INTO `sys_menu` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creat
 INSERT INTO `sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('190', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '查看', 'FUNC000190', '/qc/behospitalInfo/getByBehospitalCode', 'ALL', '查看', '用户-缺陷反馈记录-查看');
 INSERT INTO `sys_menu_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '110', '190', NULL, '用户-缺陷反馈记录-查看');
 
+/**
+sys_user_pageset 页面设定新增是否日间病历
+ */
+INSERT INTO `sys_user_pageset` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `user_id`, `page_type`, `name`, `val`, `status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '1', '是否日间病历', 'isDaytime', '1', '26', NULL);
+
+/**
+sys_dictionary_info 系统字典表加入缺陷反馈状态及操作类型
+ */
+INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '36', '缺陷反馈', '37,38', '2', '0', '缺陷反馈状态等字典数据总览');
+INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '37', '1', '修改条目', '2', '0', '操作类型');
+INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '37', '2', '删除条目', '2', '0', '操作类型');
+INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '37', '3', '新增已有条目', '2', '0', '操作类型');
+INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '37', '4', '新增缺失条目', '2', '0', '操作类型');
+INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '37', '5', '恢复条目', '2', '0', '操作类型');
+INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '38', '0', '待确认', '2', '0', '状态');
+INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '38', '1', '已确认', '2', '0', '状态');

+ 30 - 0
src/main/java/com/diagbot/dto/GetDefectDeptDTO.java

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 获取缺陷反馈记录列表-科室下拉框内容
+ * @author: zhanghang
+ * @time: 2022/4/21 10:07
+ */
+@ApiModel(value = "获取缺陷反馈记录列表-科室下拉框内容--接口出参")
+@Getter
+@Setter
+public class GetDefectDeptDTO implements Serializable {
+
+
+    private static final long serialVersionUID = 5216026169810219664L;
+
+    @ApiModelProperty(value = "所属科室ID")
+    private String deptId;
+
+    @ApiModelProperty(value = "所属科室")
+    private String deptName;
+
+}

+ 28 - 0
src/main/java/com/diagbot/dto/GetDefectModeDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 获取缺陷反馈记录列表-缺陷模块下拉框内容
+ * @author: zhanghang
+ * @time: 2022/4/21 10:07
+ */
+@ApiModel(value = "获取缺陷反馈记录列表-缺陷模块下拉框内容--接口出参")
+@Getter
+@Setter
+public class GetDefectModeDTO implements Serializable {
+
+
+    private static final long serialVersionUID = -1264454776862959020L;
+    @ApiModelProperty(value = "模块id")
+    private Long modeId;
+
+    @ApiModelProperty(value = "模块名称")
+    private String modeName;
+
+}

+ 74 - 0
src/main/java/com/diagbot/dto/GetMedDefectFeedbackPageDTO.java

@@ -0,0 +1,74 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 获取缺陷反馈列表入参--接口出参
+ * @author: zhanghang
+ * @time: 2022/4/21 10:07
+ */
+@ApiModel(value = "获取缺陷反馈列表入参--接口出参")
+@Getter
+@Setter
+public class GetMedDefectFeedbackPageDTO  implements Serializable {
+
+    private static final long serialVersionUID = -7907298942260577095L;
+    @ApiModelProperty(value = "反馈人编号")
+    private String senderCode;
+
+    @ApiModelProperty(value = "反馈人姓名")
+    private String senderName;
+
+    @ApiModelProperty(value = "所属科室ID")
+    private String deptId;
+
+    @ApiModelProperty(value = "所属科室")
+    private String deptName;
+
+    @ApiModelProperty(value = "反馈时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date gmtCreate;
+
+    @ApiModelProperty(value = "患者姓名")
+    private String name;
+
+    @ApiModelProperty(value = "模块ID")
+    private Long modeId;
+
+    @ApiModelProperty(value = "模块名称")
+    private String modeName;
+
+    @ApiModelProperty(value = "条目ID")
+    private Long casesEntryId;
+
+    @ApiModelProperty(value = "提示信息")
+    private String qcresultDetailMsg;
+
+    @ApiModelProperty(value = "反馈说明")
+    private String explainInfo;
+
+    @ApiModelProperty(value = "接收人编号")
+    private String receiverCode;
+
+    @ApiModelProperty(value = "接收人姓名")
+    private String receiverName;
+
+    @ApiModelProperty(value = "抄送人编号")
+    private String ccCodes;
+
+    @ApiModelProperty(value = "抄送人姓名")
+    private String ccNames;
+
+    @ApiModelProperty(value = "操作类型 1:修改|2:删除|3:新增已有|4:新增缺失|5:恢复")
+    private String operationType;
+
+    @ApiModelProperty(value = "状态 0:待确认|1:已确认")
+    private String status;
+}

+ 40 - 0
src/main/java/com/diagbot/facade/MedDefectFeedbackFacade.java

@@ -1,7 +1,11 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.dto.AnalyzeDTO;
+import com.diagbot.dto.GetDefectDeptDTO;
+import com.diagbot.dto.GetDefectModeDTO;
+import com.diagbot.dto.GetMedDefectFeedbackPageDTO;
 import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.entity.MedDefectFeedback;
 import com.diagbot.entity.MedQcresultInfo;
@@ -19,6 +23,7 @@ import com.diagbot.util.ListUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.CCVO;
 import com.diagbot.vo.ChangeQcResultVO;
+import com.diagbot.vo.GetMedDefectFeedbackPageVO;
 import com.diagbot.vo.QcresultVO;
 import com.diagbot.vo.UPdDefectBackByIDVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -191,4 +196,39 @@ public class MedDefectFeedbackFacade extends MedDefectFeedbackServiceImpl {
         entity.setStatus("1");
         return this.updateById(entity);
     }
+
+    /**
+     * 获取缺陷反馈记录列表-缺陷模块下拉框内容
+     *
+     * @param
+     * @return:
+     */
+    public List<GetDefectModeDTO> getDefectMode() {
+        Long hospitalID = Long.valueOf(SysUserUtils.getCurrentHospitalID());
+        List<GetDefectModeDTO> defectDept = this.baseMapper.getDefectMode(hospitalID);
+        return defectDept;
+    }
+
+    /**
+     * 获取缺陷反馈记录列表-科室下拉框内容
+     *
+     * @param
+     * @return:
+     */
+    public List<GetDefectDeptDTO> getDefectDept() {
+        Long hospitalID = Long.valueOf(SysUserUtils.getCurrentHospitalID());
+        List<GetDefectDeptDTO> defectDept = this.baseMapper.getDefectDept(hospitalID);
+        return defectDept;
+    }
+
+    /**
+     * 获取缺陷反馈记录列表
+     *
+     * @param
+     * @return:
+     */
+    public Page<GetMedDefectFeedbackPageDTO> getMedDefectFeedbackPage(GetMedDefectFeedbackPageVO getMedDefectFeedbackPageVO) {
+        Page<GetMedDefectFeedbackPageDTO> medDefectFeedbackPage = this.baseMapper.getMedDefectFeedbackPage(getMedDefectFeedbackPageVO);
+        return medDefectFeedbackPage;
+    }
 }

+ 31 - 5
src/main/java/com/diagbot/facade/SysDictionaryFacade.java

@@ -70,10 +70,11 @@ public class SysDictionaryFacade extends SysDictionaryInfoServiceImpl {
     }
 
     /**
-     * 获取字典申诉驳回具体信息
+     * 获取字典具体信息
+     *
      * @return
      */
-    public List<SysDictionaryInfoDTO> getAppealRejectDictionary(String groupType){
+    public List<SysDictionaryInfoDTO> getAppealRejectDictionary(String groupType) {
         List<SysDictionaryInfoDTO> sysDictionaryInfoDTOS = new LinkedList<SysDictionaryInfoDTO>();
         if (getDictionary() != null
                 && getDictionary().containsKey(Long.parseLong(groupType))
@@ -85,15 +86,16 @@ public class SysDictionaryFacade extends SysDictionaryInfoServiceImpl {
 
     /**
      * 获取字典申诉驳回总体信息
+     *
      * @return
      */
-    public Map<String,Map<String, String>> getAppealRejectionDictionary(){
-        Map<String, Map<String,String>> appealOperationMap = new HashMap<>();
+    public Map<String, Map<String, String>> getAppealRejectionDictionary() {
+        Map<String, Map<String, String>> appealOperationMap = new HashMap<>();
         Map<String, String> appealOperationMapKey = new HashMap<>();
         if (getDictionaryWithKey() != null
                 && getDictionaryWithKey().containsKey("34")
         ) {
-            appealOperationMapKey= getDictionaryWithKey().get("34");
+            appealOperationMapKey = getDictionaryWithKey().get("34");
         }
         String appealOperation = appealOperationMapKey.get("申诉驳回");
         String[] split = appealOperation.split(",");
@@ -105,4 +107,28 @@ public class SysDictionaryFacade extends SysDictionaryInfoServiceImpl {
         }
         return appealOperationMap;
     }
+
+    /**
+     * 获取字典缺陷返回总体信息
+     *
+     * @return
+     */
+    public Map<String, Map<String, String>> getOperationStatusType(String groupType ,String name) {
+        Map<String, Map<String, String>> appealOperationMap = new HashMap<>();
+        Map<String, String> appealOperationMapKey = new HashMap<>();
+        if (getDictionaryWithKey() != null
+                && getDictionaryWithKey().containsKey(groupType)
+        ) {
+            appealOperationMapKey = getDictionaryWithKey().get(groupType);
+        }
+        String appealOperation = appealOperationMapKey.get(name);
+        String[] split = appealOperation.split(",");
+        List<String> strings = Arrays.asList(split);
+        for (int i = 0; i < strings.size(); i++) {
+            List<SysDictionaryInfoDTO> appealStatusDictionary = getAppealRejectDictionary(strings.get(i));
+            Map<String, String> keyValue = EntityUtil.makeMapWithKeyValue(appealStatusDictionary, "name", "val");
+            appealOperationMap.put(appealStatusDictionary.get(0).getRemark(), keyValue);
+        }
+        return appealOperationMap;
+    }
 }

+ 15 - 0
src/main/java/com/diagbot/mapper/MedDefectFeedbackMapper.java

@@ -1,7 +1,16 @@
 package com.diagbot.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.dto.GetDefectDeptDTO;
+import com.diagbot.dto.GetDefectModeDTO;
+import com.diagbot.dto.GetMedDefectFeedbackPageDTO;
 import com.diagbot.entity.MedDefectFeedback;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.GetMedDefectFeedbackPageVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
 
 /**
  * <p>
@@ -13,4 +22,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface MedDefectFeedbackMapper extends BaseMapper<MedDefectFeedback> {
 
+    Page<GetMedDefectFeedbackPageDTO> getMedDefectFeedbackPage(@Param("getMedDefectFeedbackPageVO") GetMedDefectFeedbackPageVO getMedDefectFeedbackPageVO);
+
+    List<GetDefectDeptDTO> getDefectDept(@Param("hospitalID") Long hospitalID);
+
+    List<GetDefectModeDTO> getDefectMode(@Param("hospitalID") Long hospitalID);
+
 }

+ 66 - 0
src/main/java/com/diagbot/vo/GetMedDefectFeedbackPageVO.java

@@ -0,0 +1,66 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+
+import java.util.Date;
+
+/**
+ * @Description: 获取缺陷反馈列表入参--接口入参
+ * @author: zhanghang
+ * @time: 2022/4/21 10:07
+ */
+@ApiModel(value = "获取缺陷反馈列表入参--接口入参")
+@Getter
+@Setter
+public class GetMedDefectFeedbackPageVO extends Page {
+
+    @ApiModelProperty(value = "医院ID", hidden = true)
+    private Long hospitalId;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "反馈时间起始时间", required = true)
+    private Date startDate;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "反馈时间结束时间", required = true)
+    private Date endDate;
+
+    @ApiModelProperty(value = "所属科室ID")
+    private String deptId;
+
+    @ApiModelProperty(value = "所属科室")
+    private String deptName;
+
+    @ApiModelProperty(value = "模块ID")
+    private String modeId;
+
+    @ApiModelProperty(value = "模块名称")
+    private String modeName;
+
+    @ApiModelProperty(value = "接收人编号")
+    private String receiverCode;
+
+    @ApiModelProperty(value = "接收人姓名")
+    private String receiverName;
+
+    @ApiModelProperty(value = "抄送人编号")
+    private String ccCodes;
+
+    @ApiModelProperty(value = "抄送人姓名")
+    private String ccNames;
+
+    @ApiModelProperty(value = "患者姓名")
+    private String name;
+
+    @ApiModelProperty(value = "操作类型 1:修改|2:删除|3:新增已有|4:新增缺失|5:恢复")
+    private String operationType;
+
+    @ApiModelProperty(value = "状态 0:待确认|1:已确认")
+    private String status;
+}

+ 43 - 2
src/main/java/com/diagbot/web/MedDefectFeedbackController.java

@@ -1,14 +1,19 @@
 package com.diagbot.web;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.AnalyzeDTO;
+import com.diagbot.dto.GetDefectDeptDTO;
+import com.diagbot.dto.GetMedDefectFeedbackPageDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.his.DoctorHosDTO;
 import com.diagbot.facade.MedDefectFeedbackFacade;
+import com.diagbot.facade.SysDictionaryFacade;
 import com.diagbot.facade.his.DoctorHosFacade;
+import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.ChangeQcResultVO;
-import com.diagbot.vo.QcresultVO;
+import com.diagbot.vo.GetMedDefectFeedbackPageVO;
 import com.diagbot.vo.UPdDefectBackByIDVO;
 import com.diagbot.vo.his.DoctorHosVO;
 import io.swagger.annotations.Api;
@@ -22,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -39,12 +45,14 @@ public class MedDefectFeedbackController {
     private DoctorHosFacade doctorHosFacade;
     @Autowired
     private MedDefectFeedbackFacade medDefectFeedbackFacade;
+    @Autowired
+    private SysDictionaryFacade sysDictionaryFacade;
 
     @ApiOperation(value = "获取His医生信息[by:songxl]",
             notes = "获取His医生信息")
     @PostMapping("/getHisDoctorInfo")
     @SysLogger("getHisDoctorInfo")
-    public RespDTO<List<DoctorHosDTO>> getDoctorInfo(@RequestBody DoctorHosVO doctorHosVO){
+    public RespDTO<List<DoctorHosDTO>> getDoctorInfo(@RequestBody DoctorHosVO doctorHosVO) {
         return RespDTO.onSuc(doctorHosFacade.getDoctorInfo(doctorHosVO));
     }
 
@@ -75,6 +83,7 @@ public class MedDefectFeedbackController {
     public RespDTO<AnalyzeDTO> delCase(@RequestBody ChangeQcResultVO changeQcResultVO) {
         return RespDTO.onSuc(medDefectFeedbackFacade.changeQcResult(changeQcResultVO));
     }
+
     @ApiOperation(value = "恢复质控条目[by:songxl]",
             notes = "optResultAlgVO:操作条目,casesEntryId、msg、score必填<br>")
     @PostMapping("/recoverCase")
@@ -102,4 +111,36 @@ public class MedDefectFeedbackController {
         return RespDTO.onSuc(medDefectFeedbackFacade.updDefectBackByID(uPdDefectBackByIDVO));
     }
 
+
+    @ApiOperation(value = "获取缺陷反馈记录列表操作类型、状态下拉框内容[by:zhanghang]",
+            notes = "获取缺陷反馈记录列表操作类型、状态下拉框内容")
+    @PostMapping("/getOperationType")
+    public RespDTO<Map<String, String>> getOperationStatusType() {
+        Map<String, Map<String, String>> operationStatusType = sysDictionaryFacade.getOperationStatusType("36", "缺陷反馈");
+        return RespDTO.onSuc(operationStatusType);
+    }
+
+    @ApiOperation(value = "获取缺陷反馈记录[by:zhanghang]",
+            notes = "获取缺陷反馈记录列表")
+    @PostMapping("/getMedDefectFeedbackPage")
+    public RespDTO<Page<GetMedDefectFeedbackPageDTO>> getMedDefectFeedbackPage(@RequestBody GetMedDefectFeedbackPageVO getMedDefectFeedbackPageVO) {
+        String hospitalID = SysUserUtils.getCurrentHospitalID();
+        getMedDefectFeedbackPageVO.setHospitalId(Long.valueOf(hospitalID));
+        return RespDTO.onSuc(medDefectFeedbackFacade.getMedDefectFeedbackPage(getMedDefectFeedbackPageVO));
+    }
+
+    @ApiOperation(value = "获取缺陷反馈记录列表-科室下拉框内容[by:zhanghang]",
+            notes = "获取缺陷反馈记录列表-科室下拉框内容")
+    @PostMapping("/getDefectDept")
+    public RespDTO<List<GetDefectDeptDTO>> getDefectDept() {
+        return RespDTO.onSuc(medDefectFeedbackFacade.getDefectDept());
+    }
+
+    @ApiOperation(value = "获取缺陷反馈记录列表-缺陷模块下拉框内容[by:zhanghang]",
+            notes = "获取缺陷反馈记录列表-缺陷模块下拉框内容")
+    @PostMapping("/getDefectMode")
+    public RespDTO<List<GetDefectDeptDTO>> getDefectMode() {
+        return RespDTO.onSuc(medDefectFeedbackFacade.getDefectMode());
+    }
+
 }

+ 116 - 25
src/main/resources/mapper/MedDefectFeedbackMapper.xml

@@ -4,31 +4,122 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.MedDefectFeedback">
-        <id column="id" property="id" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="dept_id" property="deptId" />
-        <result column="dept_name" property="deptName" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="name" property="name" />
-        <result column="cases_entry_id" property="casesEntryId" />
-        <result column="qcresult_detail_msg" property="qcresultDetailMsg" />
-        <result column="qcresult_detai_score" property="qcresultDetaiScore" />
-        <result column="mode_id" property="modeId" />
-        <result column="mode_name" property="modeName" />
-        <result column="explain_info" property="explainInfo" />
-        <result column="operation_type" property="operationType" />
-        <result column="sender_code" property="senderCode" />
-        <result column="sender_name" property="senderName" />
-        <result column="receiver_code" property="receiverCode" />
-        <result column="receiver_name" property="receiverName" />
-        <result column="cc_codes" property="ccCodes" />
-        <result column="cc_names" property="ccNames" />
-        <result column="status" property="status" />
-        <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" />
+        <id column="id" property="id"/>
+        <result column="hospital_id" property="hospitalId"/>
+        <result column="dept_id" property="deptId"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="behospital_code" property="behospitalCode"/>
+        <result column="name" property="name"/>
+        <result column="cases_entry_id" property="casesEntryId"/>
+        <result column="qcresult_detail_msg" property="qcresultDetailMsg"/>
+        <result column="qcresult_detai_score" property="qcresultDetaiScore"/>
+        <result column="mode_id" property="modeId"/>
+        <result column="mode_name" property="modeName"/>
+        <result column="explain_info" property="explainInfo"/>
+        <result column="operation_type" property="operationType"/>
+        <result column="sender_code" property="senderCode"/>
+        <result column="sender_name" property="senderName"/>
+        <result column="receiver_code" property="receiverCode"/>
+        <result column="receiver_name" property="receiverName"/>
+        <result column="cc_codes" property="ccCodes"/>
+        <result column="cc_names" property="ccNames"/>
+        <result column="status" property="status"/>
+        <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"/>
     </resultMap>
 
+    <select id="getMedDefectFeedbackPage" resultType="com.diagbot.dto.GetMedDefectFeedbackPageDTO">
+        SELECT
+        id,
+        dept_name,
+        gmt_modified,
+        mode_name,
+        qcresult_detai_score,
+        modifier,
+        receiver_code,
+        sender_name,
+        is_deleted,
+        mode_id,
+        hospital_id,
+        creator,
+        receiver_name,
+        behospital_code,
+        dept_id,
+        gmt_create,
+        sender_code,
+        cases_entry_id,
+        explain_info,
+        name,
+        cc_names,
+        cc_codes,
+        operation_type,
+        CASE WHEN (qcresult_detail_msg is null OR qcresult_detail_msg = '') THEN '-' ELSE qcresult_detail_msg END AS qcresultDetailMsg,
+        status
+        FROM
+        med_defect_feedback
+        WHERE
+        is_deleted = 'N'
+        <if test="getMedDefectFeedbackPageVO.hospitalId != null and getMedDefectFeedbackPageVO.hospitalId != ''">
+            and hospital_id = #{getMedDefectFeedbackPageVO.hospitalId}
+        </if>
+        <if test="getMedDefectFeedbackPageVO.operationType != null and getMedDefectFeedbackPageVO.operationType != ''">
+            and operation_type = #{getMedDefectFeedbackPageVO.operationType}
+        </if>
+        <if test="getMedDefectFeedbackPageVO.status != null and getMedDefectFeedbackPageVO.status != ''">
+            and status = #{getMedDefectFeedbackPageVO.status}
+        </if>
+        <if test="getMedDefectFeedbackPageVO.deptId != null and getMedDefectFeedbackPageVO.deptId != ''">
+            and dept_id = #{getMedDefectFeedbackPageVO.deptId}
+        </if>
+        <if test="getMedDefectFeedbackPageVO.deptName != null and getMedDefectFeedbackPageVO.deptName != ''">
+            and dept_name = #{getMedDefectFeedbackPageVO.deptName}
+        </if>
+        <if test="getMedDefectFeedbackPageVO.modeId != null and getMedDefectFeedbackPageVO.modeId != ''">
+            and mode_id = #{getMedDefectFeedbackPageVO.modeId}
+        </if>
+        <if test="getMedDefectFeedbackPageVO.startDate != null ">
+            <![CDATA[ AND gmt_create >= #{getMedDefectFeedbackPageVO.startDate}]]>
+        </if>
+        <if test="getMedDefectFeedbackPageVO.endDate != null">
+            <![CDATA[ AND gmt_create <= #{getMedDefectFeedbackPageVO.endDate}]]>
+        </if>
+        <if test="getMedDefectFeedbackPageVO.receiverName != null and getMedDefectFeedbackPageVO.receiverName != ''">
+            and receiver_name LIKE CONCAT( '%', #{getMedDefectFeedbackPageVO.receiverName}, '%' )
+        </if>
+        <if test="getMedDefectFeedbackPageVO.ccNames != null and getMedDefectFeedbackPageVO.ccNames != ''">
+            and cc_names LIKE CONCAT( '%', #{getMedDefectFeedbackPageVO.ccNames}, '%' )
+        </if>
+        <if test="getMedDefectFeedbackPageVO.name != null and getMedDefectFeedbackPageVO.name != ''">
+            and name LIKE CONCAT( '%', #{getMedDefectFeedbackPageVO.name}, '%' )
+        </if>
+
+    </select>
+
+    <select id="getDefectDept" resultType="com.diagbot.dto.GetDefectDeptDTO">
+        SELECT
+            dept_id,
+            dept_name
+        FROM
+            med_defect_feedback
+        WHERE
+            is_deleted = 'N'
+        AND hospital_id = #{hospitalID}
+        GROUP BY dept_id
+    </select>
+
+    <select id="getDefectMode" resultType="com.diagbot.dto.GetDefectModeDTO">
+        SELECT
+            mode_id,
+            mode_name
+        FROM
+            med_defect_feedback
+        WHERE
+            is_deleted = 'N'
+        AND hospital_id = #{hospitalID}
+        GROUP BY mode_id
+    </select>
+
 </mapper>