Преглед изворни кода

病历数据块丢失明细相关代码提交

songxinlu пре 3 година
родитељ
комит
80686eb4c4

+ 31 - 0
daqe-center/src/main/java/com/lantone/daqe/dto/UpBlockLossByIdVO.java

@@ -0,0 +1,31 @@
+package com.lantone.daqe.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 通过id修改病历数据块丢失明细-接口出参
+ * @author: songxl
+ * @time: 2022/3/4 10:39
+ */
+@ApiModel(value = "通过id修改病历数据块丢失明细-接口出参")
+@Getter
+@Setter
+public class UpBlockLossByIdVO implements Serializable {
+
+    private static final long serialVersionUID = 2135752709548682595L;
+
+    @ApiModelProperty(value = "编号")
+    private Long id;
+
+    @ApiModelProperty(value = "丢失原因")
+    private String lossCause;
+
+    @ApiModelProperty(value = "核查结果 0:未通过,1:已通过,2:未核查")
+    private String isAudited;
+
+}

+ 21 - 0
daqe-center/src/main/java/com/lantone/daqe/facade/BlockLossManagementFacade.java

@@ -3,8 +3,11 @@ package com.lantone.daqe.facade;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.lantone.daqe.dto.GetBlockLossPageDTO;
+import com.lantone.daqe.dto.UpBlockLossByIdVO;
+import com.lantone.daqe.entity.BlocklossResult;
 import com.lantone.daqe.facade.base.BlocklossResultFacade;
 import com.lantone.daqe.vo.GetBlockLossPageVO;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -19,7 +22,25 @@ public class BlockLossManagementFacade {
     private BlocklossResultFacade blocklossResultFacade;
 
 
+    /**
+     * 获取病历数据丢失明细分页列表
+     *
+     * @param getBlockLossPageVO
+     * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.lantone.daqe.dto.GetBlockLossPageDTO>
+     */
     public IPage<GetBlockLossPageDTO> getBlockLossPage(GetBlockLossPageVO getBlockLossPageVO) {
         return blocklossResultFacade.getBaseMapper().getBlockLossPage(getBlockLossPageVO);
     }
+
+    /**
+     * 通过id修改病历数据块丢失明细
+     *
+     * @param upBlockLossByIdVO
+     * @Return java.lang.Boolean
+     */
+    public Boolean upBlockLossById(UpBlockLossByIdVO upBlockLossByIdVO) {
+        BlocklossResult blocklossResult = new BlocklossResult();
+        BeanUtils.copyProperties(upBlockLossByIdVO, blocklossResult);
+        return blocklossResultFacade.updateById(blocklossResult);
+    }
 }

+ 2 - 1
daqe-center/src/main/java/com/lantone/daqe/mapper/BlocklossResultMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.lantone.daqe.dto.GetBlockLossPageDTO;
 import com.lantone.daqe.entity.BlocklossResult;
 import com.lantone.daqe.vo.GetBlockLossPageVO;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -13,5 +14,5 @@ import com.lantone.daqe.vo.GetBlockLossPageVO;
  */
 public interface BlocklossResultMapper extends BaseMapper<BlocklossResult> {
 
-    IPage<GetBlockLossPageDTO> getBlockLossPage(GetBlockLossPageVO getBlockLossPageVO);
+    IPage<GetBlockLossPageDTO> getBlockLossPage(@Param("getBlockLossPageVO") GetBlockLossPageVO getBlockLossPageVO);
 }

+ 3 - 0
daqe-center/src/main/java/com/lantone/daqe/vo/GetBlockLossPageVO.java

