Compare commits
2 Commits
5c8824eaae
...
e59dbd413d
Author | SHA1 | Date |
---|---|---|
wangliwen | e59dbd413d | |
wangliwen | 80bb545457 |
|
@ -240,8 +240,13 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
||||||
QueryWrapper wrapper = new QueryWrapper();
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
wrapper.eq("fuse_id", fuseId);
|
wrapper.eq("fuse_id", fuseId);
|
||||||
List<TbFuseResourceEntity> list = fuseResourceDao.selectList(wrapper);
|
List<TbFuseResourceEntity> list = fuseResourceDao.selectList(wrapper);
|
||||||
Map<String, List<TbFuseResourceEntity>> resourceMap = list.stream().filter(index -> index.getType() != null).collect(Collectors.groupingBy(TbFuseResourceEntity::getType));
|
result = list.stream().map(index -> {
|
||||||
|
TbFuseResourceDTO dto = new TbFuseResourceDTO();
|
||||||
|
dto.setFuseId(fuseId);
|
||||||
|
BeanUtils.copyProperties(index, dto);
|
||||||
|
return dto;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
// Map<String, List<TbFuseResourceEntity>> resourceMap = list.stream().filter(index -> index.getType() != null).collect(Collectors.groupingBy(TbFuseResourceEntity::getType));
|
||||||
// resourceMap.forEach((type, value) -> {
|
// resourceMap.forEach((type, value) -> {
|
||||||
// if ("组件服务".equals(type)) {
|
// if ("组件服务".equals(type)) {
|
||||||
// result.addAll(value.stream().map(attr -> {
|
// result.addAll(value.stream().map(attr -> {
|
||||||
|
|
|
@ -775,4 +775,25 @@ public class TAbilityApplicationController {
|
||||||
return new Result().ok(tAbilityApplicationService.getApplyPriceCount());
|
return new Result().ok(tAbilityApplicationService.getApplyPriceCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据能力资源id获取该能力申请使用分页
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("page_for_score")
|
||||||
|
@ApiOperation("用于评分的分页")
|
||||||
|
@ApiImplicitParams({@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
||||||
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "ended", value = "是否完成(true, false)", paramType = "query", dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "resourceId", value = "资源id", paramType = "query", dataType = "String")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
public Result<PageData<TAbilityApplicationDTO>> pageForScore(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
|
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
||||||
|
return new Result<PageData<TAbilityApplicationDTO>>().ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -24,10 +24,18 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="getFuseDTOList" resultMap="fuseDTO">
|
<select id="getFuseDTOList" resultMap="fuseDTO">
|
||||||
select tf.*, count(trc.id) as collectCount, if(sum(trc.user_id=#{userId})>0 , 'true', 'false') as isCollect
|
SELECT
|
||||||
from tb_fuse tf left join (select id, resource_Id, user_id from tb_resource_collection where 1=1 and del_flag=0)
|
tf.*,
|
||||||
trc on tf.id=trc.resource_id
|
count( trc.id ) AS collectCount,
|
||||||
where 1=1
|
IF
|
||||||
|
(
|
||||||
|
sum(
|
||||||
|
trc.user_id = #{userId})>0 , 'true', 'false') as isCollect
|
||||||
|
FROM
|
||||||
|
tb_fuse tf
|
||||||
|
LEFT JOIN ( SELECT id, resource_Id, user_id FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 ) trc ON tf.id = trc.resource_id
|
||||||
|
WHERE
|
||||||
|
1 =1
|
||||||
<if test="name != null and name != ''">
|
<if test="name != null and name != ''">
|
||||||
and name like concat('%', #{name}, '%')
|
and name like concat('%', #{name}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
Loading…
Reference in New Issue