Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
think-tank
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
张京坤
think-tank
Commits
e0c3d38e
提交
e0c3d38e
authored
8月 27, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
智库导出bug修改
上级
c7692e85
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
410 行增加
和
11 行删除
+410
-11
ThinktankBasicInfoController.java
...sn/thinktank/controller/ThinktankBasicInfoController.java
+165
-3
InfoSourceMapper.java
...main/java/com/zzsn/thinktank/mapper/InfoSourceMapper.java
+11
-1
InfoSourceService.java
...in/java/com/zzsn/thinktank/service/InfoSourceService.java
+11
-2
InfoSourceServiceImpl.java
...om/zzsn/thinktank/service/impl/InfoSourceServiceImpl.java
+7
-2
ThinktankBasicInfoServiceImpl.java
...thinktank/service/impl/ThinktankBasicInfoServiceImpl.java
+56
-2
InfoSourceMapper.xml
src/main/resources/mapper/InfoSourceMapper.xml
+160
-1
没有找到文件。
src/main/java/com/zzsn/thinktank/controller/ThinktankBasicInfoController.java
浏览文件 @
e0c3d38e
...
...
@@ -7,6 +7,7 @@ import cn.hutool.poi.excel.ExcelUtil;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zzsn.thinktank.entity.ThinktankBasicInfo
;
import
com.zzsn.thinktank.service.InfoSourceService
;
import
com.zzsn.thinktank.service.LeaderCategoryService
;
import
com.zzsn.thinktank.service.ThinktankBasicInfoService
;
import
com.zzsn.thinktank.util.ExcelExportUtil
;
...
...
@@ -42,6 +43,8 @@ public class ThinktankBasicInfoController {
ThinktankBasicInfoService
thinktankBasicInfoService
;
@Autowired
LeaderCategoryService
leaderCategoryService
;
@Autowired
private
InfoSourceService
infoSourceService
;
@Value
(
"${cj.url.infoSource.columnDetail:http://1.95.79.85:8823/baseSourceInfo/api/infoSource/columnDetail?columnIds={IDS}}"
)
private
String
CJ_IINFOSOURCE_COLUMNDETAIL
;
...
...
@@ -217,10 +220,10 @@ public class ThinktankBasicInfoController {
ExcelExportUtil
.
exportExcelData
(
workbook
,
0
,
Arrays
.
asList
(
arr
),
rows
,
"智库基本信息"
);
//智库栏目采集统计信息
String
[]
header
=
new
String
[]{
"智库机构id"
,
"智库机构编码"
,
"中文全称"
,
"关联信息源
数量"
,
"信息采集总量"
,
"关联信息源
编码"
,
String
[]
header
=
new
String
[]{
"智库机构id"
,
"智库机构编码"
,
"中文全称"
,
"关联信息源
栏目数量"
,
"信息采集总量"
,
"关联信息源栏目
编码"
,
"关联信息源名称"
,
"栏目名称"
,
"网址"
,
"启用状态(1-启用;0-禁用)"
,
"信息源采集数量"
,
"信息源近一月采集量"
,
"采集状态"
};
List
<
ThinkTankSourceVO
>
thinkTankSourceVOS
=
thinktankBasicInfoService
.
thinkTankCollectCount
(
thinkTankBasicInfos
);
//补充信息源采集状态
//补充信息源
栏目
采集状态
List
<
String
>
allIds
=
thinkTankSourceVOS
.
stream
().
map
(
ThinkTankSourceVO:
:
getSourceId
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
List
<
String
>>
groupIdList
=
CollectionUtil
.
split
(
allIds
,
300
);
Map
<
String
,
JSONObject
>
infoMap
=
new
HashMap
<>();
...
...
@@ -344,7 +347,166 @@ public class ThinktankBasicInfoController {
* @param thinkTankBasicInfos
* @param tIds 智库id列表
*/
public
void
exportBindCount
(
XSSFWorkbook
workbook
,
int
sheetNum
,
String
sheetName
,
Map
<
String
,
JSONObject
>
infoMap
,
List
<
ThinktankBasicInfo
>
thinkTankBasicInfos
,
List
<
String
>
tIds
)
{
private
void
exportBindCount
(
XSSFWorkbook
workbook
,
int
sheetNum
,
String
sheetName
,
Map
<
String
,
JSONObject
>
infoMap
,
List
<
ThinktankBasicInfo
>
thinkTankBasicInfos
,
List
<
String
>
tIds
)
{
//查询所有的
List
<
BindSourceDetailVO
>
bindSourceDetailList
=
infoSourceService
.
bindSourceDetail
(
tIds
);
List
<
String
>
headers
=
new
ArrayList
<>();
headers
.
add
(
"智库机构id"
);
headers
.
add
(
"智库机构编码"
);
headers
.
add
(
"中文全称"
);
headers
.
add
(
"中文简称"
);
headers
.
add
(
"英文全称"
);
headers
.
add
(
"英文简称"
);
headers
.
add
(
"国别"
);
headers
.
add
(
"影响力及地位"
);
headers
.
add
(
"是否展示"
);
headers
.
add
(
"栏目数"
);
Map
<
String
,
Integer
>
columnNum
=
new
HashMap
<>();
headers
.
add
(
"启用数"
);
Map
<
String
,
Integer
>
enableNum
=
new
HashMap
<>();
headers
.
add
(
"未启用数"
);
Map
<
String
,
Integer
>
disableNum
=
new
HashMap
<>();
headers
.
add
(
"正常采集"
);
Map
<
String
,
Integer
>
normalNum
=
new
HashMap
<>();
headers
.
add
(
"访问异常"
);
Map
<
String
,
Integer
>
errorNum
=
new
HashMap
<>();
headers
.
add
(
"列表页解析异常"
);
Map
<
String
,
Integer
>
listParseErrorNum
=
new
HashMap
<>();
headers
.
add
(
"详情页配置异常"
);
Map
<
String
,
Integer
>
detailParseErrorNum
=
new
HashMap
<>();
headers
.
add
(
"详情规则有差异"
);
Map
<
String
,
Integer
>
detailParseDiffNum
=
new
HashMap
<>();
headers
.
add
(
"信息源漏采"
);
Map
<
String
,
Integer
>
missNum
=
new
HashMap
<>();
headers
.
add
(
"账号异常"
);
Map
<
String
,
Integer
>
accountErrorNum
=
new
HashMap
<>();
headers
.
add
(
"微信公众号异堂"
);
Map
<
String
,
Integer
>
wechatErrorNum
=
new
HashMap
<>();
headers
.
add
(
"待配置"
);
Map
<
String
,
Integer
>
configNum
=
new
HashMap
<>();
headers
.
add
(
"待验证"
);
Map
<
String
,
Integer
>
verifyNum
=
new
HashMap
<>();
headers
.
add
(
"验证通过"
);
Map
<
String
,
Integer
>
verifyPassNum
=
new
HashMap
<>();
headers
.
add
(
"验证不通过"
);
Map
<
String
,
Integer
>
verifyFailNum
=
new
HashMap
<>();
//查询智库列表
List
<
String
>
hasInfoIds
=
bindSourceDetailList
.
stream
().
map
(
BindSourceDetailVO:
:
getThinkTankId
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
ThinktankBasicInfo
>
basicInfos
=
thinkTankBasicInfos
.
stream
().
filter
(
item
->
hasInfoIds
.
contains
(
item
.
getId
())).
collect
(
Collectors
.
toList
());
for
(
ThinktankBasicInfo
basicInfo
:
basicInfos
)
{
String
tid
=
basicInfo
.
getId
();
//查询智库关联的信息源列表
List
<
String
>
sourceList
=
bindSourceDetailList
.
stream
().
filter
(
item
->
tid
.
equals
(
item
.
getThinkTankId
())).
map
(
BindSourceDetailVO:
:
getSourceId
).
collect
(
Collectors
.
toList
());
for
(
String
sourceId
:
sourceList
)
{
JSONObject
record
=
infoMap
.
get
(
sourceId
);
if
(
record
==
null
)
{
continue
;
}
countAdd
(
columnNum
,
tid
);
//是否启用
if
(
"1"
.
equals
(
record
.
getString
(
"enable"
)))
{
countAdd
(
enableNum
,
tid
);
}
else
{
countAdd
(
disableNum
,
tid
);
}
//采集状态
switch
(
record
.
getString
(
"abnormalCode"
))
{
case
"1"
:
countAdd
(
normalNum
,
tid
);
break
;
case
"101"
:
countAdd
(
errorNum
,
tid
);
break
;
case
"201"
:
countAdd
(
listParseErrorNum
,
tid
);
break
;
case
"202"
:
countAdd
(
detailParseErrorNum
,
tid
);
break
;
case
"203"
:
countAdd
(
detailParseDiffNum
,
tid
);
break
;
case
"301"
:
countAdd
(
missNum
,
tid
);
break
;
case
"503"
:
countAdd
(
accountErrorNum
,
tid
);
break
;
case
"601"
:
countAdd
(
wechatErrorNum
,
tid
);
break
;
}
//状态
switch
(
record
.
getString
(
"status"
))
{
case
"1"
:
countAdd
(
configNum
,
tid
);
break
;
case
"2"
:
countAdd
(
verifyNum
,
tid
);
break
;
case
"3"
:
countAdd
(
verifyPassNum
,
tid
);
break
;
case
"4"
:
countAdd
(
verifyFailNum
,
tid
);
break
;
}
}
}
List
<
List
<
String
>>
rows
=
new
ArrayList
<>();
for
(
ThinktankBasicInfo
basicInfo
:
basicInfos
)
{
List
<
String
>
dataItem
=
new
ArrayList
<>();
String
id
=
basicInfo
.
getId
();
//智库机构id
dataItem
.
add
(
basicInfo
.
getId
());
//智库机构编码
dataItem
.
add
(
basicInfo
.
getCodeId
());
//中文全称
dataItem
.
add
(
basicInfo
.
getChineseWhole
());
//中文简称
dataItem
.
add
(
basicInfo
.
getChineseSimple
());
//英文全称
dataItem
.
add
(
basicInfo
.
getEnglishWhole
());
//英文简称
dataItem
.
add
(
basicInfo
.
getEnglishSimple
());
//国别
dataItem
.
add
(
basicInfo
.
getBelongCountry
());
//影响力及地位
dataItem
.
add
(
basicInfo
.
getInfluencePosition
());
//是否展示
dataItem
.
add
(
String
.
valueOf
(
basicInfo
.
getYnDisplay
()));
//栏目数
dataItem
.
add
(
getMapStr
(
columnNum
,
id
));
//是否启用
dataItem
.
add
(
getMapStr
(
enableNum
,
id
));
dataItem
.
add
(
getMapStr
(
disableNum
,
id
));
//采集状态
dataItem
.
add
(
getMapStr
(
normalNum
,
id
));
dataItem
.
add
(
getMapStr
(
errorNum
,
id
));
dataItem
.
add
(
getMapStr
(
listParseErrorNum
,
id
));
dataItem
.
add
(
getMapStr
(
detailParseErrorNum
,
id
));
dataItem
.
add
(
getMapStr
(
detailParseDiffNum
,
id
));
dataItem
.
add
(
getMapStr
(
missNum
,
id
));
dataItem
.
add
(
getMapStr
(
accountErrorNum
,
id
));
dataItem
.
add
(
getMapStr
(
wechatErrorNum
,
id
));
//状态
dataItem
.
add
(
getMapStr
(
configNum
,
id
));
dataItem
.
add
(
getMapStr
(
verifyNum
,
id
));
dataItem
.
add
(
getMapStr
(
verifyPassNum
,
id
));
dataItem
.
add
(
getMapStr
(
verifyFailNum
,
id
));
rows
.
add
(
dataItem
);
}
ExcelExportUtil
.
exportExcelData
(
workbook
,
sheetNum
,
headers
,
rows
,
sheetName
);
}
private
void
exportBindCount_old
(
XSSFWorkbook
workbook
,
int
sheetNum
,
String
sheetName
,
Map
<
String
,
JSONObject
>
infoMap
,
List
<
ThinktankBasicInfo
>
thinkTankBasicInfos
,
List
<
String
>
tIds
)
{
//查询所有的
List
<
CountVo
>
bindAll
=
thinktankBasicInfoService
.
bindInfoSource
(
tIds
);
List
<
String
>
headers
=
new
ArrayList
<>();
...
...
src/main/java/com/zzsn/thinktank/mapper/InfoSourceMapper.java
浏览文件 @
e0c3d38e
...
...
@@ -120,6 +120,16 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
* @author lkg
* @date 2025/8/5
*/
List
<
BindSourceDetailVO
>
bindSourceCount
(
@Param
(
"thinkTankIds"
)
List
<
String
>
thinkTankIds
);
List
<
BindSourceDetailVO
>
bindSourceDetail
(
@Param
(
"thinkTankIds"
)
List
<
String
>
thinkTankIds
);
/**
* 获取智库绑定信息源的详细信息
*
* @param thinkTankIds 智库id集合
* @author lkg
* @date 2025/8/5
*/
List
<
ThinkTankSourceVO
>
bindSourceDetailInfo
(
@Param
(
"thinkTankIds"
)
List
<
String
>
thinkTankIds
);
}
src/main/java/com/zzsn/thinktank/service/InfoSourceService.java
浏览文件 @
e0c3d38e
...
...
@@ -111,11 +111,20 @@ public interface InfoSourceService extends IService<InfoSource> {
JSONObject
bindInfoSourceColumnList
(
String
thinkTankId
);
/**
* 获取智库绑定信息源
的数量
* 获取智库绑定信息源
栏目统计
*
* @param thinkTankIds 智库id集合
* @author lkg
* @date 2025/8/5
*/
List
<
BindSourceDetailVO
>
bindSourceCount
(
List
<
String
>
thinkTankIds
);
List
<
BindSourceDetailVO
>
bindSourceDetail
(
List
<
String
>
thinkTankIds
);
/**
* 获取智库绑定信息源栏目的详细信息
*
* @param thinkTankIds 智库id集合
* @author lkg
* @date 2025/8/5
*/
List
<
ThinkTankSourceVO
>
bindSourceDetailInfo
(
List
<
String
>
thinkTankIds
);
}
src/main/java/com/zzsn/thinktank/service/impl/InfoSourceServiceImpl.java
浏览文件 @
e0c3d38e
...
...
@@ -343,7 +343,12 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou
}
@Override
public
List
<
BindSourceDetailVO
>
bindSourceCount
(
List
<
String
>
thinkTankIds
)
{
return
baseMapper
.
bindSourceCount
(
thinkTankIds
);
public
List
<
BindSourceDetailVO
>
bindSourceDetail
(
List
<
String
>
thinkTankIds
)
{
return
baseMapper
.
bindSourceDetail
(
thinkTankIds
);
}
@Override
public
List
<
ThinkTankSourceVO
>
bindSourceDetailInfo
(
List
<
String
>
thinkTankIds
)
{
return
baseMapper
.
bindSourceDetailInfo
(
thinkTankIds
);
}
}
src/main/java/com/zzsn/thinktank/service/impl/ThinktankBasicInfoServiceImpl.java
浏览文件 @
e0c3d38e
...
...
@@ -286,7 +286,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
//智库id集合
List
<
String
>
groupIds
=
list
.
stream
().
map
(
ThinktankBasicInfoVo:
:
getId
).
collect
(
Collectors
.
toList
());
//智库绑定信息源栏目详细情况
List
<
BindSourceDetailVO
>
bindSourceDetailList
=
infoSourceService
.
bindSource
Count
(
groupIds
);
List
<
BindSourceDetailVO
>
bindSourceDetailList
=
infoSourceService
.
bindSource
Detail
(
groupIds
);
//按智库分组
Map
<
String
,
List
<
BindSourceDetailVO
>>
collect
=
bindSourceDetailList
.
stream
().
collect
(
Collectors
.
groupingBy
(
BindSourceDetailVO:
:
getThinkTankId
));
//所有绑定的信息源栏目id集合
...
...
@@ -466,7 +466,7 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
//智库绑定信息源栏目详细情况
List
<
String
>
thinkTankIds
=
new
ArrayList
<>();
thinkTankIds
.
add
(
id
);
List
<
BindSourceDetailVO
>
bindSourceDetailList
=
infoSourceService
.
bindSource
Count
(
thinkTankIds
);
List
<
BindSourceDetailVO
>
bindSourceDetailList
=
infoSourceService
.
bindSource
Detail
(
thinkTankIds
);
List
<
String
>
sidList
=
bindSourceDetailList
.
stream
().
map
(
BindSourceDetailVO:
:
getSourceId
).
collect
(
Collectors
.
toList
());
//设置分页参数
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
...
...
@@ -703,6 +703,60 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
Map
<
String
,
ThinktankBasicInfo
>
map
=
dataList
.
stream
().
collect
(
Collectors
.
toMap
(
ThinktankBasicInfo:
:
getId
,
Function
.
identity
()));
List
<
String
>
idList
=
new
ArrayList
<>();
dataList
.
forEach
(
e
->
idList
.
add
(
e
.
getId
()));
//智库绑定信息源栏目详细情况
List
<
ThinkTankSourceVO
>
thinkTankSourceVOS
=
infoSourceService
.
bindSourceDetailInfo
(
idList
);
//信息源id集合
List
<
String
>
sourceIds
=
thinkTankSourceVOS
.
stream
().
map
(
ThinkTankSourceVO:
:
getSourceId
).
collect
(
Collectors
.
toList
());
//查询es
BoolQueryBuilder
boolQuerylist
=
QueryBuilders
.
boolQuery
();
boolQuerylist
.
must
(
QueryBuilders
.
termsQuery
(
"sid"
,
sourceIds
));
Map
<
String
,
Long
>
totalCountMap
=
new
HashMap
<>();
Map
<
String
,
Long
>
monthlyCountMap
=
new
HashMap
<>();
try
{
//所有
totalCountMap
=
esUtil
.
groupBy
(
"basedata"
,
"sid"
,
boolQuerylist
,
sourceIds
.
size
());
//近一个月
DateTime
yesterday
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
yesterday
();
DateTime
startTime
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetDay
(
yesterday
,
-
30
);
boolQuerylist
.
filter
(
QueryBuilders
.
rangeQuery
(
"createDate"
)
.
gte
(
EsDateUtil
.
esFieldDateFormat
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
startTime
,
"yyyy-MM-dd 00:00:00"
)))
.
lte
(
EsDateUtil
.
esFieldDateFormat
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
yesterday
,
"yyyy-MM-dd 23:59:59"
))));
monthlyCountMap
=
esUtil
.
groupBy
(
"basedata"
,
"sid"
,
boolQuerylist
,
100
);
}
catch
(
IOException
e
)
{
log
.
error
(
"ES查询失败"
,
e
);
}
//采集量统计
for
(
ThinkTankSourceVO
thinkTankSourceVO
:
thinkTankSourceVOS
)
{
String
sourceId
=
thinkTankSourceVO
.
getSourceId
();
Long
infoCount
=
totalCountMap
.
get
(
sourceId
);
if
(
infoCount
==
null
)
{
infoCount
=
0L
;
}
thinkTankSourceVO
.
setInfoCount
(
infoCount
.
intValue
());
Long
infoMonthlyCount
=
monthlyCountMap
.
get
(
sourceId
);
if
(
infoMonthlyCount
==
null
)
{
infoMonthlyCount
=
0L
;
}
thinkTankSourceVO
.
setInfoMonthlyCount
(
infoMonthlyCount
.
intValue
());
}
//数据合并
List
<
ThinkTankSourceVO
>
list
=
new
ArrayList
<>();
Map
<
String
,
List
<
ThinkTankSourceVO
>>
groupCountMap
=
thinkTankSourceVOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
ThinkTankSourceVO:
:
getGroupId
));
for
(
Map
.
Entry
<
String
,
List
<
ThinkTankSourceVO
>>
entry
:
groupCountMap
.
entrySet
())
{
List
<
ThinkTankSourceVO
>
value
=
entry
.
getValue
();
int
groupCount
=
value
.
stream
().
mapToInt
(
ThinkTankSourceVO:
:
getInfoCount
).
sum
();
ThinkTankSourceVO
thinkTankSourceVO
=
value
.
get
(
0
);
thinkTankSourceVO
.
setGroupCount
(
groupCount
);
thinkTankSourceVO
.
setInfoSourceCount
(
value
.
size
());
list
.
addAll
(
value
);
}
return
list
;
}
public
List
<
ThinkTankSourceVO
>
thinkTankCollectCount_old
(
List
<
ThinktankBasicInfo
>
dataList
)
{
Map
<
String
,
ThinktankBasicInfo
>
map
=
dataList
.
stream
().
collect
(
Collectors
.
toMap
(
ThinktankBasicInfo:
:
getId
,
Function
.
identity
()));
List
<
String
>
idList
=
new
ArrayList
<>();
dataList
.
forEach
(
e
->
idList
.
add
(
e
.
getId
()));
List
<
ThinkTankSourceVO
>
thinkTankSourceVOS
=
infoSourceGroupMapService
.
listOfThinkTank
(
idList
);
List
<
String
>
sourceIds
=
new
ArrayList
<>();
for
(
ThinkTankSourceVO
thinkTankSourceVO
:
thinkTankSourceVOS
)
{
...
...
src/main/resources/mapper/InfoSourceMapper.xml
浏览文件 @
e0c3d38e
...
...
@@ -456,7 +456,7 @@
</if>
</select>
<select
id=
"bindSource
Count
"
resultType=
"com.zzsn.thinktank.vo.BindSourceDetailVO"
>
<select
id=
"bindSource
Detail
"
resultType=
"com.zzsn.thinktank.vo.BindSourceDetailVO"
>
select a.group_id as thinkTankId,a.source_id from (
select distinct x.source_id,x.group_id from (
select m.source_id,n.group_id from thinktank_info_source_group_map n
...
...
@@ -611,4 +611,163 @@
LEFT JOIN info_source x on(a.source_id = x.id)
where b.source_id is null and x.id is not null
</select>
<select
id=
"bindSourceDetailInfo"
resultType=
"com.zzsn.thinktank.vo.ThinkTankSourceVO"
>
select x.group_id,z.code_id,z.chinese_whole,x.source_id,y.info_source_code,y.web_site_name,y.site_name,y.site_uri,y.status from (
select a.group_id,a.source_id from (
select distinct x.source_id,x.group_id from (
select m.source_id,n.group_id from thinktank_info_source_group_map n
inner join info_source_group_map m on n.source_id = m.group_id
where n.type = 2
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and n.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select iso.id as source_id,sim.group_id from
thinktank_info_source_group_map sim
INNER JOIN info_source_main_group_map m ON m.group_id = sim.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
where sim.type = 32
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and sim.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select sm.source_id,sm.group_id from thinktank_info_source_group_map sm where sm.type = 1
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and sm.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select iso.id as source_id ,sm.group_id FROM
thinktank_info_source_group_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
WHERE
sm.type = 31
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and sm.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select m.entity_code as source_id,n.group_id from thinktank_info_source_group_map n
inner join clb_label_info_source_map m on n.source_id = m.label_code and n.source_item_id = m.label_item_code
where n.type = 12
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and n.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select isoo.id as source_id,smm.group_id
FROM
thinktank_info_source_group_map smm
INNER JOIN clb_label_main_source_map lam ON smm.source_id = lam.label_code
AND smm.source_item_id = lam.label_item_code
INNER JOIN info_source_main im ON lam.entity_code = im.id
INNER JOIN info_source isoo ON im.id = isoo.info_source_id
WHERE
smm.type = 312
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and smm.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) x) a
LEFT JOIN
(select distinct x.source_id,x.group_id from (
select m.source_id,n.group_id from thinktank_info_source_group_map n
inner join info_source_group_map m on n.source_id = m.group_id
where n.type = 4
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and n.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
SELECT
iso.id as source_id,sim.group_id
FROM
thinktank_info_source_group_map sim
INNER JOIN info_source_main_group_map m ON m.group_id = sim.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
WHERE
sim.type = 34
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and sim.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select sm.source_id,sm.group_id from thinktank_info_source_group_map sm where sm.type = 3
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and sm.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
SELECT
iso.id as source_id,sm.group_id
FROM
thinktank_info_source_group_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
INNER JOIN info_source iso ON im.id = iso.info_source_id
WHERE
sm.type = 33
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and sm.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
select m.entity_code as source_id,n.group_id from thinktank_info_source_group_map n
inner join clb_label_info_source_map m on n.source_id = m.label_code and n.source_item_id = m.label_item_code
where n.type = 14
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and n.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
union
SELECT
isoo.id as source_id,smm.group_id
FROM
thinktank_info_source_group_map smm
INNER JOIN clb_label_main_source_map lam ON smm.source_id = lam.label_code
AND smm.source_item_id = lam.label_item_code
INNER JOIN info_source_main im ON lam.entity_code = im.id
INNER JOIN info_source isoo ON im.id = isoo.info_source_id
WHERE
smm.type = 314
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and smm.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
) x) b
on (a.group_id = b.group_id and a.source_id = b.source_id)
LEFT JOIN info_source x on(a.source_id = x.id)
where b.source_id is null and x.id is not null
) x inner join info_source y on x.source_id = y.id
inner join thinktank_basic_info z on x.group_id = z.id
</select>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论