订单查询 bug

This commit is contained in:
gong
2025-12-23 13:35:42 +08:00
parent 56ab4d0403
commit 81e102ff41

View File

@@ -19,9 +19,15 @@
<if test="shopId != null">
and o.shop_id = #{shopId}
</if>
<if test="userId != null">
and o.user_id = #{userId} and o.status != 'ing'
</if>
<choose>
<!-- userId为空时拼接 and o.status != 'ing' -->
<when test="userId == null or userId == ''">
and o.status != 'ing'
</when>
<otherwise>
and o.user_id = #{userId}
</otherwise>
</choose>
<if test="param.orderNo != null">
and o.order_no = #{param.orderNo}
</if>