文章目录
优雅实现模糊搜索
具体代码:
<bind name="patter" value="'%' + articleTitle + '%'"></bind>
and t2.article_title like #{patter}
mybatis query integer 0 null
mybatis查询的时候 如果属性值为0,且属性类型为Integer,那么service拿到对象值得时候会null,如何处理?
- 属性类型改成Long类型
IFNULL( t3.help_value, 0 ) AS "helpValue"
tkmybatis 支持聚合函数等
mybatis generator context报错
元素类型为 "context" 的内容必须匹配 (property*,plugin*,commentGenerator?,jdbcConnection,javaTypeResolver?,javaModelGenerator,sqlMapGenerator?,javaClientGenerator?,table+)
意思就是在xml里,元素要按照顺序来写,比如property
必须在plugin
前面。
拿我刀来…
mybatis动态sql中的trim标签的使用
https://www.cnblogs.com/qiankun-site/p/5758924.html
mybatis大于小于
<![CDATA[ >= ]]>
<![CDATA[ <= ]]>