![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
你李大爷
个人笔记专用
展开
-
mybatis dao.xml用map做参数查询
入参用map,map中嵌套list { "volumeTemplateId": "8085006426363731968", "searchList": [ { "metadataId": "8084978486164398080", "value": "组卷模板字段1-value1" }, { "metadataId": "8084978979217416192",原创 2021-05-24 15:58:00 · 537 阅读 · 0 评论 -
mybatis xml <if>判断字符串相等
mybatis 映射文件中,if标签判断字符串相等,两种方式: 因为mybatis映射文件,是使用的ognl表达式,所以在判断字符串sex变量是否是字符串Y的时候, <if test="sex=='Y'.toString()"> <if test = 'sex== "Y"'> 注意: 不能使用 <if test="sex=='Y'"> and 1=1 </if> 因为mybatis会把’Y’解析为字符,java是强类型语言,所以不能这样写。 ...转载 2021-05-21 16:02:58 · 1766 阅读 · 0 评论 -
Mybatis-dao.xml使用ORDER BY FIELD
ORDER BY FIELD <foreach collection="itemList" item="item" open="(字段," separator="," close=")"> #{item} </foreach>原创 2020-08-21 16:29:19 · 930 阅读 · 1 评论