// in的多参数查找,比较常见
<select id="selectSearchAttrIds" resultType="java.lang.Long"> SELECT attr_id FROM `pms_attr` WHERE attr_id IN <foreach collection="attrIds" item="id" separator="," open="(" close=")"> #{id} </foreach> AND search_type = 1 </select>
// 对应的mapper接口【根据多个id进行查询】
List<Long> selectSearchAttrIds(@Param("attrIds") List<Long> attrIds);