Mybatis sql使用方法

--like 

select * from user where name like CONCAT('%',CONCAT(#{names,jdbcType=VARCHAR},'%' ))

-in 传集合

<select id="name" resultType="xxxxx">
select * from user where ID in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</select>

posted @ 2016-06-29 09:53  大善若龙  阅读(165)  评论(0编辑  收藏  举报