Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
think-tank
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
张京坤
think-tank
Commits
0f5782d5
提交
0f5782d5
authored
8月 06, 2025
作者:
925993793@qq.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试bug修改
上级
d4a0d3b8
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
310 行增加
和
57 行删除
+310
-57
MybatisInterceptor.java
...in/java/com/zzsn/thinktank/config/MybatisInterceptor.java
+111
-0
InfoSourceGroupMapServiceImpl.java
...thinktank/service/impl/InfoSourceGroupMapServiceImpl.java
+42
-42
BindVO.java
src/main/java/com/zzsn/thinktank/vo/BindVO.java
+1
-1
InfoSourceMapper.xml
src/main/resources/mapper/InfoSourceMapper.xml
+156
-14
没有找到文件。
src/main/java/com/zzsn/thinktank/config/MybatisInterceptor.java
0 → 100644
浏览文件 @
0f5782d5
package
com
.
zzsn
.
thinktank
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.binding.MapperMethod.ParamMap
;
import
org.apache.ibatis.executor.Executor
;
import
org.apache.ibatis.mapping.MappedStatement
;
import
org.apache.ibatis.mapping.SqlCommandType
;
import
org.apache.ibatis.plugin.*
;
import
org.springframework.stereotype.Component
;
import
java.lang.reflect.Field
;
import
java.util.*
;
/**
* mybatis拦截器,自动注入创建人、创建时间、修改人、修改时间
*
* @Author scott
* @Date 2019-01-19
*/
@Slf4j
@Component
@Intercepts
({
@Signature
(
type
=
Executor
.
class
,
method
=
"update"
,
args
=
{
MappedStatement
.
class
,
Object
.
class
})})
public
class
MybatisInterceptor
implements
Interceptor
{
@Override
public
Object
intercept
(
Invocation
invocation
)
throws
Throwable
{
MappedStatement
mappedStatement
=
(
MappedStatement
)
invocation
.
getArgs
()[
0
];
String
sqlId
=
mappedStatement
.
getId
();
log
.
debug
(
"------sqlId------"
+
sqlId
);
SqlCommandType
sqlCommandType
=
mappedStatement
.
getSqlCommandType
();
Object
parameter
=
invocation
.
getArgs
()[
1
];
log
.
debug
(
"------sqlCommandType------"
+
sqlCommandType
);
if
(
parameter
==
null
)
{
return
invocation
.
proceed
();
}
Date
date
=
new
Date
();
if
(
SqlCommandType
.
INSERT
==
sqlCommandType
)
{
Field
[]
fields
=
getAllFields
(
parameter
);
for
(
Field
field
:
fields
)
{
String
fieldName
=
field
.
getName
();
// 注入创建时间
if
(
"createTime"
.
equals
(
fieldName
))
{
field
.
setAccessible
(
true
);
Object
localCreateDate
=
field
.
get
(
parameter
);
field
.
setAccessible
(
false
);
if
(
localCreateDate
==
null
||
localCreateDate
.
equals
(
""
))
{
changeData
(
field
,
parameter
,
date
);
}
}
}
}
if
(
SqlCommandType
.
UPDATE
==
sqlCommandType
)
{
Field
[]
fields
;
if
(
parameter
instanceof
ParamMap
)
{
ParamMap
<?>
p
=
(
ParamMap
<?>)
parameter
;
if
(
p
.
containsKey
(
"et"
))
{
parameter
=
p
.
get
(
"et"
);
}
else
{
parameter
=
p
.
get
(
"param1"
);
}
if
(
parameter
==
null
)
{
return
invocation
.
proceed
();
}
fields
=
getAllFields
(
parameter
);
}
else
{
fields
=
getAllFields
(
parameter
);
}
for
(
Field
field
:
fields
)
{
String
fieldName
=
field
.
getName
();
log
.
debug
(
"------field.name------"
+
fieldName
);
if
(
"updateTime"
.
equals
(
fieldName
))
{
changeData
(
field
,
parameter
,
date
);
}
}
}
return
invocation
.
proceed
();
}
@Override
public
Object
plugin
(
Object
target
)
{
return
Plugin
.
wrap
(
target
,
this
);
}
@Override
public
void
setProperties
(
Properties
properties
)
{
}
//修改对应字段的值
private
void
changeData
(
Field
field
,
Object
parameter
,
Object
data
){
try
{
field
.
setAccessible
(
true
);
field
.
set
(
parameter
,
data
);
field
.
setAccessible
(
false
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
private
Field
[]
getAllFields
(
Object
object
)
{
Class
<?>
clazz
=
object
.
getClass
();
List
<
Field
>
fieldList
=
new
ArrayList
<>();
while
(
clazz
!=
null
)
{
fieldList
.
addAll
(
new
ArrayList
<>(
Arrays
.
asList
(
clazz
.
getDeclaredFields
())));
clazz
=
clazz
.
getSuperclass
();
}
Field
[]
fields
=
new
Field
[
fieldList
.
size
()];
fieldList
.
toArray
(
fields
);
return
fields
;
}
}
src/main/java/com/zzsn/thinktank/service/impl/InfoSourceGroupMapServiceImpl.java
浏览文件 @
0f5782d5
...
...
@@ -143,12 +143,12 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
return
;
}
if
(
sourceBindType
==
1
)
{
//解绑通用信息源组
//解绑通用信息源
栏目
组
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
INFO_SOURCE_GROUP
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//解绑
定向信息源
组
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
DIRECTIONA
_INFO_SOURCE_GROUP
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//解绑
屏蔽信息源栏目
组
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
EXCLUDE
_INFO_SOURCE_GROUP
.
getvalue
());
}
}
private
void
unBindInfoSourceColumn
(
BindVO
bindVO
)
{
...
...
@@ -158,12 +158,12 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
return
;
}
if
(
sourceBindType
==
1
)
{
//解绑通用信息源
组
//解绑通用信息源
栏目
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
INFO_SOURCE
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//解绑
定向信息源组
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
DIRECTIONA
_INFO_SOURCE
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//解绑
屏蔽信息源栏目
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
EXCLUDE
_INFO_SOURCE
.
getvalue
());
}
}
...
...
@@ -177,9 +177,9 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
//解绑通用信息源组
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
INFO_MAIN_SOURCE_GROUP
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//解绑
定向
信息源组
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
DIRECTIONA
_MAIN_INFO_SOURCE_GROUP
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//解绑
屏蔽
信息源组
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
EXCLUDE
_MAIN_INFO_SOURCE_GROUP
.
getvalue
());
}
}
private
void
unBindInfoSource
(
BindVO
bindVO
)
{
...
...
@@ -192,9 +192,9 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
//解绑通用信息源
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
INFO_MAIN_SOURCE
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//解绑
定向
信息源
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
DIRECTIONA
_MAIN_INFO_SOURCE
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//解绑
屏蔽
信息源
unBindInfoSource
(
bindVO
,
BindTypeEnum
.
EXCLUDE
_MAIN_INFO_SOURCE
.
getvalue
());
}
}
...
...
@@ -205,12 +205,12 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
return
;
}
if
(
sourceBindType
==
1
)
{
//解绑通用标签
//解绑通用
信息源栏目
标签
unBindLabel
(
bindVO
,
BindTypeEnum
.
INFO_SOURCE_LABEL
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//解绑
定向
标签
unBindLabel
(
bindVO
,
BindTypeEnum
.
DIRECTIONA
_INFO_SOURCE_LABEL
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//解绑
屏蔽信息源栏目
标签
unBindLabel
(
bindVO
,
BindTypeEnum
.
EXCLUDE
_INFO_SOURCE_LABEL
.
getvalue
());
}
}
private
void
unBindInfoSourceLabels
(
BindVO
bindVO
)
{
...
...
@@ -220,12 +220,12 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
return
;
}
if
(
sourceBindType
==
1
)
{
//解绑通用标签
//解绑通用
信息源
标签
unBindLabel
(
bindVO
,
BindTypeEnum
.
INFO_SOURCE_MAIN_LABEL
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//解绑
定向
标签
unBindLabel
(
bindVO
,
BindTypeEnum
.
DIRECTIONA
_INFO_MAIN_SOURCE_LABEL
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//解绑
屏蔽信息源
标签
unBindLabel
(
bindVO
,
BindTypeEnum
.
EXCLUDE
_INFO_MAIN_SOURCE_LABEL
.
getvalue
());
}
}
...
...
@@ -239,9 +239,9 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
//绑定通用信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
INFO_SOURCE_GROUP
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//绑定
定向
信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
DIRECTIONA
_INFO_SOURCE_GROUP
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//绑定
屏蔽
信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
EXCLUDE
_INFO_SOURCE_GROUP
.
getvalue
());
}
}
...
...
@@ -255,9 +255,9 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
//绑定通用信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
INFO_SOURCE
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//绑定
定向
信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
DIRECTIONA
_INFO_SOURCE
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//绑定
屏蔽
信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
EXCLUDE
_INFO_SOURCE
.
getvalue
());
}
}
...
...
@@ -269,12 +269,12 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
return
;
}
if
(
sourceBindType
==
1
)
{
//绑定通用
标签信息源
//绑定通用
信息源栏目标签
bindLabels
(
thinkTankId
,
bindLabels
,
BindTypeEnum
.
INFO_SOURCE_LABEL
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//绑定
定向标签信息源
bindLabels
(
thinkTankId
,
bindLabels
,
BindTypeEnum
.
DIRECTIONA
_INFO_SOURCE_LABEL
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//绑定
屏蔽信息源栏目标签
bindLabels
(
thinkTankId
,
bindLabels
,
BindTypeEnum
.
EXCLUDE
_INFO_SOURCE_LABEL
.
getvalue
());
}
}
...
...
@@ -286,12 +286,12 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
return
;
}
if
(
sourceBindType
==
1
)
{
//绑定通用
标签信息源
//绑定通用
信息源标签
bindLabels
(
thinkTankId
,
bindLabels
,
BindTypeEnum
.
INFO_SOURCE_MAIN_LABEL
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//绑定
定向标签信息源
bindLabels
(
thinkTankId
,
bindLabels
,
BindTypeEnum
.
DIRECTIONA
_INFO_MAIN_SOURCE_LABEL
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//绑定
屏蔽信息源标签
bindLabels
(
thinkTankId
,
bindLabels
,
BindTypeEnum
.
EXCLUDE
_INFO_MAIN_SOURCE_LABEL
.
getvalue
());
}
}
...
...
@@ -305,9 +305,9 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
//绑定通用信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
INFO_MAIN_SOURCE_GROUP
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//绑定
定向
信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
DIRECTIONA
_MAIN_INFO_SOURCE_GROUP
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//绑定
屏蔽
信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
EXCLUDE
_MAIN_INFO_SOURCE_GROUP
.
getvalue
());
}
}
...
...
@@ -321,9 +321,9 @@ public class InfoSourceGroupMapServiceImpl extends ServiceImpl<InfoSourceGroupMa
//绑定通用信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
INFO_MAIN_SOURCE
.
getvalue
());
}
if
(
sourceBindType
==
2
)
{
//绑定
定向
信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
DIRECTIONA
_MAIN_INFO_SOURCE
.
getvalue
());
if
(
sourceBindType
==
3
)
{
//绑定
屏蔽
信息源组
bindInfoSource
(
bindVO
,
idList
,
BindTypeEnum
.
EXCLUDE
_MAIN_INFO_SOURCE
.
getvalue
());
}
}
...
...
src/main/java/com/zzsn/thinktank/vo/BindVO.java
浏览文件 @
0f5782d5
...
...
@@ -19,7 +19,7 @@ public class BindVO {
private
List
<
String
>
bindIds
;
//信息源标签
private
List
<
BindLabelVo
>
bindLabels
;
//绑定类型类型(1:通用 2:定向)
//绑定类型类型(1:通用 2:定向
3:屏蔽
)
private
Integer
sourceBindType
;
//信息源类型(1:信息源栏目组 2:信息源栏目 3:信息源栏目标签 4:信息源组 5:信息源 6:信息源标签)
private
Integer
sourceType
;
...
...
src/main/resources/mapper/InfoSourceMapper.xml
浏览文件 @
0f5782d5
...
...
@@ -233,7 +233,7 @@
thinktank_info_source_group_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
WHERE
sm.type
IN ( 31, 36 )
sm.type
= 31
AND sm.group_id = #{thinkTankId} UNION
SELECT
im.id
...
...
@@ -242,7 +242,7 @@
INNER JOIN info_source_main_group_map m ON m.group_id = sm.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
WHERE
sm.type
IN ( 32, 35 )
sm.type
= 32
AND sm.group_id = #{thinkTankId} UNION
SELECT
im.id
...
...
@@ -252,9 +252,40 @@
AND sm.source_item_id = lam.label_item_code
INNER JOIN info_source_main im ON lam.entity_code = im.id
WHERE
sm.type
IN ( 312, 315 )
sm.type
= 312
AND sm.group_id = #{thinkTankId}
) bind
WHERE
1 = 1
AND bind.id NOT IN (
SELECT
im.id
FROM
thinktank_info_source_group_map sm
INNER JOIN info_source_main_group_map m ON m.group_id = sm.source_id
INNER JOIN info_source_main im ON im.id = m.source_id
WHERE
sm.type = 34
AND sm.group_id = #{thinkTankId} UNION
SELECT
im.id
FROM
thinktank_info_source_group_map sm
INNER JOIN info_source_main im ON im.id = sm.source_id
WHERE
sm.type = 33
AND sm.group_id = #{thinkTankId} UNION
SELECT
im.id
FROM
thinktank_info_source_group_map sm
INNER JOIN clb_label_main_source_map lam ON sm.source_id = lam.label_code
AND sm.source_item_id = lam.label_item_code
INNER JOIN info_source_main im ON lam.entity_code = im.id
WHERE
sm.type = 314
AND sm.group_id = #{thinkTankId}
)
) b ON a.id = b.id
WHERE
b.id IS NOT NULL
...
...
@@ -286,7 +317,7 @@
thinktank_info_source_group_map sm
INNER JOIN info_source im ON im.id = sm.source_id
WHERE
sm.type
IN ( 1, 6 )
sm.type
= 1
AND sm.group_id = #{thinkTankId} UNION
SELECT
im.id
...
...
@@ -295,7 +326,7 @@
INNER JOIN info_source_group_map m ON m.group_id = sm.source_id
INNER JOIN info_source im ON im.id = m.source_id
WHERE
sm.type
IN ( 2, 5 )
sm.type
= 2
AND sm.group_id = #{thinkTankId} UNION
SELECT
im.id
...
...
@@ -304,9 +335,38 @@
INNER JOIN clb_label_info_source_map lam ON sm.source_id = lam.label_code AND sm.source_item_id = lam.label_item_code
INNER JOIN info_source im ON lam.entity_code = im.id
WHERE
sm.type
IN ( 12, 15 )
sm.type
= 12
AND sm.group_id = #{thinkTankId}
) bind
where 1=1
and bind.id not in(
SELECT
im.id
FROM
thinktank_info_source_group_map sm
INNER JOIN info_source im ON im.id = sm.source_id
WHERE
sm.type = 3
AND sm.group_id = #{thinkTankId} UNION
SELECT
im.id
FROM
thinktank_info_source_group_map sm
INNER JOIN info_source_group_map m ON m.group_id = sm.source_id
INNER JOIN info_source im ON im.id = m.source_id
WHERE
sm.type = 4
AND sm.group_id = #{thinkTankId} UNION
SELECT
im.id
FROM
thinktank_info_source_group_map sm
INNER JOIN clb_label_info_source_map lam ON sm.source_id = lam.label_code AND sm.source_item_id = lam.label_item_code
INNER JOIN info_source im ON lam.entity_code = im.id
WHERE
sm.type = 14
AND sm.group_id = #{thinkTankId}
)
) b ON a.id = b.id
WHERE
b.id IS NOT NULL
...
...
@@ -397,10 +457,11 @@
</select>
<select
id=
"bindSourceCount"
resultType=
"com.zzsn.thinktank.vo.BindSourceDetailVO"
>
select distinct x.source_id,x.group_id as thinkTankId from (
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
inner join info_source_group_map m on n.source_id = m.group_id
where n.type
in(2,5)
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=
","
>
...
...
@@ -413,7 +474,7 @@
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
IN ( 32, 35 )
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=
","
>
...
...
@@ -421,7 +482,7 @@
</foreach>
</if>
union
select sm.source_id,sm.group_id from thinktank_info_source_group_map sm where sm.type
in(1,6)
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=
","
>
...
...
@@ -434,7 +495,7 @@
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
IN ( 31, 36 )
sm.type
= 31
<if
test=
"thinkTankIds != null and thinkTankIds.size() > 0"
>
and sm.group_id in
<foreach
collection=
"thinkTankIds"
item=
"item"
open=
"("
close=
")"
separator=
","
>
...
...
@@ -444,7 +505,7 @@
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
in(12,15)
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=
","
>
...
...
@@ -460,13 +521,94 @@
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 IN ( 312, 315 )
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
) 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
</select>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论