org.apache.ibatis.binding.BindingException: Parameter '*’ not found. Available parameters are [, param1]
The error may exist in file [C:/**Mapper.xml]
The error may involve top.thegodisgad.user.mapper.UserMapper.insertUser-Inline
The error occurred while setting parameters
错误
SQL:
insert into tb_user(user_id,register_source, user_name, gender,status) values(?,? ?, ?, ? )
报错
Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''123',
1,
' at line 14
<sql id="Base_User_values">
<trim suffixOverrides="," >
<if test="userId!=null">#{userId},</if>
<if test="registerSource!=null">#{registerSource}</if>
<if test="userName!=null and userName!=''">#{userName},</if>
<if test="mobile!=null and mobile!=''">#{mobile},NOW(),</if>
<if test="email!=null and email!=''">#{email},NOW(),</if>
<if test="birthday!=null">#{birthday},</if>
<if test="gender!=null">#{gender},</if>
<if test="headPortrait!=null and headPortrait!=''">#{headPortrait},</if>
<if test="status!=null ">#{status}</if>
</trim>
</sql>
原因
<if test="registerSource!=null">#{registerSource}</if> #差个','
?,? ?,
我怎么会没写!我用的行编辑啊!不应该,不应该,这不应该的!
为啥会在这里呢,
#{CTRL+V},这样的怎么会错,怎么会错,怎么会错,
//真傻逼知道不改 2022年5月22日