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>
posted @ 2020-07-09 17:50  sjysu  阅读(458)  评论(0编辑  收藏  举报