Integernum=jdbcTemplate.queryForObject("SELECT round(tb_data_resource_assignmark.total) FROM tb_data_resource_assignmark WHERE id ="+id,Integer.class);
@ -782,21 +760,20 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName,\n"+
"SUM(a.visits) AS resourceVisits \n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '组件服务' AND a.del_flag = 0\n"+
"GROUP BY a.dept_id,b.name\n"+
"ORDER BY a.dept_id,b.name\n");
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName,\n"+"SUM(a.visits) AS resourceVisits \n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '组件服务' AND a.del_flag = 0\n"+"GROUP BY a.dept_id,b.name\n"+"ORDER BY a.dept_id,b.name\n");
}else{
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName,\n"+
"SUM(a.visits) AS resourceVisits \n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '组件服务' AND a.del_flag = 0\n"+
"AND (b.ID = ? OR INSTR(b.pids,?))\n"+
"GROUP BY a.dept_id,b.name\n"+
"ORDER BY a.dept_id,b.name\n",pas);
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName,\n"+"SUM(a.visits) AS resourceVisits \n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '组件服务' AND a.del_flag = 0\n"+"AND (b.ID = ? OR INSTR(b.pids,?))\n"+"GROUP BY a.dept_id,b.name\n"+"ORDER BY a.dept_id,b.name\n",pas);
}
if(!result2.isEmpty()){
@ -1386,18 +1346,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '应用资源' AND a.del_flag = 0\n"+
"GROUP BY a.dept_id,b.name\n"+
"ORDER BY a.dept_id,b.name\n");
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '应用资源' AND a.del_flag = 0\n"+"GROUP BY a.dept_id,b.name\n"+"ORDER BY a.dept_id,b.name\n");
}else{
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '应用资源' AND a.del_flag = 0\n"+
"AND (b.ID = ? OR b.pids LIKE CONCAT(CONCAT('%',?),'%'))\n"+
"GROUP BY a.dept_id,b.name\n"+
"ORDER BY a.dept_id,b.name\n",pas);
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '应用资源' AND a.del_flag = 0\n"+"AND (b.ID = ? OR b.pids LIKE CONCAT(CONCAT('%',?),'%'))\n"+"GROUP BY a.dept_id,b.name\n"+"ORDER BY a.dept_id,b.name\n",pas);
}
if(!result2.isEmpty()){
@ -1487,18 +1438,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '基础设施' AND a.del_flag = 0\n"+
"GROUP BY a.dept_id,b.name\n"+
"ORDER BY a.dept_id,b.name\n");
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '基础设施' AND a.del_flag = 0\n"+"GROUP BY a.dept_id,b.name\n"+"ORDER BY a.dept_id,b.name\n");
}else{
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '基础设施' AND a.del_flag = 0\n"+
"AND (b.ID = ? OR INSTR(b.pids,?))\n"+
"GROUP BY a.dept_id,b.name\n"+
"ORDER BY a.dept_id,b.name\n",pas);
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '基础设施' AND a.del_flag = 0\n"+"AND (b.ID = ? OR INSTR(b.pids,?))\n"+"GROUP BY a.dept_id,b.name\n"+"ORDER BY a.dept_id,b.name\n",pas);
}
if(!result2.isEmpty()){
@ -1544,18 +1486,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '数据资源' AND a.del_flag = 0\n"+
"GROUP BY a.dept_id,b.name\n"+
"ORDER BY a.dept_id,b.name\n");
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '数据资源' AND a.del_flag = 0\n"+"GROUP BY a.dept_id,b.name\n"+"ORDER BY a.dept_id,b.name\n");
}else{
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '数据资源' AND a.del_flag = 0\n"+
"AND (b.ID = ? OR INSTR(b.pids,?))\n"+
"GROUP BY a.dept_id,b.name\n"+
"ORDER BY a.dept_id,b.name\n",pas);
result2=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName\n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '数据资源' AND a.del_flag = 0\n"+"AND (b.ID = ? OR INSTR(b.pids,?))\n"+"GROUP BY a.dept_id,b.name\n"+"ORDER BY a.dept_id,b.name\n",pas);
}
@ -1601,20 +1534,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
"SELECT COUNT(a.id) AS resourceNum,b.name AS deptName\n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '知识库' AND a.del_flag = 0\n"+
"GROUP BY b.name\n"+
"ORDER BY b.name ");
result=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,b.name AS deptName\n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '知识库' AND a.del_flag = 0\n"+"GROUP BY b.name\n"+"ORDER BY b.name ");
}else{
result=jdbcTemplate.queryForList(
"SELECT COUNT(a.id) AS resourceNum,b.name AS deptName\n"+
"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+
"WHERE a.type = '知识库' AND a.del_flag = 0\n"+
"AND (b.ID = ? OR INSTR(b.pids,?))\n"+
"GROUP BY b.name\n"+
"ORDER BY b.name ",pas);
result=jdbcTemplate.queryForList("SELECT COUNT(a.id) AS resourceNum,b.name AS deptName\n"+"FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id\n"+"WHERE a.type = '知识库' AND a.del_flag = 0\n"+"AND (b.ID = ? OR INSTR(b.pids,?))\n"+"GROUP BY b.name\n"+"ORDER BY b.name ",pas);
result=jdbcTemplate.queryForList("SELECT a.* FROM tb_resource_car a INNER JOIN sys_user b ON a.creator = b.id "+
"INNER JOIN tb_data_resource d ON a.resource_id = d.id WHERE a.del_flag = 0 AND d.type = ? AND "+
"d.dept_id = ? AND d.del_flag = 0 ORDER BY a.create_date DESC LIMIT ?,?",ps);
result=jdbcTemplate.queryForList("SELECT a.* FROM tb_resource_car a INNER JOIN sys_user b ON a.creator = b.id "+"INNER JOIN tb_data_resource d ON a.resource_id = d.id WHERE a.del_flag = 0 AND d.type = ? AND "+"d.dept_id = ? AND d.del_flag = 0 ORDER BY a.create_date DESC LIMIT ?,?",ps);
returnresult;
}
@ -1903,8 +1823,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn