摘要: <!--顾客信息表,其中一个顾客对应一个国家,一个顾客对应多个订单--> <resultMap id="customerResultMap" type="com.mc.dto.Customer"> <id column="ID" property="id"> <result column="CUS_ 阅读全文
posted @ 2017-06-21 23:48 LiuChunfu 阅读(547) 评论(0) 推荐(0) 编辑
摘要: 直接上代码,关键需要进行2个判定,一个是null判定,一个是 ‘’ 判定。 <where> <if test="url!= null and url!=''"> url LIKE #{url} </if> </where> 直接上代码,关键需要进行2个判定,一个是null判定,一个是 ‘’ 判定。 阅读全文
posted @ 2017-06-21 23:47 LiuChunfu 阅读(7432) 评论(1) 推荐(0) 编辑
摘要: 零、引言使用 #{name} 的时候,MyBatis会进行预编译,防止SQL注入的问题(官方话)用一个通俗一点的例子来解释,比如有如下MyBatis的SQL语句21、#{}和${}的区别.png一、最正确的用法xxxxxxxxxx3 1说明:如果name的类型为String值为LCF,columnName的类型为String值为 id上述SQL翻译结果是:... where name = 'LCF... 阅读全文
posted @ 2017-06-21 23:46 LiuChunfu 阅读(465) 评论(0) 推荐(0) 编辑