不返回没有的数据

This commit is contained in:
2025-07-25 15:51:55 +08:00
parent 1a1eb79914
commit 17b8ca110b

View File

@@ -145,7 +145,7 @@
left join source so on ms.source_id = so.id
left join scenic sc on sc.id = so.scenic_id
where
ms.member_id = #{memberId}
ms.member_id = #{memberId} and so.id is not null
<if test="scenicId!= null">and ms.scenic_id = #{scenicId} </if>
<if test="isBuy!=null">and ms.is_buy = #{isBuy} </if>
<if test="type!=null">and ms.type = #{type} </if>
@@ -228,8 +228,9 @@
<select id="countUser" resultType="java.lang.Integer">
select count(1)
from member_source ms
left join source so on ms.source_id = so.id
where
ms.member_id = #{memberId}
ms.member_id = #{memberId} and so.id is not null
<if test="scenicId!= null">and ms.scenic_id = #{scenicId} </if>
<if test="isBuy!=null">and ms.is_buy = #{isBuy} </if>
<if test="type!=null">and ms.type = #{type} </if>