mysql in 多个字段

SELECT * FROM your_table WHERE (field1, field2) IN (('value1', 'value2'), ('value3', 'value4'), ('value5', 'value6'));

 

<if test="ids!=null and  ids.size>0 ">
and (m.object_id,m.object_type) in
<foreach item="item" index="index" collection="ids"
open="(" separator="," close=")">
(#{item.objId},#{item.objType})
</foreach>
</if>
posted @ 2023-12-12 17:03  八英里  阅读(83)  评论(0编辑  收藏  举报