------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 实体类 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
方法1:顺序传参法 public User selectUser(String name, int deptId); <select id="selectUser" resultMap="UserResultMap"> select * from user where user_name = #{0} and dept_id = #{1} </select> #{}里面的数字代表你传入参数的顺序. 这种方法不建议使用,sql层表达不直观,且一
如果有一个查询参数有多个,用一个List集合传进去,这个mapper文件可以这么写 <select id="queryList04" resultType="map" parameterType="java.util.List"> select CEZJRC_TXLJ,CEZJRC_XM,CEZJRC_ZY,CEZJRC_ZC from NRJRENCAI where CEZJRC_BM in <foreach collecti
在Mybatis多条件查询中: 1.参数如果是多条件,则需要将将添加到Map集合中进行传入. 2.就是将其参数用有序数字进行代替. Mybatis单个String类型参数传递 mysql文如下,传入参数为‘parentCategoryId’,运行报错为:There is no getter for property named 'parentCategoryId' in 'class java.lang.String <select id="selectCategoryList"