Compare commits
12 Commits
e090c4fd8a
...
d1b6ae5e14
Author | SHA1 | Date |
---|---|---|
wangliwen | d1b6ae5e14 | |
dinggang | db03b24e76 | |
wangliwen | 9598af3564 | |
wangliwen | 45c5bf7489 | |
liyongbo2 | 47e19db5de | |
liyongbo2 | 413f62c395 | |
wangliwen | 0aac656f83 | |
wangliwen | b165e91663 | |
liyongbo2 | e6b17da32a | |
wangliwen | e1edb302f5 | |
wangliwen | 0063546e5e | |
wangliwen | 5b66808e7c |
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `share_platform`.`tb_data_resource` ADD COLUMN `info_list` json NULL COMMENT '属性信息';
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE `share_platform`.`tb_work_dynamics`
|
||||
MODIFY COLUMN `note1` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '摘要';
|
|
@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
|
@ -55,7 +56,7 @@ public class CensusControllerV2 {
|
|||
@GetMapping(value = "/whole_amount")
|
||||
@ApiOperation("平台概览")
|
||||
public Result<List<Map<String, Object>>> wholeAmount() {
|
||||
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
|
||||
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
|
||||
|
||||
CompletableFuture<Void> userAmount = CompletableFuture.supplyAsync(() -> { // 获取平台用户总数
|
||||
return sysUserService.countAllUser();
|
||||
|
@ -102,7 +103,7 @@ public class CensusControllerV2 {
|
|||
@ApiOperation("应用资源数量统计")
|
||||
@LogOperation("应用资源数量统计")
|
||||
public Result<List<Map<String, Object>>> applicationNum() {
|
||||
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
|
||||
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
|
||||
|
||||
CompletableFuture<Void> allApplicationAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总应用数目
|
||||
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='应用资源';", Long.class);
|
||||
|
@ -156,7 +157,7 @@ public class CensusControllerV2 {
|
|||
}
|
||||
|
||||
private List<Map<String, Object>> resourceRank(Integer type) {
|
||||
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
|
||||
List<Map<String, Object>> result;
|
||||
List<Map<String, Object>> district = jdbcTemplate.queryForList("SELECT * FROM sys_dept WHERE type = " + type);
|
||||
List<Map<String, Long>> listMap =
|
||||
district.stream().map(index -> {
|
||||
|
@ -203,7 +204,7 @@ public class CensusControllerV2 {
|
|||
@ApiOperation("组件服务简况")
|
||||
@LogOperation("组件服务简况")
|
||||
public Result<List<Map<String, Object>>> assemblerInfo() {
|
||||
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
|
||||
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
|
||||
CompletableFuture<Void> allAssemblyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总组件服务数目
|
||||
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='组件服务' AND del_flag = 0;", Long.class);
|
||||
}).thenAccept(sum -> {
|
||||
|
@ -263,7 +264,7 @@ public class CensusControllerV2 {
|
|||
@ApiOperation("知识库简况")
|
||||
@LogOperation("知识库简况")
|
||||
public Result<List<Map<String, Object>>> knowledgeInfo() {
|
||||
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
|
||||
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
|
||||
CompletableFuture<Void> allKnowledgeAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总知识库数目
|
||||
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class);
|
||||
}).thenAccept(sum -> {
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* 操作日志
|
||||
|
@ -28,8 +29,8 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationD
|
|||
@Override
|
||||
public PageData<SysLogOperationDTO> page(Map<String, Object> params) {
|
||||
IPage<SysLogOperationEntity> page = baseDao.selectPage(
|
||||
getPage(params, Constant.CREATE_DATE, false),
|
||||
getWrapper(params)
|
||||
getPage(params, Constant.CREATE_DATE, false),
|
||||
getWrapper(params)
|
||||
);
|
||||
|
||||
return getPageData(page, SysLogOperationDTO.class);
|
||||
|
@ -42,7 +43,7 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationD
|
|||
return ConvertUtils.sourceToTarget(entityList, SysLogOperationDTO.class);
|
||||
}
|
||||
|
||||
private QueryWrapper<SysLogOperationEntity> getWrapper(Map<String, Object> params){
|
||||
private QueryWrapper<SysLogOperationEntity> getWrapper(Map<String, Object> params) {
|
||||
String status = (String) params.get("status");
|
||||
|
||||
QueryWrapper<SysLogOperationEntity> wrapper = new QueryWrapper<>();
|
||||
|
@ -54,7 +55,9 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationD
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(SysLogOperationEntity entity) {
|
||||
insert(entity);
|
||||
CompletableFuture.runAsync(() -> {
|
||||
insert(entity);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -210,7 +210,7 @@ public class ResourceController {
|
|||
@ApiOperation("导入")
|
||||
@LogOperation("导入")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "source", value = "请求来源", paramType = "string", dataType = "string")
|
||||
@ApiImplicitParam(name = "file", value = "数据文件文件", paramType = "file", dataType = "file")
|
||||
})
|
||||
public Result importResource(@RequestParam("file") MultipartFile uploadFile, HttpServletRequest request) {
|
||||
List<Map<String, Object>> dept =
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
package io.renren.modules.resource.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import io.renren.common.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资源表
|
||||
|
@ -130,4 +134,7 @@ public class ResourceEntity extends BaseEntity {
|
|||
* 提起下架人员
|
||||
*/
|
||||
private String undercarriageUserName;
|
||||
|
||||
@TableField(value = "info_list", typeHandler = FastjsonTypeHandler.class)
|
||||
private List<AttrEntity> infoList;
|
||||
}
|
|
@ -36,7 +36,7 @@ public class WorkDynamicsDTO implements Serializable {
|
|||
private Long updater;
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateDate;
|
||||
@ApiModelProperty(value = "备用字段1")
|
||||
@ApiModelProperty(value = "摘要")
|
||||
private String note1;
|
||||
@ApiModelProperty(value = "备用字段2")
|
||||
private String note2;
|
||||
|
|
|
@ -59,7 +59,7 @@ public class WorkDynamicsEntity {
|
|||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateDate;
|
||||
/**
|
||||
* 备用字段1
|
||||
* 摘要
|
||||
*/
|
||||
private String note1;
|
||||
/**
|
||||
|
|
|
@ -36,7 +36,7 @@ public class WorkDynamicsExcel {
|
|||
private Long updater;
|
||||
@ExcelProperty(value = "修改时间", index = 8)
|
||||
private Date updateDate;
|
||||
@ExcelProperty(value = "备用字段1", index = 9)
|
||||
@ExcelProperty(value = "摘要", index = 9)
|
||||
private String note1;
|
||||
@ExcelProperty(value = "备用字段2", index = 10)
|
||||
private String note2;
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
server:
|
||||
port: 8888
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
#MySQL
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://10.10.30.10:3306/nlpt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
|
||||
username: nlpt
|
||||
password: Nlpt@2022
|
||||
initial-size: 10
|
||||
max-active: 100
|
||||
min-idle: 10
|
||||
max-wait: 10
|
||||
pool-prepared-statements: true
|
||||
max-pool-prepared-statement-per-connection-size: 20
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 300000
|
||||
#Oracle需要打开注释
|
||||
validation-query: SELECT 1
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
filter:
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: false
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
|
||||
#上传的静态资源配置
|
||||
resource:
|
||||
root_url: 10.10.30.9
|
||||
pic-host: http://${resource.root_url}:${server.port}${server.servlet.context-path}
|
||||
path: /data1/services/nengli/files/
|
||||
devModelFilePath: /data1/services/nengli/files/devModelFile
|
||||
|
||||
# 大数据部门相关配置
|
||||
big_date:
|
||||
name: 青岛市大数据发展管理局
|
||||
assignee_role_name: 部门审批人
|
||||
|
||||
hisense:
|
||||
gateway:
|
||||
url: http://devtest-security-app.hismarttv.com:8080
|
||||
|
||||
#调用青岛应急局-查询青岛地区天气信息接口
|
||||
qdyjj:
|
||||
ipAndPort: 15.2.21.238:9015
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
server:
|
||||
port: 8888
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
#MySQL
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://10.10.30.10:3306/nlpt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
|
||||
username: nlpt
|
||||
password: Nlpt@2022
|
||||
initial-size: 10
|
||||
max-active: 100
|
||||
min-idle: 10
|
||||
max-wait: 10
|
||||
pool-prepared-statements: true
|
||||
max-pool-prepared-statement-per-connection-size: 20
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 300000
|
||||
#Oracle需要打开注释
|
||||
validation-query: SELECT 1
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
filter:
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: false
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
|
||||
#上传的静态资源配置
|
||||
resource:
|
||||
root_url: 10.10.30.9
|
||||
pic-host: http://${resource.root_url}:${server.port}${server.servlet.context-path}
|
||||
path: /data1/services/nengli/files/
|
||||
devModelFilePath: /data1/services/nengli/files/devModelFile
|
||||
|
||||
# 大数据部门相关配置
|
||||
big_date:
|
||||
name: 青岛市大数据发展管理局
|
||||
assignee_role_name: 部门审批人
|
||||
|
||||
hisense:
|
||||
gateway:
|
||||
url: http://devtest-security-app.hismarttv.com:8080
|
||||
|
||||
#调用青岛应急局-查询青岛地区天气信息接口
|
||||
qdyjj:
|
||||
ipAndPort: 15.2.21.238:9015
|
||||
|
|
@ -93,7 +93,7 @@ system:
|
|||
yawei:
|
||||
enable: true
|
||||
|
||||
#知识库
|
||||
#对接知识库相关配置
|
||||
zsk:
|
||||
url:
|
||||
sign: https://cms.qingdao.gov.cn:9020/api-gateway/jpaas-jags-server/interface/createsign.do
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `share_platform`.`tb_data_resource` ADD COLUMN `info_list` json NULL COMMENT '属性信息';
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE `share_platform`.`tb_work_dynamics`
|
||||
MODIFY COLUMN `note1` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '摘要';
|
|
@ -33,6 +33,8 @@
|
|||
<result property="enclosure" column="enclosure"/>
|
||||
<result property="undercarriageReason" column="undercarriage_reason"/>
|
||||
<result property="undercarriageUserName" column="undercarriage_user_name"/>
|
||||
<result property="infoList" column="info_list"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="resourceDTO" type="io.renren.modules.resource.dto.ResourceDTO">
|
||||
|
@ -103,7 +105,7 @@
|
|||
|
||||
<select id="selectWithAttrs" resultMap="resourceDTO">
|
||||
SELECT
|
||||
tdr.*,
|
||||
DISTINCT tdr.*,
|
||||
IFNULL(taa2.approve_status, '未申请') AS "applyState",
|
||||
IFNULL(trs.score, 0 ) AS "score",
|
||||
IFNULL(taa.applyCount, 0 ) AS "applyCount",
|
||||
|
@ -180,7 +182,7 @@
|
|||
WHERE 1 = 1
|
||||
AND del_flag = 0
|
||||
<if test="type != null and type != ''">
|
||||
AND type = #{type}
|
||||
AND type = #{type}
|
||||
</if>
|
||||
GROUP BY type
|
||||
ORDER BY type
|
||||
|
@ -215,34 +217,34 @@
|
|||
</select>
|
||||
|
||||
<select id="selectDTOById" resultMap="resourceDTO">
|
||||
<!-- SELECT-->
|
||||
<!-- tdr.*,-->
|
||||
<!--<!– tda.*,–>-->
|
||||
<!-- IFNULL(trs.score, 0 ) AS "score",-->
|
||||
<!-- IFNULL(taa.applyCount, 0 ) AS "applyCount",-->
|
||||
<!-- IFNULL(trc.collectCount, 0) AS "collectCount",-->
|
||||
<!-- sd.name as "deptName",-->
|
||||
<!-- IFNULL(trc2.isCollect, 'false') AS "isCollect",-->
|
||||
<!-- IFNULL(taa2.approve_status, '未申请') AS "applyState"-->
|
||||
<!-- FROM-->
|
||||
<!-- tb_data_resource tdr-->
|
||||
<!--<!– LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_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"-->
|
||||
<!-- FROM tb_resource_collection WHERE-->
|
||||
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
|
||||
<!-- GROUP BY resource_id) trc2 ON tdr.id = trc2.resource_id-->
|
||||
<!-- LEFT JOIN ( SELECT resource_id, approve_status FROM t_ability_application WHERE-->
|
||||
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
|
||||
<!-- GROUP BY id LIMIT 1) taa2 ON tdr.id = taa2.resource_id-->
|
||||
<!-- LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id-->
|
||||
<!-- WHERE 1 = 1-->
|
||||
<!-- AND tdr.id = #{id}-->
|
||||
<!-- SELECT-->
|
||||
<!-- tdr.*,-->
|
||||
<!--<!– tda.*,–>-->
|
||||
<!-- IFNULL(trs.score, 0 ) AS "score",-->
|
||||
<!-- IFNULL(taa.applyCount, 0 ) AS "applyCount",-->
|
||||
<!-- IFNULL(trc.collectCount, 0) AS "collectCount",-->
|
||||
<!-- sd.name as "deptName",-->
|
||||
<!-- IFNULL(trc2.isCollect, 'false') AS "isCollect",-->
|
||||
<!-- IFNULL(taa2.approve_status, '未申请') AS "applyState"-->
|
||||
<!-- FROM-->
|
||||
<!-- tb_data_resource tdr-->
|
||||
<!--<!– LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_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"-->
|
||||
<!-- FROM tb_resource_collection WHERE-->
|
||||
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
|
||||
<!-- GROUP BY resource_id) trc2 ON tdr.id = trc2.resource_id-->
|
||||
<!-- LEFT JOIN ( SELECT resource_id, approve_status FROM t_ability_application WHERE-->
|
||||
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
|
||||
<!-- GROUP BY id LIMIT 1) taa2 ON tdr.id = taa2.resource_id-->
|
||||
<!-- LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id-->
|
||||
<!-- WHERE 1 = 1-->
|
||||
<!-- AND tdr.id = #{id}-->
|
||||
|
||||
SELECT
|
||||
tdr.*,
|
||||
|
@ -567,7 +569,8 @@
|
|||
tdav.data_resource_id AS resourceId
|
||||
FROM
|
||||
tb_data_attr tdav
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
|
||||
';', '' ) ) + 1 )
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdav.attr_type = '应用领域'
|
||||
|
@ -594,230 +597,230 @@
|
|||
|
||||
<select id="selectMaxDeptIds" resultType="java.lang.Long">
|
||||
SELECT
|
||||
dept_id
|
||||
dept_id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT( id ) AS "count",
|
||||
dept_id
|
||||
FROM
|
||||
tb_data_resource
|
||||
WHERE
|
||||
1 = 1
|
||||
AND del_flag = 0
|
||||
AND dept_id IS NOT NULL
|
||||
GROUP BY
|
||||
dept_id
|
||||
) temp1
|
||||
(
|
||||
SELECT
|
||||
COUNT( id ) AS "count",
|
||||
dept_id
|
||||
FROM
|
||||
tb_data_resource
|
||||
WHERE
|
||||
temp1.count = (
|
||||
SELECT
|
||||
MAX( count ) AS "total"
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT( id ) AS "count"
|
||||
FROM
|
||||
tb_data_resource
|
||||
WHERE
|
||||
1 = 1
|
||||
AND del_flag = 0
|
||||
AND dept_id IS NOT NULL
|
||||
GROUP BY
|
||||
dept_id
|
||||
) temp2
|
||||
)
|
||||
1 = 1
|
||||
AND del_flag = 0
|
||||
AND dept_id IS NOT NULL
|
||||
GROUP BY
|
||||
dept_id
|
||||
) temp1
|
||||
WHERE
|
||||
temp1.count = (
|
||||
SELECT
|
||||
MAX( count ) AS "total"
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT( id ) AS "count"
|
||||
FROM
|
||||
tb_data_resource
|
||||
WHERE
|
||||
1 = 1
|
||||
AND del_flag = 0
|
||||
AND dept_id IS NOT NULL
|
||||
GROUP BY
|
||||
dept_id
|
||||
) temp2
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="selectByDeptId" resultType="java.util.Map">
|
||||
SELECT id,
|
||||
name
|
||||
name
|
||||
FROM tb_data_resource
|
||||
WHERE 1 = 1
|
||||
AND del_flag = 0
|
||||
AND dept_id = #{deptId}
|
||||
AND del_flag = 0
|
||||
AND dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
<select id="selectDeptCountList" resultType="java.util.Map">
|
||||
SELECT
|
||||
sd.id AS "deptId",
|
||||
sd.NAME AS "deptName",
|
||||
COUNT( tdr.id ) AS "total"
|
||||
sd.id AS "deptId",
|
||||
sd.NAME AS "deptName",
|
||||
COUNT( tdr.id ) AS "total"
|
||||
FROM
|
||||
tb_data_resource tdr,
|
||||
sys_dept sd
|
||||
tb_data_resource tdr,
|
||||
sys_dept sd
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.dept_id = sd.id
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.dept_id = sd.id
|
||||
GROUP BY tdr.dept_id
|
||||
ORDER BY total DESC
|
||||
</select>
|
||||
|
||||
<select id="selectMaxApplyDeptIds" resultType="java.lang.Long">
|
||||
SELECT
|
||||
dept_id
|
||||
dept_id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT( taa.id ) AS "count",
|
||||
su.dept_id
|
||||
FROM
|
||||
t_ability_application taa,
|
||||
sys_user su
|
||||
WHERE
|
||||
1 = 1
|
||||
AND taa.user_id = su.id
|
||||
AND taa.user_id IS NOT NULL
|
||||
GROUP BY
|
||||
su.dept_id
|
||||
) temp1
|
||||
(
|
||||
SELECT
|
||||
COUNT( taa.id ) AS "count",
|
||||
su.dept_id
|
||||
FROM
|
||||
t_ability_application taa,
|
||||
sys_user su
|
||||
WHERE
|
||||
temp1.count = (
|
||||
SELECT
|
||||
MAX( count ) AS "total"
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT( taa.id ) AS "count"
|
||||
FROM
|
||||
t_ability_application taa,
|
||||
sys_user su
|
||||
WHERE
|
||||
1 = 1
|
||||
AND taa.user_id = su.id
|
||||
AND taa.user_id IS NOT NULL
|
||||
GROUP BY
|
||||
su.dept_id
|
||||
) temp2
|
||||
)
|
||||
1 = 1
|
||||
AND taa.user_id = su.id
|
||||
AND taa.user_id IS NOT NULL
|
||||
GROUP BY
|
||||
su.dept_id
|
||||
) temp1
|
||||
WHERE
|
||||
temp1.count = (
|
||||
SELECT
|
||||
MAX( count ) AS "total"
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT( taa.id ) AS "count"
|
||||
FROM
|
||||
t_ability_application taa,
|
||||
sys_user su
|
||||
WHERE
|
||||
1 = 1
|
||||
AND taa.user_id = su.id
|
||||
AND taa.user_id IS NOT NULL
|
||||
GROUP BY
|
||||
su.dept_id
|
||||
) temp2
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="selectByApplyDeptId" resultType="java.util.Map">
|
||||
SELECT tdr.id,
|
||||
tdr.name
|
||||
tdr.name
|
||||
FROM t_ability_application taa, tb_data_resource tdr, sys_user su
|
||||
WHERE 1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND su.id = taa.user_id
|
||||
AND taa.resource_id = tdr.id
|
||||
AND su.dept_id = #{deptId}
|
||||
AND tdr.del_flag = 0
|
||||
AND su.id = taa.user_id
|
||||
AND taa.resource_id = tdr.id
|
||||
AND su.dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
<select id="selectApplyDeptCountList" resultType="java.util.Map">
|
||||
SELECT
|
||||
sd.id AS "deptId",
|
||||
sd.NAME AS "deptName",
|
||||
COUNT( taa.resource_id ) AS "total"
|
||||
sd.id AS "deptId",
|
||||
sd.NAME AS "deptName",
|
||||
COUNT( taa.resource_id ) AS "total"
|
||||
FROM
|
||||
t_ability_application taa,
|
||||
sys_user su,
|
||||
sys_dept sd
|
||||
t_ability_application taa,
|
||||
sys_user su,
|
||||
sys_dept sd
|
||||
WHERE
|
||||
1 = 1
|
||||
AND su.id = taa.user_id
|
||||
AND su.dept_id = sd.id
|
||||
1 = 1
|
||||
AND su.id = taa.user_id
|
||||
AND su.dept_id = sd.id
|
||||
GROUP BY
|
||||
sd.id
|
||||
sd.id
|
||||
ORDER BY
|
||||
total DESC
|
||||
total DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDeptTypeCountList" resultType="java.util.Map">
|
||||
SELECT
|
||||
COUNT( tdr.id ) AS "count",
|
||||
sd.NAME AS "deptName",
|
||||
(CASE tdr.type
|
||||
WHEN '应用资源' THEN 'yyzy'
|
||||
WHEN '组件服务' THEN 'zjfw'
|
||||
WHEN '基础设施' THEN 'jcss'
|
||||
WHEN '知识库' THEN 'zsk'
|
||||
WHEN '数据资源' THEN 'sjzy'
|
||||
ELSE 'yyzy' END)AS "type"
|
||||
COUNT( tdr.id ) AS "count",
|
||||
sd.NAME AS "deptName",
|
||||
(CASE tdr.type
|
||||
WHEN '应用资源' THEN 'yyzy'
|
||||
WHEN '组件服务' THEN 'zjfw'
|
||||
WHEN '基础设施' THEN 'jcss'
|
||||
WHEN '知识库' THEN 'zsk'
|
||||
WHEN '数据资源' THEN 'sjzy'
|
||||
ELSE 'yyzy' END)AS "type"
|
||||
FROM
|
||||
tb_data_resource tdr,
|
||||
sys_dept sd
|
||||
tb_data_resource tdr,
|
||||
sys_dept sd
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.dept_id = sd.id
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.dept_id = sd.id
|
||||
GROUP BY
|
||||
tdr.dept_id,
|
||||
tdr.type
|
||||
tdr.dept_id,
|
||||
tdr.type
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectApplyDeptTypeCountList" resultType="java.util.Map">
|
||||
SELECT
|
||||
COUNT( taa.resource_id ) AS "count",
|
||||
sd.NAME AS "deptName",
|
||||
(
|
||||
CASE
|
||||
tdr.type
|
||||
WHEN '应用资源' THEN
|
||||
'yyzy'
|
||||
WHEN '组件服务' THEN
|
||||
'zjfw'
|
||||
WHEN '基础设施' THEN
|
||||
'jcss'
|
||||
WHEN '知识库' THEN
|
||||
'zsk'
|
||||
WHEN '数据资源' THEN
|
||||
'sjzy' ELSE 'yyzy'
|
||||
END
|
||||
) AS "type"
|
||||
COUNT( taa.resource_id ) AS "count",
|
||||
sd.NAME AS "deptName",
|
||||
(
|
||||
CASE
|
||||
tdr.type
|
||||
WHEN '应用资源' THEN
|
||||
'yyzy'
|
||||
WHEN '组件服务' THEN
|
||||
'zjfw'
|
||||
WHEN '基础设施' THEN
|
||||
'jcss'
|
||||
WHEN '知识库' THEN
|
||||
'zsk'
|
||||
WHEN '数据资源' THEN
|
||||
'sjzy' ELSE 'yyzy'
|
||||
END
|
||||
) AS "type"
|
||||
FROM
|
||||
tb_data_resource tdr,
|
||||
sys_dept sd,
|
||||
sys_user su,
|
||||
t_ability_application taa
|
||||
tb_data_resource tdr,
|
||||
sys_dept sd,
|
||||
sys_user su,
|
||||
t_ability_application taa
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND taa.user_id = su.id
|
||||
AND su.dept_id = sd.id
|
||||
AND taa.resource_id = tdr.id
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND taa.user_id = su.id
|
||||
AND su.dept_id = sd.id
|
||||
AND taa.resource_id = tdr.id
|
||||
GROUP BY
|
||||
sd.id,
|
||||
tdr.type
|
||||
sd.id,
|
||||
tdr.type
|
||||
</select>
|
||||
|
||||
<select id="selectMaxType" resultType="java.lang.String">
|
||||
SELECT
|
||||
type
|
||||
type
|
||||
FROM
|
||||
( SELECT COUNT( id ) AS "count", type FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY type ) temp1
|
||||
( SELECT COUNT( id ) AS "count", type FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY type ) temp1
|
||||
WHERE
|
||||
temp1.count = (
|
||||
SELECT
|
||||
MAX( count ) AS "total"
|
||||
FROM
|
||||
( SELECT COUNT( id ) AS "count" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY type ) temp2
|
||||
)
|
||||
temp1.count = (
|
||||
SELECT
|
||||
MAX( count ) AS "total"
|
||||
FROM
|
||||
( SELECT COUNT( id ) AS "count" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 GROUP BY type ) temp2
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="selectByType" resultType="java.util.Map">
|
||||
SELECT id,
|
||||
name
|
||||
name
|
||||
FROM tb_data_resource
|
||||
WHERE 1 = 1
|
||||
AND del_flag = 0
|
||||
AND type = #{type}
|
||||
AND del_flag = 0
|
||||
AND type = #{type}
|
||||
</select>
|
||||
|
||||
<select id="selectTypeCountList" resultType="java.util.Map">
|
||||
SELECT
|
||||
tdr.type,
|
||||
COUNT( tdr.id ) AS "total"
|
||||
tdr.type,
|
||||
COUNT( tdr.id ) AS "total"
|
||||
FROM
|
||||
tb_data_resource tdr
|
||||
tb_data_resource tdr
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
GROUP BY
|
||||
tdr.type
|
||||
tdr.type
|
||||
ORDER BY
|
||||
total DESC
|
||||
total DESC
|
||||
</select>
|
||||
|
||||
<select id="selectMaxAppArea" resultType="java.lang.String">
|
||||
|
@ -830,7 +833,8 @@
|
|||
COUNT( tdav.data_resource_id ) AS "count"
|
||||
FROM
|
||||
tb_data_attr tdav
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
|
||||
';', '' ) ) + 1 )
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdav.attr_type = '应用领域'
|
||||
|
@ -850,7 +854,8 @@
|
|||
COUNT( tdav.data_resource_id ) AS "count"
|
||||
FROM
|
||||
tb_data_attr tdav
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
|
||||
';', '' ) ) + 1 )
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdav.attr_type = '应用领域'
|
||||
|
@ -864,17 +869,17 @@
|
|||
|
||||
<select id="selectByAppArea" resultType="java.util.Map">
|
||||
SELECT
|
||||
tdr.id,
|
||||
tdr.name
|
||||
tdr.id,
|
||||
tdr.name
|
||||
FROM
|
||||
tb_data_resource tdr,
|
||||
tb_data_attr tda
|
||||
tb_data_resource tdr,
|
||||
tb_data_attr tda
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tda.del_flag = 0
|
||||
AND tdr.id = tda.data_resource_id
|
||||
AND attr_value LIKE CONCAT('%', #{type}, '%')
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tda.del_flag = 0
|
||||
AND tdr.id = tda.data_resource_id
|
||||
AND attr_value LIKE CONCAT('%', #{type}, '%')
|
||||
</select>
|
||||
|
||||
<select id="selectAppAreaCountList" resultType="java.util.Map">
|
||||
|
@ -883,7 +888,8 @@
|
|||
COUNT( tdav.data_resource_id ) AS "total"
|
||||
FROM
|
||||
tb_data_attr tdav
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
|
||||
';', '' ) ) + 1 )
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdav.attr_type = '应用领域'
|
||||
|
@ -895,40 +901,40 @@
|
|||
|
||||
<select id="selectTopFiveComponentServiceApplications" resultType="java.util.Map">
|
||||
SELECT
|
||||
tdr.id AS "resourceId",
|
||||
tdr.NAME AS "name",
|
||||
IFNULL(COUNT( taa.id ), 0) AS "count"
|
||||
tdr.id AS "resourceId",
|
||||
tdr.NAME AS "name",
|
||||
IFNULL(COUNT( taa.id ), 0) AS "count"
|
||||
FROM
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN t_ability_application taa ON tdr.id = taa.resource_id AND taa.del_flag = 0
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN t_ability_application taa ON tdr.id = taa.resource_id AND taa.del_flag = 0
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.type = '组件服务'
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.type = '组件服务'
|
||||
GROUP BY
|
||||
tdr.id
|
||||
tdr.id
|
||||
ORDER BY
|
||||
count DESC
|
||||
count DESC
|
||||
LIMIT 5
|
||||
</select>
|
||||
|
||||
<select id="selectTopFiveComponentServiceScore" resultType="java.util.Map">
|
||||
SELECT
|
||||
tdr.id AS "resourceId",
|
||||
tdr.NAME AS "name",
|
||||
IFNULL( SUM( trs.score ), 0 ) AS "score"
|
||||
tdr.id AS "resourceId",
|
||||
tdr.NAME AS "name",
|
||||
IFNULL( SUM( trs.score ), 0 ) AS "score"
|
||||
FROM
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN tb_resource_score trs ON tdr.id = trs.resource_id
|
||||
AND trs.del_flag = 0
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN tb_resource_score trs ON tdr.id = trs.resource_id
|
||||
AND trs.del_flag = 0
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.type = '组件服务'
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND tdr.type = '组件服务'
|
||||
GROUP BY
|
||||
tdr.id
|
||||
tdr.id
|
||||
ORDER BY
|
||||
score DESC
|
||||
score DESC
|
||||
LIMIT 5
|
||||
</select>
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue