提交 2b18bef1 作者: yanxin

根据专题查询绑定信息源逻辑更新

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