MyBatis参数异常

琐碎 寻梦 5年前 (2019-12-20) 386次浏览 0个评论 扫描二维码

问题 org.apache.ibatis.binding.BindingException: Parameter ‘userName’ not found.

解决:当查询有多参数传入时,每个参数前需要加上@param注解

@Select("select power_content from system where  user_code=#{userCode} and power_name=#{powerName}")
String getPowerContent(@Param("userCode") String userCode,@Param("powerName") String powerName);

喜欢 (0)
[支付宝扫码,感谢支持]
分享 (0)
关于作者:

您必须 登录 才能发表评论!