3 Star 37 Fork 7

change / spring-data-jdbc-mybatis

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
easy-dynamic-sql.md 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
change 提交于 2024-01-31 16:56 . [new]update version

[@and id in idList]

<if test="null!=idList and idList.size>0"> and id in <foreach
collection="idList" index="index" item="item" open="(" separator=","
close=")">#{item}</foreach></if>

[@@and id in idList]

and id in <foreach
collection="idList" index="index" item="item" open="(" separator=","
close=")">#{item}</foreach>

[@and user_name = userName]

<if test="null!=userName and ''!=userName"> 
    and user_name = #{userName} 
</if>

[@and user_name like userName%]

<if test="null!=userName and ''!=userName">
    and user_name like  CONCAT(?,'%')
</if>

[@id column]

-- column
id,code,user_name,mobile_phone,address,create_time

[@and id in #{idList:in} and user_name like #{userName:like}]

<if test="@com.vonchange.mybatis.tpl.MyOgnl@isNotEmpty(idList) and @com.vonchange.mybatis.tpl.MyOgnl@isNotEmpty(userName) "> 
    and id in 
    <foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
    #{item}</foreach> 
    and user_name like  CONCAT('%',#{userName},'%')  
</if>
Java
1
https://gitee.com/vonchange/spring-data-jdbc-mybatis.git
git@gitee.com:vonchange/spring-data-jdbc-mybatis.git
vonchange
spring-data-jdbc-mybatis
spring-data-jdbc-mybatis
master

搜索帮助