一些無用的改動
This commit is contained in:
parent
8af8d1282f
commit
c009850d30
|
@ -47,7 +47,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@Service
|
||||
public class ActHistoryService {
|
||||
private static Logger logger = LoggerFactory.getLogger(ActHistoryService.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActHistoryService.class);
|
||||
|
||||
@Autowired
|
||||
protected RepositoryService repositoryService;
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/**
|
||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
||||
* <p>
|
||||
* https://www.renren.io
|
||||
* <p>
|
||||
* 版权所有,侵权必究!
|
||||
*/package io.renren.modules.notice.enums;
|
||||
package io.renren.modules.notice.enums;
|
||||
|
||||
/**
|
||||
* 通知阅读状态枚举
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/**
|
||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
||||
* <p>
|
||||
* https://www.renren.io
|
||||
* <p>
|
||||
* 版权所有,侵权必究!
|
||||
*/package io.renren.modules.notice.enums;
|
||||
package io.renren.modules.notice.enums;
|
||||
|
||||
/**
|
||||
* 通知状态枚举
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/**
|
||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
||||
* <p>
|
||||
* https://www.renren.io
|
||||
* <p>
|
||||
* 版权所有,侵权必究!
|
||||
*/package io.renren.modules.notice.enums;
|
||||
package io.renren.modules.notice.enums;
|
||||
|
||||
/**
|
||||
* 接受者类型枚举
|
||||
|
|
|
@ -41,6 +41,7 @@ import java.util.Map;
|
|||
@RequestMapping("/resource")
|
||||
@Api(tags = "资源表")
|
||||
public class ResourceController {
|
||||
|
||||
@Value("${qdyjj.ipAndPort}")
|
||||
private String ipAndPort;
|
||||
|
||||
|
@ -77,7 +78,7 @@ public class ResourceController {
|
|||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(ResourceController.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceController.class);
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("分页查询资源信息")
|
||||
|
@ -93,9 +94,7 @@ public class ResourceController {
|
|||
})
|
||||
public Result<PageData<ResourceDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
PageData<ResourceDTO> page = resourceService.page(params);
|
||||
page.getList().forEach(item -> {
|
||||
item.setInfoList(resourceService.selectAttrsByResourceId(item.getId()));
|
||||
});
|
||||
page.getList().forEach(item -> item.setInfoList(resourceService.selectAttrsByResourceId(item.getId())));
|
||||
return new Result<PageData<ResourceDTO>>().ok(page);
|
||||
}
|
||||
|
||||
|
@ -192,7 +191,7 @@ public class ResourceController {
|
|||
@LogOperation("修改")
|
||||
//@RequiresPermissions("resource:resource:update")
|
||||
public Result update(@RequestBody ResourceDTO dto) {
|
||||
////效验数据
|
||||
//效验数据
|
||||
//ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
|
||||
resourceService.updateWithAttrs(dto);
|
||||
|
|
|
@ -23,10 +23,7 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
|
|||
|
||||
List<ResourceDTO> selectWithAttrs(@Param("dto") ResourceDTO resourceDTO,
|
||||
@Param("orderField") String orderField,
|
||||
@Param("orderType") String orderType,
|
||||
@Param("pageNum") Integer pageNum,
|
||||
@Param("pageSize") Integer pageSize
|
||||
);
|
||||
@Param("orderType") String orderType);
|
||||
|
||||
List<Map> selectTypeCount();
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@Service
|
||||
public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEntity, ResourceDTO> implements ResourceService {
|
||||
private static Logger logger = LoggerFactory.getLogger(ResourceServiceImpl.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceServiceImpl.class);
|
||||
@Value("${zsk.appid}")
|
||||
private String appId;
|
||||
|
||||
|
@ -143,6 +143,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
BeanUtils.copyProperties(dto, resourceEntity);
|
||||
Long resourceID = IdWorker.getId(resourceEntity);
|
||||
resourceEntity.setId(resourceID);
|
||||
resourceEntity.setVisits(0L);
|
||||
if (dto.getDelFlag() == null) {
|
||||
resourceEntity.setDelFlag(ResourceEntityDelFlag.NORMAL.getFlag());
|
||||
}
|
||||
|
@ -215,13 +216,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
Page<ResourceDTO> resultPage = new Page<>(pageNum, pageSize);
|
||||
if (resourceDTO.getInfoList().isEmpty()) {
|
||||
List<ResourceDTO> resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType);
|
||||
//resourceDTOS.forEach(item -> {
|
||||
// item.setInfoList(this.selectAttrsByResourceId(item.getId()));
|
||||
//});
|
||||
resultPage.setRecords(resourceDTOS);
|
||||
resultPage.setTotal(resourceDao.selectDTOPage(resourceDTO, 0, 100000, orderField, orderType).size());
|
||||
} else {
|
||||
List<ResourceDTO> resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType, (pageNum - 1) * pageSize, pageSize);
|
||||
List<ResourceDTO> resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType);
|
||||
int j = Math.min(pageNum * pageSize, resourceDTOS.size());
|
||||
if (resourceDTOS.isEmpty()) {
|
||||
resultPage.setRecords(null);
|
||||
|
@ -302,7 +300,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
@Override
|
||||
public Object selectRecommend() {
|
||||
Long userId = SecurityUser.getUser().getId();
|
||||
//根据用户收藏和申请数据查出应用领域排名,在根据应用领域查询热门能力推荐给用户
|
||||
//根据用户收藏和申请数据查出应用领域排名,再根据应用领域查询热门能力推荐给用户
|
||||
List<Map> applyAreaList = resourceDao.selectApplyArea(userId);
|
||||
//没有收藏和申请过,按最热能力选取,否则根据应用领域最多类型推荐
|
||||
JSONObject object = new JSONObject();
|
||||
|
@ -324,19 +322,19 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
jsonObject.put("pageSize", 9);
|
||||
jsonObject.put("orderField", "total");
|
||||
jsonObject.put("orderType", "DESC");
|
||||
Page<ResourceDTO> Page = (Page<ResourceDTO>) this.pageWithAttrs(jsonObject);
|
||||
Page<ResourceDTO> page = (Page<ResourceDTO>) this.pageWithAttrs(jsonObject);
|
||||
//若查出数据不足9条则在热门能力补充缺少的数量
|
||||
if (Page.getRecords().size() < 9) {
|
||||
for (int i = 0; Page.getRecords().size() < 9; i++) {
|
||||
for (int j = 0; j < Page.getRecords().size(); j++) {
|
||||
if (!Page.getRecords().get(j).getId().equals(resultPage.getRecords().get(i).getId())) {
|
||||
Page.getRecords().add(resultPage.getRecords().get(i));
|
||||
if (page.getRecords().size() < 9) {
|
||||
for (int i = 0; page.getRecords().size() < 9; i++) {
|
||||
for (int j = 0; j < page.getRecords().size(); j++) {
|
||||
if (!page.getRecords().get(j).getId().equals(resultPage.getRecords().get(i).getId())) {
|
||||
page.getRecords().add(resultPage.getRecords().get(i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Page;
|
||||
return page;
|
||||
} else {
|
||||
return resultPage;
|
||||
}
|
||||
|
@ -344,8 +342,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
|
||||
@Override
|
||||
public List<Map<String, Object>> getAmountGroupByType() {
|
||||
List<Map<String, Object>> amountInfo = resourceDao.getAmountGroupByType();
|
||||
return amountInfo;
|
||||
return resourceDao.getAmountGroupByType();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -374,9 +371,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("type", item.getKey());
|
||||
map.put("total", resourceDao.selectTypeCountByDept(item.getKey(), jsonObject.getString("type")));
|
||||
item.getValue().forEach(item1 -> {
|
||||
item1.remove("type");
|
||||
});
|
||||
item.getValue().forEach(item1 -> item1.remove("type"));
|
||||
map.put("dataList", item.getValue());
|
||||
resultList.add(map);
|
||||
});
|
||||
|
@ -387,14 +382,12 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
areaMap.put("type", "区级");
|
||||
areaMap.put("total", resourceDao.selectTypeCountByDept("区级", jsonObject.getString("type")));
|
||||
ArrayList<Map> areaListTemp = new ArrayList<>();
|
||||
areaTypeList.orElse(new HashMap<>()).entrySet().stream().forEach(item -> {
|
||||
areaTypeList.orElse(new HashMap<>()).forEach((key, value) -> {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("type", item.getKey());
|
||||
map.put("total", resourceDao.selectTypeCountByDist(item.getKey(), jsonObject.getString("type")));
|
||||
item.getValue().forEach(item1 -> {
|
||||
item1.remove("type");
|
||||
});
|
||||
map.put("dataList", item.getValue());
|
||||
map.put("type", key);
|
||||
map.put("total", resourceDao.selectTypeCountByDist(key, jsonObject.getString("type")));
|
||||
value.forEach(item1 -> item1.remove("type"));
|
||||
map.put("dataList", value);
|
||||
areaListTemp.add(map);
|
||||
});
|
||||
areaMap.put("dataList", areaListTemp);
|
||||
|
@ -428,13 +421,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
}
|
||||
};
|
||||
List<Map> deptTypeCount = resourceDao.selectDeptTypeCount();
|
||||
map.entrySet().forEach(item -> {
|
||||
deptTypeCount.forEach(index -> {
|
||||
map.entrySet().forEach(item -> deptTypeCount.forEach(index -> {
|
||||
if (index.get("type").equals(item.getKey())) {
|
||||
item.setValue(index.get("count"));
|
||||
}
|
||||
});
|
||||
});
|
||||
}));
|
||||
resultMap.put("deptTypeCount", map);
|
||||
List<Map> deptTotalCount = resourceDao.selectDeptTotalCount();
|
||||
HashMap<String, Object> map1 = new HashMap() {
|
||||
|
@ -446,13 +437,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
put("20", 0);
|
||||
}
|
||||
};
|
||||
map1.entrySet().forEach(item -> {
|
||||
deptTotalCount.forEach(index -> {
|
||||
map1.entrySet().forEach(item -> deptTotalCount.forEach(index -> {
|
||||
if (index.get("type").equals(item.getKey())) {
|
||||
item.setValue(index.get("total"));
|
||||
}
|
||||
});
|
||||
});
|
||||
}));
|
||||
resultMap.put("deptTotalCount", map1);
|
||||
return resultMap;
|
||||
}
|
||||
|
@ -515,9 +504,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
typeCountListMap.forEach((k, v) -> {
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("name", k);
|
||||
v.forEach(item -> {
|
||||
map.put(item.get("type").toString(), item.get("count"));
|
||||
});
|
||||
v.forEach(item -> map.put(item.get("type").toString(), item.get("count")));
|
||||
resultList.add(map);
|
||||
});
|
||||
return resultList;
|
||||
|
@ -531,9 +518,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
typeCountListMap.forEach((k, v) -> {
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("name", k);
|
||||
v.forEach(item -> {
|
||||
map.put(item.get("type").toString(), item.get("count"));
|
||||
});
|
||||
v.forEach(item -> map.put(item.get("type").toString(), item.get("count")));
|
||||
resultList.add(map);
|
||||
});
|
||||
return resultList;
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
*/
|
||||
@Component("knowledgeBaseTask")
|
||||
public class KnowledgeBaseTask implements ITask {
|
||||
private static Logger logger = LoggerFactory.getLogger(KnowledgeBaseTask.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(KnowledgeBaseTask.class);
|
||||
@Autowired
|
||||
private ResourceService resourceService;
|
||||
|
||||
|
|
|
@ -2,14 +2,12 @@ package io.renren.modules.resourceBrowse.service.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.common.service.impl.CrudServiceImpl;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.utils.DateUtils;
|
||||
import io.renren.modules.resourceBrowse.dao.ResourceBrowseDao;
|
||||
import io.renren.modules.resourceBrowse.dto.ResourceBrowseDTO;
|
||||
import io.renren.modules.resourceBrowse.entity.ResourceBrowseEntity;
|
||||
import io.renren.modules.resourceBrowse.service.ResourceBrowseService;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -64,12 +62,12 @@ public class ResourceBrowseServiceImpl extends CrudServiceImpl<ResourceBrowseDao
|
|||
startDay = DateUtils.addDateDays(startDay, 1);
|
||||
}
|
||||
ArrayList<Map<String, Object>> resultMap = new ArrayList<>();
|
||||
for (int i = 0; i < dayList.size(); i++) {
|
||||
for (String s : dayList) {
|
||||
HashMap<String, Object> dayMap = new HashMap<>();
|
||||
dayMap.put(dayList.get(i), 0);
|
||||
dayMap.put(s, 0);
|
||||
for (Map map : maps) {
|
||||
if (dayList.get(i).equals(map.get("date"))) {
|
||||
dayMap.put(dayList.get(i), map.get("count"));
|
||||
if (s.equals(map.get("date"))) {
|
||||
dayMap.put(s, map.get("count"));
|
||||
}
|
||||
}
|
||||
resultMap.add(dayMap);
|
||||
|
|
|
@ -4,20 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.renren.common.service.impl.CrudServiceImpl;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.modules.resource.service.ResourceService;
|
||||
import io.renren.modules.resourceCar.dto.ResourceCarDTO;
|
||||
import io.renren.modules.resourceCollection.dao.ResourceCollectionDao;
|
||||
import io.renren.modules.resourceCollection.dto.ResourceCollectionDTO;
|
||||
import io.renren.modules.resourceCollection.entity.ResourceCollectionEntity;
|
||||
import io.renren.modules.resourceCollection.service.ResourceCollectionService;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
import io.renren.modules.security.user.UserDetail;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -52,9 +48,7 @@ public class ResourceCollectionServiceImpl extends CrudServiceImpl<ResourceColle
|
|||
Page<ResourceCollectionDTO> page = new Page(pageNum, pageSize);
|
||||
params.put("userId", user.getId());
|
||||
List<ResourceCollectionDTO> resourceCollectionDTOS = resourceCollectionDao.selectPageWithResource(params, (pageNum - 1) * pageSize, pageSize);
|
||||
resourceCollectionDTOS.forEach(item -> {
|
||||
item.setResourceDTO(resourceService.selectWithAttrs(item.getResourceId()));
|
||||
});
|
||||
resourceCollectionDTOS.forEach(item -> item.setResourceDTO(resourceService.selectWithAttrs(item.getResourceId())));
|
||||
List<ResourceCollectionDTO> resourceCollectionDTOSs = resourceCollectionDao.selectPageWithResource(params, 0, 100000);
|
||||
page.setRecords(resourceCollectionDTOS);
|
||||
page.setTotal(resourceCollectionDTOSs.size());
|
||||
|
|
|
@ -3,14 +3,10 @@ package io.renren.modules.workDynamics.service.impl;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.common.service.impl.CrudServiceImpl;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.modules.workDynamics.dao.WorkDynamicsDao;
|
||||
import io.renren.modules.workDynamics.dto.WorkDynamicsDTO;
|
||||
import io.renren.modules.workDynamics.entity.WorkDynamicsEntity;
|
||||
import io.renren.modules.workDynamics.service.WorkDynamicsService;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
|
@ -1,10 +1,3 @@
|
|||
/**
|
||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
||||
* <p>
|
||||
* https://www.renren.io
|
||||
* <p>
|
||||
* 版权所有,侵权必究!
|
||||
*/
|
||||
package io.renren.websocket;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
@ -31,7 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
@Component
|
||||
@ServerEndpoint(value = "/websocket", configurator = WebSocketConfig.class)
|
||||
public class WebSocketServer {
|
||||
private static Logger logger = LoggerFactory.getLogger(WebSocketServer.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(WebSocketServer.class);
|
||||
|
||||
public WebSocketServer() {
|
||||
logger.info("-------------websocket----------------");
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/**
|
||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
||||
* <p>
|
||||
* https://www.renren.io
|
||||
* <p>
|
||||
* 版权所有,侵权必究!
|
||||
*/package io.renren.websocket.config;
|
||||
package io.renren.websocket.config;
|
||||
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/**
|
||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
||||
* <p>
|
||||
* https://www.renren.io
|
||||
* <p>
|
||||
* 版权所有,侵权必究!
|
||||
*/package io.renren.websocket.data;
|
||||
package io.renren.websocket.data;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/**
|
||||
* Copyright (c) 2016-2020 人人开源 All rights reserved.
|
||||
* <p>
|
||||
* https://www.renren.io
|
||||
* <p>
|
||||
* 版权所有,侵权必究!
|
||||
*/package io.renren.websocket.data;
|
||||
package io.renren.websocket.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
|
|
@ -87,6 +87,7 @@ system:
|
|||
|
||||
yawei:
|
||||
enable: true
|
||||
|
||||
#知识库
|
||||
zsk:
|
||||
url:
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
====================================================================================================================
|
||||
|
||||
欢迎使用 renren-security 人人权限专业版 - Powered By https://www.renren.io
|
||||
|
||||
====================================================================================================================
|
||||
.----------------. .----------------. .----------------. .----------------. .----------------.
|
||||
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
|
||||
| | ____ ____ | || | _________ | || | ____ ____ | || | ________ | || | ________ | |
|
||||
| | |_ _||_ _| | || | | _ _ | | || | |_ || _| | || | |_ ___ `. | || | | __ _| | |
|
||||
| | \ \ / / | || | |_/ | | \_| | || | | |__| | | || | | | `. \ | || | |_/ / / | |
|
||||
| | \ \/ / | || | | | | || | | __ | | || | | | | | | || | .'.' _ | |
|
||||
| | _| |_ | || | _| |_ | || | _| | | |_ | || | _| |___.' / | || | _/ /__/ | | |
|
||||
| | |______| | || | |_____| | || | |____||____| | || | |________.' | || | |________| | |
|
||||
| | | || | | || | | || | | || | | |
|
||||
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
|
||||
'----------------' '----------------' '----------------' '----------------' '----------------'
|
|
@ -121,10 +121,11 @@
|
|||
0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag
|
||||
= 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, user_id, ( CASE COUNT( id ) WHEN 1 THEN 'true' ELSE 'false' END ) AS "isCollect"
|
||||
LEFT JOIN ( SELECT resource_id, user_id, ( IF(COUNT( id ) = 1, 'true', 'false') ) AS "isCollect"
|
||||
FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator} GROUP BY resource_id
|
||||
) trc2 ON tdr.id = trc2.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, user_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator}
|
||||
LEFT JOIN ( SELECT resource_id, user_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0
|
||||
AND user_id = #{dto.creator}
|
||||
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||
WHERE 1 = 1
|
||||
|
@ -251,14 +252,17 @@
|
|||
( taa2.approve_status < 1, '未申请', "已申请" ) AS "applyState"
|
||||
FROM
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN ( SELECT resource_id, AVG( score ) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) trs ON tdr.id = trs.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, AVG( score ) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0
|
||||
GROUP BY resource_id ) trs ON tdr.id = trs.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag
|
||||
= 0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND
|
||||
del_flag = 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
resource_id,
|
||||
user_id,
|
||||
( CASE COUNT( id ) WHEN 1 THEN 'true' ELSE 'false' END ) AS "isCollect"
|
||||
( IF(COUNT( id ) = 1, 'true', 'false') ) AS "isCollect"
|
||||
FROM
|
||||
tb_resource_collection
|
||||
WHERE
|
||||
|
@ -268,7 +272,8 @@
|
|||
GROUP BY
|
||||
resource_id
|
||||
) trc2 ON tdr.id = trc2.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND user_id = #{userId} GROUP BY resource_id ) taa2 ON tdr.id = taa2.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
|
||||
AND del_flag = 0 AND user_id = #{userId} GROUP BY resource_id ) taa2 ON tdr.id = taa2.resource_id
|
||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||
WHERE
|
||||
1 = 1
|
||||
|
@ -293,10 +298,11 @@
|
|||
0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag
|
||||
= 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
|
||||
LEFT JOIN ( SELECT resource_id, user_id, ( CASE COUNT( id ) WHEN 1 THEN 'true' ELSE 'false' END ) AS "isCollect"
|
||||
LEFT JOIN ( SELECT resource_id, user_id, ( IF(COUNT( id ) = 1, 'true', 'false') ) AS "isCollect"
|
||||
FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator}
|
||||
GROUP BY resource_id) trc2 ON tdr.id = trc2.resource_id
|
||||
LEFT JOIN ( SELECT DISTINCT resource_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator}
|
||||
LEFT JOIN ( SELECT DISTINCT resource_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0
|
||||
AND user_id = #{dto.creator}
|
||||
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||
WHERE 1 = 1
|
||||
|
@ -412,12 +418,12 @@
|
|||
FROM
|
||||
(
|
||||
SELECT
|
||||
*
|
||||
type,
|
||||
deptCount
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
|
||||
sd.NAME AS "deptName",
|
||||
IFNULL( tdr.deptCount, 0 ) AS "deptCount"
|
||||
FROM
|
||||
sys_dept sd
|
||||
|
@ -451,15 +457,13 @@
|
|||
FROM
|
||||
(
|
||||
SELECT
|
||||
*
|
||||
type, deptCount, districtName
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
|
||||
sd.NAME AS "deptName",
|
||||
IFNULL( tdr.deptCount, 0) AS "deptCount",
|
||||
IFNULL(sr.name, '暂无该地区') AS "districtName",
|
||||
sr.id AS "districtId"
|
||||
FROM
|
||||
sys_dept sd
|
||||
LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource
|
||||
|
@ -609,8 +613,7 @@
|
|||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT( id ) AS "count",
|
||||
dept_id
|
||||
COUNT( id ) AS "count"
|
||||
FROM
|
||||
tb_data_resource
|
||||
WHERE
|
||||
|
@ -673,8 +676,7 @@
|
|||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT( taa.id ) AS "count",
|
||||
su.dept_id
|
||||
COUNT( taa.id ) AS "count"
|
||||
FROM
|
||||
t_ability_application taa,
|
||||
sys_user su
|
||||
|
@ -787,7 +789,7 @@
|
|||
SELECT
|
||||
MAX( count ) AS "total"
|
||||
FROM
|
||||
( SELECT COUNT( id ) AS "count", type FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY type ) temp2
|
||||
( SELECT COUNT( id ) AS "count" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY type ) temp2
|
||||
)
|
||||
</select>
|
||||
|
||||
|
|
Loading…
Reference in New Issue