首页 > 其他 > 详细

mybatis遍历map参数查询

时间:2020-07-09 18:21:33      阅读:205      评论:0      收藏:0      [点我收藏+]
<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>

mybatis遍历map参数查询

原文:https://www.cnblogs.com/sjyBlog/p/13275095.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!