提交 fb9a12e1 作者: yanxin

专题绑定信息源查询逻辑修改

上级 3117c3b8
...@@ -281,27 +281,29 @@ ...@@ -281,27 +281,29 @@
iso.`status`, iso.`status`,
iso.crawl_type, iso.crawl_type,
iso.create_time, iso.create_time,
sm.is_exempt_keyword, bind.is_exempt_keyword,
sm.is_free_check bind.is_free_check
FROM FROM
info_source_group_map m info_source iso left join (
INNER JOIN info_source iso ON m.source_id = iso.id select sm.source_id,sm.is_exempt_keyword,sm.is_free_check from subject_info_source_map sm where sm.type = 1
INNER JOIN subject_info_source_map sm ON sm.source_id = m.group_id <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> union
WHERE select m.source_id,n.is_exempt_keyword,n.is_free_check from subject_info_source_map n
m.group_id IN ( SELECT source_id FROM subject_info_source_map WHERE type IN ( 2, 5 ) inner join info_source_group_map m on n.source_id = m.group_id
<if test="subjectIds != null and subjectIds.size() > 0"> where n.type = 2
and subject_id in <if test="subjectIds != null and subjectIds.size() > 0">
<foreach collection="subjectIds" item="item" open="(" close=")" separator=","> and n.subject_id in
#{item} <foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
</foreach> #{item}
</if> </foreach>
GROUP BY source_id ) </if>
) bind on (iso.id = bind.source_id)
where bind.source_id is not null
<if test="sourceIds != null and sourceIds.size() > 0"> <if test="sourceIds != null and sourceIds.size() > 0">
and iso.id in and iso.id in
<foreach collection="sourceIds" item="item" open="(" close=")" separator=","> <foreach collection="sourceIds" item="item" open="(" close=")" separator=",">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论