最近在项目使用mybatis中碰到个问题 <if test="type=='y'"> and status = 0 </if> 当传入的type的值为y的时候,if判断内的sql也不会执行,抱着这个疑问就去看了mybatis是怎么解析sql的.下面我们一起来看一下mybatis 的执行过程. DefaultSqlSession.class 121行 public void select(String statement, Object parameter, R
在Mybatis多条件查询中: 1.参数如果是多条件,则需要将将添加到Map集合中进行传入. 2.就是将其参数用有序数字进行代替. Mybatis单个String类型参数传递 mysql文如下,传入参数为‘parentCategoryId’,运行报错为:There is no getter for property named 'parentCategoryId' in 'class java.lang.String <select id="selectCategoryList"
------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 实体类 public class Book { private Integer bookID; private String bookName; private String bookAuthor; private Integer bookPrice; public Book() { } public Integer getBookID() { return this.bookID; } public vo