一直都是注册失败,原因为未知错误

来源:3-11 用户模型管理--用户注册功能实现02

qq_Tzz_0

2019-04-18 23:37

错误代码 sql语句错误

### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '' at line 1

### The error may involve com.miaoshaproject.dao.UserDOMapper.insertSelective-Inline

### The error occurred while setting parameters

### SQL: insert into user_info

### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '' at line 1




https://img1.mukewang.com/5cb898c30001d17015380067.jpg

https://img.mukewang.com/5cb898c300016d7512100553.jpg


<insert id="insert" parameterType="com.miaoshaproject.dataobject.UserDO">
  <!--
    WARNING - @mbg.generated
    This element is automatically generated by MyBatis Generator, do not modify.
    This element was generated on Wed Apr 17 16:27:48 CST 2019.
  -->
  insert into user_info (id, name, gender, 
    age, talphone, register_mode, 
    third_party_id)
  values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT},
    #{age,jdbcType=INTEGER}, #{talphone,jdbcType=VARCHAR}, #{registerMode,jdbcType=VARCHAR},
    #{thirdPartyId,jdbcType=VARCHAR})
</insert>




<insert id="insertSelective" parameterType="com.miaoshaproject.dataobject.UserDO" keyProperty="id" useGeneratedKeys="true">
  <!--
    WARNING - @mbg.generated
    This element is automatically generated by MyBatis Generator, do not modify.
    This element was generated on Wed Apr 17 16:27:48 CST 2019.
  -->
insert into user_info
  <trim prefix="(" suffix=")" suffixOverrides=",">
    <if test="id != null">
      id,
    </if>
    <if test="name != null">
      name,
    </if>
    <if test="gender != null">
      gender,
    </if>
    <if test="age != null">
      age,
    </if>
    <if test="talphone != null">
      talphone,
    </if>
    <if test="registerMode != null">
      register_mode,
    </if>
    <if test="thirdPartyId != null">
      third_party_id,
    </if>
  </trim>
  <trim prefix="values (" suffix=")" suffixOverrides=",">
    <if test="id != null">
      #{id,jdbcType=INTEGER},
    </if>
    <if test="name != null">
      #{name,jdbcType=VARCHAR},
    </if>
    <if test="gender != null">
      #{gender,jdbcType=TINYINT},
    </if>
    <if test="age != null">
      #{age,jdbcType=INTEGER},
    </if>
    <if test="talphone != null">
      #{talphone,jdbcType=VARCHAR},
    </if>
    <if test="registerMode != null">
      #{registerMode,jdbcType=VARCHAR},
    </if>
    <if test="thirdPartyId != null">
      #{thirdPartyId,jdbcType=VARCHAR},
    </if>
  </trim>
</insert>

字段名都正确

写回答 关注

4回答

  • qq_慕瓜1151558
    2020-08-06 23:19:50

    怎么解决的啊?分享以下啊

  • 卡卡东
    2020-03-07 22:58:36

    求助怎么解决呀

  • 慕村1059658
    2019-04-24 10:56:06

    怎么解决的?我也有这个问题

    雨啊 回复qq_Tzz...

    在哪个文件里

    2020-01-02 19:50:33

    共 3 条回复 >

  • qq_Tzz_0
    2019-04-19 12:30:54

    已解决

SpringBoot构建电商基础秒杀项目

应用SpringBoot快速搭建拥有用户、商品、交易及秒杀活动的电商秒杀应用。

49543 学习 · 978 问题

查看课程

相似问题