@Param()注解

*基本类型的参数或者String类型,需要加上
*引用类型不需要加
*如果只有一个基本类型,可以忽略,但建议加上

@Select("SELECT * from Table where id = ${id}")
 Enchashment selectUserById(User user);

*在SQL中引用的就是@Param()中设定的属性名

@Select("select column from table where userid = ${userid} ")
    public int selectColumn(@Param("userid") int userid);

posted @ 2021-10-04 21:49  micer  阅读(125)  评论(0)    收藏  举报