mybatis之sql总结
2016-02-25 14:30
183 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Jqing_Chen/article/details/50737472
1.相等的情况
<if test="property!= null and property!= '' ">
and column = #{property}
</if>
2.相似的情况
<if test="property!= null" >
AND column like CONCAT('%',#{property},'%')
</if>
3.CDATA标签内的会被文本解析,如
<if test="property!= null" >
<![CDATA[
and column>= #{property}]]>
</if>
4.时间比较大小
<if test="exeTime != null">
<![CDATA[
and date(exe_time) >= date(#{exeTime})]]>
</if>
相关文章推荐
- mybatis的分页插件pagehelper-fix使用、数据库分页查询模板sql、总结mysql与oracle语句的区别
- mybatis sql相关语句总结
- MyBatis关于映射SQL语句的总结
- mybatis中sql写法技巧小总结
- Mybatis总结(6)---Mybatis动态sql
- MyBatis学习总结(六)---使用log4j2将sql语句执行记录输出控制台和文件中
- Mybatis学习总结之动态SQL与模糊查询
- MyBatis总结-3 动态SQL
- mybatis—简单的sql总结
- MyBatis总结之动态SQL
- Mybatis动态Sql映射标签总结
- MyBatis学习总结(六)——动态SQL
- mybatis文件中SQL总结
- MyBatis学习总结(二)表的关联以及动态SQL
- Mybatis学习总结(五).动态SQL与Mybatis缓存
- mybatis-spring整合总结02_SqlSessionFactoryBean
- MyBatis学习总结(23)——Mybatis打印Sql语句配置
- mybatis工作总结001_mybatis中_parameter使用和常用sql
- 【Mybatis学习总结六】动态SQL与模糊查询
- mybatis xml编写sql,遇到的细节问题总结