Mybatis錯誤:Parameter 'XXX' not found. Available parameters are [1, 0, param1, param2]
原因:傳遞的參數超過一個
記
解決辦法:
(1)直接把值改成數字
<select id="LoginUser" parameterType="String" resultMap="userMap">
SELECT * FROM user where emplnumb = #{0} and password=#{1}
</select>
(2)在變量上加注解@Param
Public User selectUser(@param(“userName”) String name,@param (“userpassword”)
public List<user> getUserInformation(@Param("user") User user);
