mybatis遍历map参数查询

<select id="selectByPage" parameterType="java.util.Map" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM set_up_policy
<trim prefix="WHERE" prefixOverrides="and|or">
<if test="companys !=null and companys !=''">
<foreach collection="companys" index="index" item="item" open="("
separator="or" close=")">
company like concat(concat('%',#{item}),'%')
</foreach>
</if >
<if test="route_eliminate !=null and route_eliminate !=''">
and route_eliminate=#{route_eliminate}
</if >
<if test="status !=null">
and status=#{status}
</if >
<if test="issue_type !=null and issue_type !=''">
and issue_type like concat(concat('%',#{issue_type}),'%')
</if >
</trim>
</select>
原文地址:https://www.cnblogs.com/sjyBlog/p/13275095.html