Browse Source

修改正则列表页接口,添加关联字段

songxinlu 3 years ago
parent
commit
c5f32a1c8a

+ 3 - 0
daqe-center/src/main/java/com/lantone/daqe/dto/GetRegularPageDTO.java

@@ -30,4 +30,7 @@ public class GetRegularPageDTO implements Serializable {
     @ApiModelProperty(value = "描述")
     @ApiModelProperty(value = "描述")
     private String description;
     private String description;
 
 
+    @ApiModelProperty(value = "1-已关联|0-未关联")
+    private String relation;
+
 }
 }

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

@@ -4,6 +4,7 @@ package com.lantone.daqe.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.google.common.collect.Lists;
 import com.lantone.common.enums.IsDeleteEnum;
 import com.lantone.common.enums.IsDeleteEnum;
 import com.lantone.common.util.BeanUtil;
 import com.lantone.common.util.BeanUtil;
 import com.lantone.common.util.DateUtil;
 import com.lantone.common.util.DateUtil;
@@ -535,6 +536,10 @@ public class BlockLossManagementFacade {
      * @Return com.lantone.daqe.dto.BlockLossTypeGatherDTO
      * @Return com.lantone.daqe.dto.BlockLossTypeGatherDTO
      */
      */
     public BlockLossTypeGatherDTO blockLossTypeGather(BlockLossTypeGatherVO blockLossTypeGatherVO) {
     public BlockLossTypeGatherDTO blockLossTypeGather(BlockLossTypeGatherVO blockLossTypeGatherVO) {
+        blockLossTypeGatherVO.setOperationUrls(Lists.newArrayList("save/saveBehospitalCode",
+                "save/saveHomePages",
+                "save/saveRecs"));
+
         BlockLossTypeGatherDTO blockLossTypeGatherDTO = new BlockLossTypeGatherDTO();
         BlockLossTypeGatherDTO blockLossTypeGatherDTO = new BlockLossTypeGatherDTO();
         //获取该时间段的日志数量
         //获取该时间段的日志数量
         Integer logNum = operationLogService.getOperationLogNum(blockLossTypeGatherVO).getData();
         Integer logNum = operationLogService.getOperationLogNum(blockLossTypeGatherVO).getData();

+ 1 - 17
daqe-center/src/main/java/com/lantone/daqe/facade/RegularManagementFacade.java

@@ -1,15 +1,12 @@
 package com.lantone.daqe.facade;
 package com.lantone.daqe.facade;
 
 
 
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.lantone.common.enums.IsDeleteEnum;
 import com.lantone.common.enums.IsDeleteEnum;
 import com.lantone.common.exception.Asserts;
 import com.lantone.common.exception.Asserts;
 import com.lantone.common.util.BeanUtil;
 import com.lantone.common.util.BeanUtil;
 import com.lantone.common.util.DateUtil;
 import com.lantone.common.util.DateUtil;
-import com.lantone.common.util.StringUtil;
 import com.lantone.common.util.SysUserUtils;
 import com.lantone.common.util.SysUserUtils;
 import com.lantone.daqe.dto.GetRegularPageDTO;
 import com.lantone.daqe.dto.GetRegularPageDTO;
 import com.lantone.daqe.entity.RegularInfo;
 import com.lantone.daqe.entity.RegularInfo;
@@ -26,8 +23,6 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
-import java.util.List;
-
 /**
 /**
  * @Description: 正则式维护-业务处理类
  * @Description: 正则式维护-业务处理类
  * @author: songxl
  * @author: songxl
@@ -52,18 +47,7 @@ public class RegularManagementFacade {
      * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.lantone.daqe.dto.GetRegularPageDTO>
      * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.lantone.daqe.dto.GetRegularPageDTO>
      */
      */
     public IPage<GetRegularPageDTO> getRegularPage(GetRegularPageVO getRegularPageVO) {
     public IPage<GetRegularPageDTO> getRegularPage(GetRegularPageVO getRegularPageVO) {
-
-        Page<GetRegularPageDTO> getRegularPageDTOPage = new Page<>();
-        QueryWrapper<RegularInfo> regularInfoQueryWrapper = new QueryWrapper<>();
-        regularInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
-        regularInfoQueryWrapper.like(StringUtil.isNotBlank(getRegularPageVO.getName()), "name", getRegularPageVO.getName());
-        Page<RegularInfo> regularInfoPage = new Page<>(getRegularPageVO.getCurrent(), getRegularPageVO.getSize());
-        regularInfoFacade.page(regularInfoPage, regularInfoQueryWrapper);
-        BeanUtil.copyProperties(regularInfoPage, getRegularPageDTOPage);
-        List<GetRegularPageDTO> getRegularPageDTOList = BeanUtil.listCopyTo(regularInfoPage.getRecords(), GetRegularPageDTO.class);
-
-        getRegularPageDTOPage.setRecords(getRegularPageDTOList);
-        return getRegularPageDTOPage;
+        return  regularInfoFacade.getBaseMapper().getRegularPage(getRegularPageVO);
     }
     }
 
 
     /**
     /**

+ 5 - 0
daqe-center/src/main/java/com/lantone/daqe/mapper/RegularInfoMapper.java

@@ -1,7 +1,11 @@
 package com.lantone.daqe.mapper;
 package com.lantone.daqe.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.daqe.dto.GetRegularPageDTO;
 import com.lantone.daqe.entity.RegularInfo;
 import com.lantone.daqe.entity.RegularInfo;
+import com.lantone.daqe.vo.GetRegularPageVO;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -10,4 +14,5 @@ import com.lantone.daqe.entity.RegularInfo;
  */
  */
 public interface RegularInfoMapper extends BaseMapper<RegularInfo> {
 public interface RegularInfoMapper extends BaseMapper<RegularInfo> {
 
 
+    IPage<GetRegularPageDTO> getRegularPage(@Param("getRegularPageVO") GetRegularPageVO getRegularPageVO);
 }
 }

+ 16 - 0
daqe-center/src/main/resources/mapper/RegularInfoMapper.xml

@@ -2,4 +2,20 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.lantone.daqe.mapper.RegularInfoMapper">
 <mapper namespace="com.lantone.daqe.mapper.RegularInfoMapper">
 
 
+    <select id="getRegularPage" resultType="com.lantone.daqe.dto.GetRegularPageDTO">
+        SELECT DISTINCT
+            dri.id,
+            dri.`name`,
+            dri.val,
+            dri.description,
+        CASE WHEN drm.id is NULL THEN 0
+            ELSE 1 END AS relation
+        FROM
+            `dc_regular_info` dri
+        LEFT JOIN dc_regular_mapping drm ON dri.id = drm.regular_id
+        WHERE drm.is_deleted = 'N'
+        <if test="getRegularPageVO.name != null and getRegularPageVO.name != ''">
+            AND dri.`name` LIKE CONCAT('%',#{getRegularPageVO.name},'%')
+        </if>
+    </select>
 </mapper>
 </mapper>