@@ -20,6 +20,9 @@ public class GetBlockLossPageVO extends Page {
 
     private static final long serialVersionUID = -7490180392492391778L;
 
+    @ApiModelProperty(value = "医院id")
+    private Long hospitalId;
+
     @ApiModelProperty(value = "开始日期")
     private Date startDate;
 

+ 9 - 0
daqe-center/src/main/java/com/lantone/daqe/web/BlockLossManagementController.java

@@ -3,6 +3,7 @@ package com.lantone.daqe.web;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.lantone.common.api.CommonResult;
 import com.lantone.daqe.dto.GetBlockLossPageDTO;
+import com.lantone.daqe.dto.UpBlockLossByIdVO;
 import com.lantone.daqe.facade.BlockLossManagementFacade;
 import com.lantone.daqe.vo.GetBlockLossPageVO;
 import io.swagger.annotations.Api;
@@ -13,6 +14,8 @@ 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: 病历数据丢失明细API
  * @author: songxl
@@ -32,4 +35,10 @@ public class BlockLossManagementController {
         return CommonResult.success(blockLossManagementFacade.getBlockLossPage(getBlockLossPageVO));
     }
 
+    @ApiOperation(value = "通过id修改病历数据块丢失明细 [by:songxl]", notes = "通过id修改病历数据块丢失明细")
+    @PostMapping("/upBlockLossById")
+    public CommonResult<Boolean> upBlockLossById(@RequestBody @Valid UpBlockLossByIdVO upBlockLossByIdVO) {
+        return CommonResult.success(blockLossManagementFacade.upBlockLossById(upBlockLossByIdVO));
+    }
+
 }

+ 40 - 13
daqe-center/src/main/resources/mapper/BlocklossResultMapper.xml

@@ -9,23 +9,50 @@
         rec_id,
         rec_title,
         loss_cause,
-        loss_type,
-        loss_way,
+        CASE WHEN loss_type = '0' THEN '文书丢失'
+        WHEN loss_type = '1' THEN '病案首页丢失'
+        ELSE '患者信息丢失' END AS loss_type,
+        CASE WHEN loss_way = '0' THEN '外部丢失'
+        ELSE '内部丢失' END AS loss_way,
         gmt_modified,
-        `status`,
-        is_audited
+        CASE WHEN `status` = '0' THEN '已丢失'
+        ELSE '已恢复' END AS `status`,
+        CASE WHEN loss_type = '0' THEN '未通过'
+        WHEN loss_type = '1' THEN '已通过'
+        ELSE '未核查' END AS is_audited
         FROM
         `dc_blockloss_result`
         WHERE
         is_deleted = "N"
-<!--        AND gmt_create >= ""-->
-<!--        AND gmt_create < ""-->
-        AND behospital_code = ""
-        AND rec_id = ""
-        AND rec_title LIKE "%%"
-        AND loss_type = ""
-        AND loss_way = ""
-        AND is_audited = ""
-        AND `status` = ""
+        <if test="getBlockLossPageVO.hospitalId != null">
+            AND hospital_id = #{getBlockLossPageVO.hospitalId}
+        </if>
+        <if test="getBlockLossPageVO.startDate != null">
+            <![CDATA[AND gmt_create >= #{getBlockLossPageVO.startDate}]]>
+        </if>
+        <if test="getBlockLossPageVO.endDate != null">
+            <![CDATA[ AND gmt_create <= #{getBlockLossPageVO.endDate}]]>
+        </if>
+        <if test="getBlockLossPageVO.behospitalCode != null and getBlockLossPageVO.behospitalCode != ''">
+            AND behospital_code = #{getBlockLossPageVO.behospitalCode}
+        </if>
+        <if test="getBlockLossPageVO.recId != null and getBlockLossPageVO.recId != ''">
+            AND rec_id = #{getBlockLossPageVO.recId}
+        </if>
+        <if test="getBlockLossPageVO.recTitle != null and getBlockLossPageVO.recTitle != ''">
+            AND rec_title LIKE CONCAT('%',#{getBlockLossPageVO.recTitle},'%')
+        </if>
+        <if test="getBlockLossPageVO.recId != null and getBlockLossPageVO.recId != ''">
+            AND loss_type = #{getBlockLossPageVO.lossType}
+        </if>
+        <if test="getBlockLossPageVO.recId != null and getBlockLossPageVO.recId != ''">
+            AND loss_way = #{getBlockLossPageVO.lossWay}
+        </if>
+        <if test="getBlockLossPageVO.recId != null and getBlockLossPageVO.recId != ''">
+            AND is_audited = #{getBlockLossPageVO.isAudited}
+        </if>
+        <if test="getBlockLossPageVO.recId != null and getBlockLossPageVO.recId != ''">
+            AND `status` = #{getBlockLossPageVO.status}
+        </if>
     </select>
 </mapper>