修改查询过滤逻辑

This commit is contained in:
liaozetao
2023-12-11 15:09:09 +08:00
parent f0b711f6fd
commit 744a11dd91

View File

@@ -24,13 +24,28 @@
and u.channel = #{channel}
</if>
<if test="(ignoreVersion != null and ignoreVersion != '') and (ignoreChannel == null or ignoreChannel == '')">
and alr.uid not in (
select distinct alr.uid from account_login_record as alr
left join users as u on u.uid = alr.uid
where alr.create_time >= DATE_SUB(CURDATE(), INTERVAL 60 DAY)
and (not find_in_set(alr.app_version, #{ignoreVersion}))
)
</if>
<if test="(ignoreVersion == null or ignoreVersion == '') and (ignoreChannel != null and ignoreChannel != '')">
and alr.uid not in (
select distinct alr.uid from account_login_record as alr
left join users as u on u.uid = alr.uid
where alr.create_time >= DATE_SUB(CURDATE(), INTERVAL 60 DAY)
and (not find_in_set(u.channel, #{ignoreChannel}))
)
</if>
<if test="(ignoreVersion != null and ignoreVersion != '') and (ignoreChannel != null and ignoreChannel != '')">
and alr.uid not in (
select distinct alr.uid from account_login_record as alr
left join users as u on u.uid = alr.uid
where alr.create_time >= DATE_SUB(CURDATE(), INTERVAL 60 DAY)
and ((not find_in_set(alr.app_version, #{ignoreVersion})) or (not find_in_set(u.channel, #{ignoreChannel})))
)
</if>
limit #{index}, #{offset}
</select>