提交 09fb6fb8 作者: 925993793@qq.com

Merge remote-tracking branch 'origin/event_fusion' into event_fusion

......@@ -27,52 +27,67 @@
</update>
<select id="subjectRealBindInfoSourceList" resultType="String">
select distinct x.id from (
select iso.id
from info_source_group_map m inner join info_source iso on m.source_id = iso.id
where m.group_id in (
select source_id from subject_info_source_map where type in(2,5)
select distinct a.source_id from
(select distinct x.source_id from (
select m.source_id from subject_info_source_map n
inner join info_source_group_map m on n.source_id = m.group_id
where n.type in(2,5)
<if test="subjectIds != null and subjectIds.size() > 0">
and subject_id in
and n.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by source_id
)
union
select iso.id
from subject_info_source_map sm inner join info_source iso on sm.source_id = iso.id where sm.type = 1
select sm.source_id from subject_info_source_map sm where sm.type in(1,6)
<if test="subjectIds != null and subjectIds.size() > 0">
and sm.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
) x
where x.id not in(
select distinct y.source_id from (
select m.source_id from info_source_group_map m
where m.group_id in (
select source_id from subject_info_source_map where type = 4
union
select m.entity_code as source_id from subject_info_source_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)
<if test="subjectIds != null and subjectIds.size() > 0">
and subject_id in
and n.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
) x) a LEFT JOIN
(select distinct x.source_id from (
select m.source_id from subject_info_source_map n
inner join info_source_group_map m on n.source_id = m.group_id
where n.type = 4
<if test="subjectIds != null and subjectIds.size() > 0">
and n.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by source_id
)
union
select sm.source_id from subject_info_source_map sm where type = 3
select sm.source_id from subject_info_source_map sm where sm.type = 3
<if test="subjectIds != null and subjectIds.size() > 0">
and sm.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
) y
)
union
select m.entity_code as source_id from subject_info_source_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="subjectIds != null and subjectIds.size() > 0">
and n.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
) x) b
on (a.source_id = b.source_id)
where b.source_id is null
</select>
<select id="subjectRealBindInfoSources" resultType="com.zzsn.event.vo.SubjectStatisticsVo">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论