|
|
@@ -37,17 +37,14 @@
|
|
|
from t_user_message
|
|
|
where user_id = #{userId}
|
|
|
and order_id = #{orderId}
|
|
|
- <if test="type != null">
|
|
|
- <choose>
|
|
|
- <!-- type=1/3 → 同时匹配 1 或 3 -->
|
|
|
- <when test="type in (1, 3)">
|
|
|
- and type in (1, 3)
|
|
|
- </when>
|
|
|
- <!-- type=2/4/10/11 → 只匹配自身 -->
|
|
|
- <when test="type in (2, 4, 10, 11)">
|
|
|
- and type = #{type}
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
+ <if test="type == 1 or type == 3">
|
|
|
+ and (type = 1 or type = 3)
|
|
|
+ </if>
|
|
|
+ <if test="type == 2 or type == 4">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="type == 10 or type == 11 ">
|
|
|
+ and type = #{type}
|
|
|
</if>
|
|
|
</select>
|
|
|
|