Browse Source

缺陷反馈记录列表下拉获取科室及模块区分运行和终末质控

zhanghang 3 years ago
parent
commit
4bba4f8e80

+ 7 - 5
src/main/java/com/diagbot/facade/MedDefectFeedbackFacade.java

@@ -2,7 +2,6 @@ package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.dto.AnalyzeDTO;
 import com.diagbot.dto.GetDefectDeptDTO;
 import com.diagbot.dto.GetDefectModeDTO;
@@ -23,6 +22,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.GetDefectDeptModeVO;
 import com.diagbot.vo.GetMedDefectFeedbackPageVO;
 import com.diagbot.vo.QcresultVO;
 import com.diagbot.vo.UPdDefectBackByIDVO;
@@ -225,9 +225,10 @@ public class MedDefectFeedbackFacade extends MedDefectFeedbackServiceImpl {
      * @param
      * @return:
      */
-    public List<GetDefectModeDTO> getDefectMode() {
+    public List<GetDefectModeDTO> getDefectMode(GetDefectDeptModeVO getDefectDeptModeVO) {
         Long hospitalID = Long.valueOf(SysUserUtils.getCurrentHospitalID());
-        List<GetDefectModeDTO> defectDept = this.baseMapper.getDefectMode(hospitalID);
+        getDefectDeptModeVO.setHospitalId(hospitalID);
+        List<GetDefectModeDTO> defectDept = this.baseMapper.getDefectMode(getDefectDeptModeVO);
         return defectDept;
     }
 
@@ -237,9 +238,10 @@ public class MedDefectFeedbackFacade extends MedDefectFeedbackServiceImpl {
      * @param
      * @return:
      */
-    public List<GetDefectDeptDTO> getDefectDept() {
+    public List<GetDefectDeptDTO> getDefectDept(GetDefectDeptModeVO getDefectDeptModeVO) {
         Long hospitalID = Long.valueOf(SysUserUtils.getCurrentHospitalID());
-        List<GetDefectDeptDTO> defectDept = this.baseMapper.getDefectDept(hospitalID);
+        getDefectDeptModeVO.setHospitalId(hospitalID);
+        List<GetDefectDeptDTO> defectDept = this.baseMapper.getDefectDept(getDefectDeptModeVO);
         return defectDept;
     }
 

+ 3 - 2
src/main/java/com/diagbot/mapper/MedDefectFeedbackMapper.java

@@ -6,6 +6,7 @@ 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.GetDefectDeptModeVO;
 import com.diagbot.vo.GetMedDefectFeedbackPageVO;
 import org.apache.ibatis.annotations.Param;
 
@@ -24,8 +25,8 @@ public interface MedDefectFeedbackMapper extends BaseMapper<MedDefectFeedback> {
 
     Page<GetMedDefectFeedbackPageDTO> getMedDefectFeedbackPage(@Param("getMedDefectFeedbackPageVO") GetMedDefectFeedbackPageVO getMedDefectFeedbackPageVO);
 
-    List<GetDefectDeptDTO> getDefectDept(@Param("hospitalID") Long hospitalID);
+    List<GetDefectDeptDTO> getDefectDept(@Param("getDefectDeptModeVO") GetDefectDeptModeVO getDefectDeptModeVO);
 
-    List<GetDefectModeDTO> getDefectMode(@Param("hospitalID") Long hospitalID);
+    List<GetDefectModeDTO> getDefectMode(@Param("getDefectDeptModeVO") GetDefectDeptModeVO getDefectDeptModeVO);
 
 }

+ 27 - 0
src/main/java/com/diagbot/vo/GetDefectDeptModeVO.java

@@ -0,0 +1,27 @@
+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 GetDefectDeptModeVO extends Page {
+
+    @ApiModelProperty(value = "医院ID", hidden = true)
+    private Long hospitalId;
+
+    @ApiModelProperty(value = "是否归档 0: 未归档|1:已归档")
+    private String isPlacefile ;
+}

+ 5 - 4
src/main/java/com/diagbot/web/MedDefectFeedbackController.java

@@ -13,6 +13,7 @@ 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.GetDefectDeptModeVO;
 import com.diagbot.vo.GetMedDefectFeedbackPageVO;
 import com.diagbot.vo.UPdDefectBackByIDVO;
 import com.diagbot.vo.his.DoctorHosVO;
@@ -133,15 +134,15 @@ public class MedDefectFeedbackController {
     @ApiOperation(value = "获取缺陷反馈记录列表-科室下拉框内容[by:zhanghang]",
             notes = "获取缺陷反馈记录列表-科室下拉框内容")
     @PostMapping("/getDefectDept")
-    public RespDTO<List<GetDefectDeptDTO>> getDefectDept() {
-        return RespDTO.onSuc(medDefectFeedbackFacade.getDefectDept());
+    public RespDTO<List<GetDefectDeptDTO>> getDefectDept(@RequestBody GetDefectDeptModeVO getDefectDeptModeVO) {
+        return RespDTO.onSuc(medDefectFeedbackFacade.getDefectDept(getDefectDeptModeVO));
     }
 
     @ApiOperation(value = "获取缺陷反馈记录列表-缺陷模块下拉框内容[by:zhanghang]",
             notes = "获取缺陷反馈记录列表-缺陷模块下拉框内容")
     @PostMapping("/getDefectMode")
-    public RespDTO<List<GetDefectDeptDTO>> getDefectMode() {
-        return RespDTO.onSuc(medDefectFeedbackFacade.getDefectMode());
+    public RespDTO<List<GetDefectDeptDTO>> getDefectMode(@RequestBody GetDefectDeptModeVO getDefectDeptModeVO) {
+        return RespDTO.onSuc(medDefectFeedbackFacade.getDefectMode(getDefectDeptModeVO));
     }
 
 }

+ 40 - 8
src/main/resources/mapper/MedDefectFeedbackMapper.xml

@@ -119,29 +119,61 @@
     </select>
 
     <select id="getDefectDept" resultType="com.diagbot.dto.GetDefectDeptDTO">
+    SELECT
+        a.*, b.is_placefile
+    FROM
+        (
         SELECT
             dept_id as deptId,
-            dept_name as deptName
+            dept_name as deptName,
+            behospital_code AS behospitalCode
         FROM
             med_defect_feedback
         WHERE
             is_deleted = 'N'
-        AND hospital_id = #{hospitalID}
-        AND dept_id is not null
-        GROUP BY dept_id
+        AND hospital_id = #{getDefectDeptModeVO.hospitalId}
+        GROUP BY
+		mode_id,
+		behospital_code
+        ) a,
+        med_behospital_info b
+    WHERE
+        a.behospitalCode = b.behospital_code
+    AND a.deptId IS NOT NULL
+    <if test="getDefectDeptModeVO.isPlacefile != null and getDefectDeptModeVO.isPlacefile != ''">
+        and b.is_placefile =#{getDefectDeptModeVO.isPlacefile}
+    </if>
+    GROUP BY
+        a.deptId
     </select>
 
     <select id="getDefectMode" resultType="com.diagbot.dto.GetDefectModeDTO">
+    SELECT
+        a.*, b.is_placefile
+    FROM
+        (
         SELECT
             mode_id as modeId,
-            mode_name as modeName
+            mode_name as modeName,
+            behospital_code AS behospitalCode
         FROM
             med_defect_feedback
         WHERE
             is_deleted = 'N'
-        AND hospital_id = #{hospitalID}
-        AND mode_id is not null
-        GROUP BY mode_id
+        AND hospital_id = #{getDefectDeptModeVO.hospitalId}
+    	GROUP BY
+		mode_id,
+		behospital_code
+        ) a,
+        med_behospital_info b
+    WHERE
+        a.behospitalCode = b.behospital_code
+    AND a.modeId IS NOT NULL
+    <if test="getDefectDeptModeVO.isPlacefile != null and getDefectDeptModeVO.isPlacefile != ''">
+        and b.is_placefile =#{getDefectDeptModeVO.isPlacefile}
+    </if>
+    GROUP BY
+        a.modeId
     </select>
 
 </mapper>