1、查询select
需求是,传入List,返回是List
在查询时,传入参数是实体类的List,使用foreach
例如mapper interface 里是
public List<RoutingRulesSetDto> selectByIds(@Param("routings") List<RoutingRulesSetDto> routings);
2、在xml里这样写
<select id="selectByIds" resultType="实体类" parameterType="java.lang.String">
<![CDATA[
SELECT *
FROM Test RRS
WHERE 1=1
]]>
<if test="routings != null and routings.size() > 0">
<foreach collection="routings" item="item" index="index" open="and (" close=")" separator=" or ">
RRS.ID = #{item.id,jdbcType=VARCHAR}
</foreach>
</if>
</select>