![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
mybaits使用了@Param注解为什么仍然拿不到参数? 100
我确定到java层参数已经给到了,但是xml中的sql语句就是拿不到我的传参,永远返回null,而我把#{divisionCode,jdbcType=VARCHAR}写死...
我确定到java层参数已经给到了,但是xml中的sql语句就是拿不到我的传参,永远返回null,而我把#{divisionCode,jdbcType=VARCHAR}写死成一个值又可以返回,求教
展开
1个回答
展开全部
应该这么用
当你使用了使用@Param注解来声明参数时,如果使用 #{} 或 ${} 的方式都可以。
@Select("select column from table where userid = ${userid} ") public int selectColumn(@Param("userid") int userid);
当你使用了使用@Param注解来声明参数时,如果使用 #{} 或 ${} 的方式都可以。
@Select("select column from table where userid = ${userid} ") public int selectColumn(@Param("userid") int userid);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询