一、传参问题(仅推荐我常用的)
-
单个参数
1、参数是一个自己写的对象
必须要加上一个注解@Param,举例如下:
void regStudent(@Param("student") Student student);
2、其他的单个参数,可不用添加注解,举例如下:
void test(String name);
-
多个参数
网上随便搜一搜,有好几种方法,对我个人而言,我觉得这种方法挺好用的, 举例如下:
void regStudent(@Param("name") String name, @Param("age") Integer age);