linhw 2024-05-28 19:29:35 +08:00
parent 0ba3a1df71
commit 421e8fab9d
1 changed files with 5 additions and 3 deletions

View File

@ -37,9 +37,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN app_user u on u.id = a.user_id
LEFT JOIN app_user au on au.id = a.by_user_id
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="byUserId != null "> and by_user_id = #{byUserId}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="userId != null "> and a.user_id = #{userId}</if>
<if test="username != null "> and u.username like concat('%',#{username},'%')</if>
<if test="byUsername != null "> and au.username like concat('%',#{byUsername},'%')</if>
<if test="byUserId != null "> and a.by_user_id = #{byUserId}</if>
<if test="content != null and content != ''"> and a.content like concat('%',#{content},'%')</if>
</where>
</select>