标签:学生 -- zhang list map bsp 技术分享 div hash
一、mybatis传入多个参数:
@Test public void testSearchStudents() { logger.info("根据name和age查询学生"); List<Student> studentList=studentMapper.searchStudent("%zhang%",14); for(Student student:studentList){ logger.info(student); } }
2)StudentMapper.java接口:
//根据多个参数获取student: public List<Student> searchStudent(String name, int age);
3)StudentMapper.xml映射文件:
<!-- 根据多个参数查询学生 --> <select id="searchStudent" resultType="Student"> select * from t_student where name like #{param1} and age=#{param2} </select>
console打印:
标签:学生 -- zhang list map bsp 技术分享 div hash
原文地址:http://www.cnblogs.com/tenWood/p/6676319.html