Commit 33c98c37 by zhangkb

考核指标目录添加获取第一个有效目录接口

parent bfe8127f
...@@ -53,7 +53,7 @@ public class IndCatalogCtrl { ...@@ -53,7 +53,7 @@ public class IndCatalogCtrl {
return indCatalogService.getCatalogByKeyword(keyword,codes); return indCatalogService.getCatalogByKeyword(keyword,codes);
} }
@ApiOperation(value = "获取第一个有效的目录节点", notes = "获取第一个有效的目录节点") @ApiOperation(value = "获取第一个有效的基础目录节点", notes = "获取第一个有效的基础目录节点")
@PostMapping(value = "/getFirstVaildBaseIndCatalog") @PostMapping(value = "/getFirstVaildBaseIndCatalog")
public IndCatalog getFirstVaildBaseIndCatalog(@RequestParam Integer pid, public IndCatalog getFirstVaildBaseIndCatalog(@RequestParam Integer pid,
@RequestParam List<String> codes){ @RequestParam List<String> codes){
...@@ -87,4 +87,11 @@ public class IndCatalogCtrl { ...@@ -87,4 +87,11 @@ public class IndCatalogCtrl {
@RequestParam List<String> codes){ @RequestParam List<String> codes){
return driveIndCatalogService.getCatalogByKeyword(keyword,codes); return driveIndCatalogService.getCatalogByKeyword(keyword,codes);
} }
@ApiOperation(value = "获取第一个有效的考核目录节点", notes = "获取第一个有效的考核目录节点")
@PostMapping(value = "/getFirstVaildDriveIndCatalog")
public DriveIndCatalog getFirstVaildDriveIndCatalog(@RequestParam Integer pid,
@RequestParam List<String> codes){
return driveIndCatalogService.getFirstVaildCatalog(pid, codes);
}
} }
...@@ -18,4 +18,6 @@ public interface DriveIndCatalogMapper extends BaseMapper<DriveIndCatalog>{ ...@@ -18,4 +18,6 @@ public interface DriveIndCatalogMapper extends BaseMapper<DriveIndCatalog>{
public List<DriveIndCatalog> findByParentId(@Param("pid") Integer pid); public List<DriveIndCatalog> findByParentId(@Param("pid") Integer pid);
public List<DriveIndCatalog> findByKeyword(Map<String,Object> params); public List<DriveIndCatalog> findByKeyword(Map<String,Object> params);
public List<DriveIndCatalog> findFirstVaildCatalog(Map<String,Object> params);
} }
...@@ -93,4 +93,15 @@ public class DriveIndCatalogService { ...@@ -93,4 +93,15 @@ public class DriveIndCatalogService {
params.put("codes", codes); params.put("codes", codes);
return driveIndCatalogMapper.findByKeyword(params); return driveIndCatalogMapper.findByKeyword(params);
} }
public DriveIndCatalog getFirstVaildCatalog(Integer pid,List<String> codes) {
Map<String,Object> params = new HashMap<>();
params.put("pidPath", pid+";"+"%");
params.put("codes", codes);
List<DriveIndCatalog> resultList = driveIndCatalogMapper.findFirstVaildCatalog(params);
if(!resultList.isEmpty()) {
return resultList.get(0);
}
return null;
}
} }
...@@ -36,4 +36,16 @@ ...@@ -36,4 +36,16 @@
#{id} #{id}
</foreach> </foreach>
</select> </select>
<select id="findFirstVaildCatalog" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndCatalog" >
select *
from drive_ind_catalog
where id_path like #{pidPath} and
catalog_type = '1' and
code in
<foreach item="id" collection="codes" open="(" close=")" separator=",">
#{id}
</foreach>
order by last_update_time desc
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment