Compare commits

...

12 Commits

Author SHA1 Message Date
wangliwen d1b6ae5e14 ... 2022-06-20 16:45:20 +08:00
dinggang db03b24e76 新增西海岸和包头配置文件 2022-06-20 16:24:14 +08:00
wangliwen 9598af3564 模板的暂时调整 2022-06-20 16:03:23 +08:00
wangliwen 45c5bf7489 调整一下sql 2022-06-20 14:35:41 +08:00
liyongbo2 47e19db5de Merge remote-tracking branch 'origin/master' 2022-06-20 14:30:12 +08:00
liyongbo2 413f62c395 版本重复,修改名称 2022-06-20 14:28:10 +08:00
wangliwen 0aac656f83 Merge remote-tracking branch 'origin/master' 2022-06-20 14:27:25 +08:00
wangliwen b165e91663 系统操作日志使用异步插入,解决平台所有日志阻塞问题!! 屮 2022-06-20 14:25:07 +08:00
liyongbo2 e6b17da32a 修改工作动态备用字段1注释,改为摘要 2022-06-20 11:44:02 +08:00
wangliwen e1edb302f5 能力资源导入模板的添加 2022-06-20 10:47:59 +08:00
wangliwen 0063546e5e ResourceEntity 增加infoList json字段 2022-06-20 10:23:37 +08:00
wangliwen 5b66808e7c 替换使用 CopyOnWriteArrayList 2022-06-20 09:18:52 +08:00
16 changed files with 366 additions and 233 deletions

View File

@ -0,0 +1 @@
ALTER TABLE `share_platform`.`tb_data_resource` ADD COLUMN `info_list` json NULL COMMENT '属性信息';

View File

@ -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 '摘要';

View File

@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -55,7 +56,7 @@ public class CensusControllerV2 {
@GetMapping(value = "/whole_amount") @GetMapping(value = "/whole_amount")
@ApiOperation("平台概览") @ApiOperation("平台概览")
public Result<List<Map<String, Object>>> wholeAmount() { 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(() -> { // 获取平台用户总数 CompletableFuture<Void> userAmount = CompletableFuture.supplyAsync(() -> { // 获取平台用户总数
return sysUserService.countAllUser(); return sysUserService.countAllUser();
@ -102,7 +103,7 @@ public class CensusControllerV2 {
@ApiOperation("应用资源数量统计") @ApiOperation("应用资源数量统计")
@LogOperation("应用资源数量统计") @LogOperation("应用资源数量统计")
public Result<List<Map<String, Object>>> applicationNum() { 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(() -> { // 获取平台总应用数目 CompletableFuture<Void> allApplicationAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总应用数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='应用资源';", Long.class); 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) { 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, Object>> district = jdbcTemplate.queryForList("SELECT * FROM sys_dept WHERE type = " + type);
List<Map<String, Long>> listMap = List<Map<String, Long>> listMap =
district.stream().map(index -> { district.stream().map(index -> {
@ -203,7 +204,7 @@ public class CensusControllerV2 {
@ApiOperation("组件服务简况") @ApiOperation("组件服务简况")
@LogOperation("组件服务简况") @LogOperation("组件服务简况")
public Result<List<Map<String, Object>>> assemblerInfo() { 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(() -> { // 获取平台总组件服务数目 CompletableFuture<Void> allAssemblyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总组件服务数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='组件服务' AND del_flag = 0;", Long.class); return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='组件服务' AND del_flag = 0;", Long.class);
}).thenAccept(sum -> { }).thenAccept(sum -> {
@ -263,7 +264,7 @@ public class CensusControllerV2 {
@ApiOperation("知识库简况") @ApiOperation("知识库简况")
@LogOperation("知识库简况") @LogOperation("知识库简况")
public Result<List<Map<String, Object>>> knowledgeInfo() { 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(() -> { // 获取平台总知识库数目 CompletableFuture<Void> allKnowledgeAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总知识库数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class); return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class);
}).thenAccept(sum -> { }).thenAccept(sum -> {

View File

@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.CompletableFuture;
/** /**
* 操作日志 * 操作日志
@ -28,8 +29,8 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationD
@Override @Override
public PageData<SysLogOperationDTO> page(Map<String, Object> params) { public PageData<SysLogOperationDTO> page(Map<String, Object> params) {
IPage<SysLogOperationEntity> page = baseDao.selectPage( IPage<SysLogOperationEntity> page = baseDao.selectPage(
getPage(params, Constant.CREATE_DATE, false), getPage(params, Constant.CREATE_DATE, false),
getWrapper(params) getWrapper(params)
); );
return getPageData(page, SysLogOperationDTO.class); return getPageData(page, SysLogOperationDTO.class);
@ -42,7 +43,7 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationD
return ConvertUtils.sourceToTarget(entityList, SysLogOperationDTO.class); 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"); String status = (String) params.get("status");
QueryWrapper<SysLogOperationEntity> wrapper = new QueryWrapper<>(); QueryWrapper<SysLogOperationEntity> wrapper = new QueryWrapper<>();
@ -54,7 +55,9 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationD
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(SysLogOperationEntity entity) { public void save(SysLogOperationEntity entity) {
insert(entity); CompletableFuture.runAsync(() -> {
insert(entity);
});
} }
} }

View File

@ -210,7 +210,7 @@ public class ResourceController {
@ApiOperation("导入") @ApiOperation("导入")
@LogOperation("导入") @LogOperation("导入")
@ApiImplicitParams({ @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) { public Result importResource(@RequestParam("file") MultipartFile uploadFile, HttpServletRequest request) {
List<Map<String, Object>> dept = List<Map<String, Object>> dept =

View File

@ -1,11 +1,15 @@
package io.renren.modules.resource.entity; 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 io.renren.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 资源表 * 资源表
@ -130,4 +134,7 @@ public class ResourceEntity extends BaseEntity {
* 提起下架人员 * 提起下架人员
*/ */
private String undercarriageUserName; private String undercarriageUserName;
@TableField(value = "info_list", typeHandler = FastjsonTypeHandler.class)
private List<AttrEntity> infoList;
} }

View File

@ -36,7 +36,7 @@ public class WorkDynamicsDTO implements Serializable {
private Long updater; private Long updater;
@ApiModelProperty(value = "修改时间") @ApiModelProperty(value = "修改时间")
private Date updateDate; private Date updateDate;
@ApiModelProperty(value = "备用字段1") @ApiModelProperty(value = "摘要")
private String note1; private String note1;
@ApiModelProperty(value = "备用字段2") @ApiModelProperty(value = "备用字段2")
private String note2; private String note2;

View File

@ -59,7 +59,7 @@ public class WorkDynamicsEntity {
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateDate; private Date updateDate;
/** /**
* 备用字段1 * 摘要
*/ */
private String note1; private String note1;
/** /**

View File

@ -36,7 +36,7 @@ public class WorkDynamicsExcel {
private Long updater; private Long updater;
@ExcelProperty(value = "修改时间", index = 8) @ExcelProperty(value = "修改时间", index = 8)
private Date updateDate; private Date updateDate;
@ExcelProperty(value = "备用字段1", index = 9) @ExcelProperty(value = "摘要", index = 9)
private String note1; private String note1;
@ExcelProperty(value = "备用字段2", index = 10) @ExcelProperty(value = "备用字段2", index = 10)
private String note2; private String note2;

View File

@ -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

View File

@ -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

View File

@ -93,7 +93,7 @@ system:
yawei: yawei:
enable: true enable: true
#知识库 #对接知识库相关配置
zsk: zsk:
url: url:
sign: https://cms.qingdao.gov.cn:9020/api-gateway/jpaas-jags-server/interface/createsign.do sign: https://cms.qingdao.gov.cn:9020/api-gateway/jpaas-jags-server/interface/createsign.do

View File

@ -0,0 +1 @@
ALTER TABLE `share_platform`.`tb_data_resource` ADD COLUMN `info_list` json NULL COMMENT '属性信息';

View File

@ -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 '摘要';

View File

@ -33,6 +33,8 @@
<result property="enclosure" column="enclosure"/> <result property="enclosure" column="enclosure"/>
<result property="undercarriageReason" column="undercarriage_reason"/> <result property="undercarriageReason" column="undercarriage_reason"/>
<result property="undercarriageUserName" column="undercarriage_user_name"/> <result property="undercarriageUserName" column="undercarriage_user_name"/>
<result property="infoList" column="info_list"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
</resultMap> </resultMap>
<resultMap id="resourceDTO" type="io.renren.modules.resource.dto.ResourceDTO"> <resultMap id="resourceDTO" type="io.renren.modules.resource.dto.ResourceDTO">
@ -89,7 +91,7 @@
<result property="note5" column="note5"/> <result property="note5" column="note5"/>
</collection> </collection>
</resultMap> </resultMap>
<update id="deleteByIds"> <update id="deleteByIds">
UPDATE tb_data_resource UPDATE tb_data_resource
SET del_flag = 1, SET del_flag = 1,
@ -103,7 +105,7 @@
<select id="selectWithAttrs" resultMap="resourceDTO"> <select id="selectWithAttrs" resultMap="resourceDTO">
SELECT SELECT
tdr.*, DISTINCT tdr.*,
IFNULL(taa2.approve_status, '未申请') AS "applyState", IFNULL(taa2.approve_status, '未申请') AS "applyState",
IFNULL(trs.score, 0 ) AS "score", IFNULL(trs.score, 0 ) AS "score",
IFNULL(taa.applyCount, 0 ) AS "applyCount", IFNULL(taa.applyCount, 0 ) AS "applyCount",
@ -180,7 +182,7 @@
WHERE 1 = 1 WHERE 1 = 1
AND del_flag = 0 AND del_flag = 0
<if test="type != null and type != ''"> <if test="type != null and type != ''">
AND type = #{type} AND type = #{type}
</if> </if>
GROUP BY type GROUP BY type
ORDER BY type ORDER BY type
@ -215,34 +217,34 @@
</select> </select>
<select id="selectDTOById" resultMap="resourceDTO"> <select id="selectDTOById" resultMap="resourceDTO">
<!-- SELECT--> <!-- SELECT-->
<!-- tdr.*,--> <!-- tdr.*,-->
<!--&lt;!&ndash; tda.*,&ndash;&gt;--> <!--&lt;!&ndash; tda.*,&ndash;&gt;-->
<!-- IFNULL(trs.score, 0 ) AS "score",--> <!-- IFNULL(trs.score, 0 ) AS "score",-->
<!-- IFNULL(taa.applyCount, 0 ) AS "applyCount",--> <!-- IFNULL(taa.applyCount, 0 ) AS "applyCount",-->
<!-- IFNULL(trc.collectCount, 0) AS "collectCount",--> <!-- IFNULL(trc.collectCount, 0) AS "collectCount",-->
<!-- sd.name as "deptName",--> <!-- sd.name as "deptName",-->
<!-- IFNULL(trc2.isCollect, 'false') AS "isCollect",--> <!-- IFNULL(trc2.isCollect, 'false') AS "isCollect",-->
<!-- IFNULL(taa2.approve_status, '未申请') AS "applyState"--> <!-- IFNULL(taa2.approve_status, '未申请') AS "applyState"-->
<!-- FROM--> <!-- FROM-->
<!-- tb_data_resource tdr--> <!-- tb_data_resource tdr-->
<!--&lt;!&ndash; LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_resource_id&ndash;&gt;--> <!--&lt;!&ndash; LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_resource_id&ndash;&gt;-->
<!-- LEFT JOIN ( SELECT resource_id, AVG(score) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0 GROUP--> <!-- 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--> <!-- 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 =--> <!-- 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--> <!-- 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--> <!-- 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--> <!-- = 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, ( CASE COUNT( id ) WHEN 1 THEN 'true' ELSE 'false' END ) AS "isCollect"-->
<!-- FROM tb_resource_collection WHERE--> <!-- FROM tb_resource_collection WHERE-->
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}--> <!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
<!-- GROUP BY resource_id) trc2 ON tdr.id = trc2.resource_id--> <!-- GROUP BY resource_id) trc2 ON tdr.id = trc2.resource_id-->
<!-- LEFT JOIN ( SELECT resource_id, approve_status FROM t_ability_application WHERE--> <!-- LEFT JOIN ( SELECT resource_id, approve_status FROM t_ability_application WHERE-->
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}--> <!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
<!-- GROUP BY id LIMIT 1) taa2 ON tdr.id = taa2.resource_id--> <!-- GROUP BY id LIMIT 1) taa2 ON tdr.id = taa2.resource_id-->
<!-- LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id--> <!-- LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id-->
<!-- WHERE 1 = 1--> <!-- WHERE 1 = 1-->
<!-- AND tdr.id = #{id}--> <!-- AND tdr.id = #{id}-->
SELECT SELECT
tdr.*, tdr.*,
@ -567,7 +569,8 @@
tdav.data_resource_id AS resourceId tdav.data_resource_id AS resourceId
FROM FROM
tb_data_attr tdav tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 ) JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
';', '' ) ) + 1 )
WHERE WHERE
1 = 1 1 = 1
AND tdav.attr_type = '应用领域' AND tdav.attr_type = '应用领域'
@ -594,230 +597,230 @@
<select id="selectMaxDeptIds" resultType="java.lang.Long"> <select id="selectMaxDeptIds" resultType="java.lang.Long">
SELECT SELECT
dept_id dept_id
FROM FROM
( (
SELECT SELECT
COUNT( id ) AS "count", COUNT( id ) AS "count",
dept_id dept_id
FROM FROM
tb_data_resource tb_data_resource
WHERE
1 = 1
AND del_flag = 0
AND dept_id IS NOT NULL
GROUP BY
dept_id
) temp1
WHERE WHERE
temp1.count = ( 1 = 1
SELECT AND del_flag = 0
MAX( count ) AS "total" AND dept_id IS NOT NULL
FROM GROUP BY
( dept_id
SELECT ) temp1
COUNT( id ) AS "count" WHERE
FROM temp1.count = (
tb_data_resource SELECT
WHERE MAX( count ) AS "total"
1 = 1 FROM
AND del_flag = 0 (
AND dept_id IS NOT NULL SELECT
GROUP BY COUNT( id ) AS "count"
dept_id FROM
) temp2 tb_data_resource
) WHERE
1 = 1
AND del_flag = 0
AND dept_id IS NOT NULL
GROUP BY
dept_id
) temp2
)
</select> </select>
<select id="selectByDeptId" resultType="java.util.Map"> <select id="selectByDeptId" resultType="java.util.Map">
SELECT id, SELECT id,
name name
FROM tb_data_resource FROM tb_data_resource
WHERE 1 = 1 WHERE 1 = 1
AND del_flag = 0 AND del_flag = 0
AND dept_id = #{deptId} AND dept_id = #{deptId}
</select> </select>
<select id="selectDeptCountList" resultType="java.util.Map"> <select id="selectDeptCountList" resultType="java.util.Map">
SELECT SELECT
sd.id AS "deptId", sd.id AS "deptId",
sd.NAME AS "deptName", sd.NAME AS "deptName",
COUNT( tdr.id ) AS "total" COUNT( tdr.id ) AS "total"
FROM FROM
tb_data_resource tdr, tb_data_resource tdr,
sys_dept sd sys_dept sd
WHERE WHERE
1 = 1 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
AND tdr.dept_id = sd.id AND tdr.dept_id = sd.id
GROUP BY tdr.dept_id GROUP BY tdr.dept_id
ORDER BY total DESC ORDER BY total DESC
</select> </select>
<select id="selectMaxApplyDeptIds" resultType="java.lang.Long"> <select id="selectMaxApplyDeptIds" resultType="java.lang.Long">
SELECT SELECT
dept_id dept_id
FROM FROM
( (
SELECT SELECT
COUNT( taa.id ) AS "count", COUNT( taa.id ) AS "count",
su.dept_id su.dept_id
FROM FROM
t_ability_application taa, t_ability_application taa,
sys_user su 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
WHERE WHERE
temp1.count = ( 1 = 1
SELECT AND taa.user_id = su.id
MAX( count ) AS "total" AND taa.user_id IS NOT NULL
FROM GROUP BY
( su.dept_id
SELECT ) temp1
COUNT( taa.id ) AS "count" WHERE
FROM temp1.count = (
t_ability_application taa, SELECT
sys_user su MAX( count ) AS "total"
WHERE FROM
1 = 1 (
AND taa.user_id = su.id SELECT
AND taa.user_id IS NOT NULL COUNT( taa.id ) AS "count"
GROUP BY FROM
su.dept_id t_ability_application taa,
) temp2 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>
<select id="selectByApplyDeptId" resultType="java.util.Map"> <select id="selectByApplyDeptId" resultType="java.util.Map">
SELECT tdr.id, SELECT tdr.id,
tdr.name tdr.name
FROM t_ability_application taa, tb_data_resource tdr, sys_user su FROM t_ability_application taa, tb_data_resource tdr, sys_user su
WHERE 1 = 1 WHERE 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
AND su.id = taa.user_id AND su.id = taa.user_id
AND taa.resource_id = tdr.id AND taa.resource_id = tdr.id
AND su.dept_id = #{deptId} AND su.dept_id = #{deptId}
</select> </select>
<select id="selectApplyDeptCountList" resultType="java.util.Map"> <select id="selectApplyDeptCountList" resultType="java.util.Map">
SELECT SELECT
sd.id AS "deptId", sd.id AS "deptId",
sd.NAME AS "deptName", sd.NAME AS "deptName",
COUNT( taa.resource_id ) AS "total" COUNT( taa.resource_id ) AS "total"
FROM FROM
t_ability_application taa, t_ability_application taa,
sys_user su, sys_user su,
sys_dept sd sys_dept sd
WHERE WHERE
1 = 1 1 = 1
AND su.id = taa.user_id AND su.id = taa.user_id
AND su.dept_id = sd.id AND su.dept_id = sd.id
GROUP BY GROUP BY
sd.id sd.id
ORDER BY ORDER BY
total DESC total DESC
</select> </select>
<select id="selectDeptTypeCountList" resultType="java.util.Map"> <select id="selectDeptTypeCountList" resultType="java.util.Map">
SELECT SELECT
COUNT( tdr.id ) AS "count", COUNT( tdr.id ) AS "count",
sd.NAME AS "deptName", sd.NAME AS "deptName",
(CASE tdr.type (CASE tdr.type
WHEN '应用资源' THEN 'yyzy' WHEN '应用资源' THEN 'yyzy'
WHEN '组件服务' THEN 'zjfw' WHEN '组件服务' THEN 'zjfw'
WHEN '基础设施' THEN 'jcss' WHEN '基础设施' THEN 'jcss'
WHEN '知识库' THEN 'zsk' WHEN '知识库' THEN 'zsk'
WHEN '数据资源' THEN 'sjzy' WHEN '数据资源' THEN 'sjzy'
ELSE 'yyzy' END)AS "type" ELSE 'yyzy' END)AS "type"
FROM FROM
tb_data_resource tdr, tb_data_resource tdr,
sys_dept sd sys_dept sd
WHERE WHERE
1 = 1 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
AND tdr.dept_id = sd.id AND tdr.dept_id = sd.id
GROUP BY GROUP BY
tdr.dept_id, tdr.dept_id,
tdr.type tdr.type
</select> </select>
<select id="selectApplyDeptTypeCountList" resultType="java.util.Map"> <select id="selectApplyDeptTypeCountList" resultType="java.util.Map">
SELECT SELECT
COUNT( taa.resource_id ) AS "count", COUNT( taa.resource_id ) AS "count",
sd.NAME AS "deptName", sd.NAME AS "deptName",
( (
CASE CASE
tdr.type tdr.type
WHEN '应用资源' THEN WHEN '应用资源' THEN
'yyzy' 'yyzy'
WHEN '组件服务' THEN WHEN '组件服务' THEN
'zjfw' 'zjfw'
WHEN '基础设施' THEN WHEN '基础设施' THEN
'jcss' 'jcss'
WHEN '知识库' THEN WHEN '知识库' THEN
'zsk' 'zsk'
WHEN '数据资源' THEN WHEN '数据资源' THEN
'sjzy' ELSE 'yyzy' 'sjzy' ELSE 'yyzy'
END END
) AS "type" ) AS "type"
FROM FROM
tb_data_resource tdr, tb_data_resource tdr,
sys_dept sd, sys_dept sd,
sys_user su, sys_user su,
t_ability_application taa t_ability_application taa
WHERE WHERE
1 = 1 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
AND taa.user_id = su.id AND taa.user_id = su.id
AND su.dept_id = sd.id AND su.dept_id = sd.id
AND taa.resource_id = tdr.id AND taa.resource_id = tdr.id
GROUP BY GROUP BY
sd.id, sd.id,
tdr.type tdr.type
</select> </select>
<select id="selectMaxType" resultType="java.lang.String"> <select id="selectMaxType" resultType="java.lang.String">
SELECT SELECT
type type
FROM 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 WHERE
temp1.count = ( temp1.count = (
SELECT SELECT
MAX( count ) AS "total" MAX( count ) AS "total"
FROM FROM
( SELECT COUNT( id ) AS "count" 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> </select>
<select id="selectByType" resultType="java.util.Map"> <select id="selectByType" resultType="java.util.Map">
SELECT id, SELECT id,
name name
FROM tb_data_resource FROM tb_data_resource
WHERE 1 = 1 WHERE 1 = 1
AND del_flag = 0 AND del_flag = 0
AND type = #{type} AND type = #{type}
</select> </select>
<select id="selectTypeCountList" resultType="java.util.Map"> <select id="selectTypeCountList" resultType="java.util.Map">
SELECT SELECT
tdr.type, tdr.type,
COUNT( tdr.id ) AS "total" COUNT( tdr.id ) AS "total"
FROM FROM
tb_data_resource tdr tb_data_resource tdr
WHERE WHERE
1 = 1 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
GROUP BY GROUP BY
tdr.type tdr.type
ORDER BY ORDER BY
total DESC total DESC
</select> </select>
<select id="selectMaxAppArea" resultType="java.lang.String"> <select id="selectMaxAppArea" resultType="java.lang.String">
@ -830,7 +833,8 @@
COUNT( tdav.data_resource_id ) AS "count" COUNT( tdav.data_resource_id ) AS "count"
FROM FROM
tb_data_attr tdav tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 ) JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
';', '' ) ) + 1 )
WHERE WHERE
1 = 1 1 = 1
AND tdav.attr_type = '应用领域' AND tdav.attr_type = '应用领域'
@ -850,7 +854,8 @@
COUNT( tdav.data_resource_id ) AS "count" COUNT( tdav.data_resource_id ) AS "count"
FROM FROM
tb_data_attr tdav tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 ) JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
';', '' ) ) + 1 )
WHERE WHERE
1 = 1 1 = 1
AND tdav.attr_type = '应用领域' AND tdav.attr_type = '应用领域'
@ -864,17 +869,17 @@
<select id="selectByAppArea" resultType="java.util.Map"> <select id="selectByAppArea" resultType="java.util.Map">
SELECT SELECT
tdr.id, tdr.id,
tdr.name tdr.name
FROM FROM
tb_data_resource tdr, tb_data_resource tdr,
tb_data_attr tda tb_data_attr tda
WHERE WHERE
1 = 1 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
AND tda.del_flag = 0 AND tda.del_flag = 0
AND tdr.id = tda.data_resource_id AND tdr.id = tda.data_resource_id
AND attr_value LIKE CONCAT('%', #{type}, '%') AND attr_value LIKE CONCAT('%', #{type}, '%')
</select> </select>
<select id="selectAppAreaCountList" resultType="java.util.Map"> <select id="selectAppAreaCountList" resultType="java.util.Map">
@ -883,7 +888,8 @@
COUNT( tdav.data_resource_id ) AS "total" COUNT( tdav.data_resource_id ) AS "total"
FROM FROM
tb_data_attr tdav tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 ) JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
';', '' ) ) + 1 )
WHERE WHERE
1 = 1 1 = 1
AND tdav.attr_type = '应用领域' AND tdav.attr_type = '应用领域'
@ -895,40 +901,40 @@
<select id="selectTopFiveComponentServiceApplications" resultType="java.util.Map"> <select id="selectTopFiveComponentServiceApplications" resultType="java.util.Map">
SELECT SELECT
tdr.id AS "resourceId", tdr.id AS "resourceId",
tdr.NAME AS "name", tdr.NAME AS "name",
IFNULL(COUNT( taa.id ), 0) AS "count" IFNULL(COUNT( taa.id ), 0) AS "count"
FROM FROM
tb_data_resource tdr tb_data_resource tdr
LEFT JOIN t_ability_application taa ON tdr.id = taa.resource_id AND taa.del_flag = 0 LEFT JOIN t_ability_application taa ON tdr.id = taa.resource_id AND taa.del_flag = 0
WHERE WHERE
1 = 1 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
AND tdr.type = '组件服务' AND tdr.type = '组件服务'
GROUP BY GROUP BY
tdr.id tdr.id
ORDER BY ORDER BY
count DESC count DESC
LIMIT 5 LIMIT 5
</select> </select>
<select id="selectTopFiveComponentServiceScore" resultType="java.util.Map"> <select id="selectTopFiveComponentServiceScore" resultType="java.util.Map">
SELECT SELECT
tdr.id AS "resourceId", tdr.id AS "resourceId",
tdr.NAME AS "name", tdr.NAME AS "name",
IFNULL( SUM( trs.score ), 0 ) AS "score" IFNULL( SUM( trs.score ), 0 ) AS "score"
FROM FROM
tb_data_resource tdr tb_data_resource tdr
LEFT JOIN tb_resource_score trs ON tdr.id = trs.resource_id LEFT JOIN tb_resource_score trs ON tdr.id = trs.resource_id
AND trs.del_flag = 0 AND trs.del_flag = 0
WHERE WHERE
1 = 1 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
AND tdr.type = '组件服务' AND tdr.type = '组件服务'
GROUP BY GROUP BY
tdr.id tdr.id
ORDER BY ORDER BY
score DESC score DESC
LIMIT 5 LIMIT 5
</select> </select>