- 49
- 0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qtay.gls.dao.TeacherLabelDao">
<sql id="key">
<trim suffixOverrides=",">
<if test="item.id!=null">
id,
</if>
<if test="item.teacherId != null">
teacher_id,
</if>
<if test="item.name!=null">
name,
</if>
</trim>
</sql>
<sql id="value">
<trim suffixOverrides=",">
<if test="item.id!=null">
#{item.id},
</if>
<if test="item.teacherId!=null">
#{item.teacherId},
</if>
<if test="item.name!=null">
#{item.name},
</if>
</trim>
</sql>
<insert id="saveTeacherLabels" keyProperty="id" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" separator=";">
insert into teacher_labels(<include refid="key"/>) values(<include refid="value"/>)
</foreach>
</insert>
</mapper>
### 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 'insert into teacher_labels(
id,
' at line 19
### The error may involve com.qtay.gls.dao.TeacherLabelDao.saveTeacherLabels-Inline
### The error occurred while setting parameters
### SQL: insert into teacher_labels( id, teacher_id, name ) values( ?, ?, ? ) ; insert into teacher_labels( id, teacher_id, name ) values( ?, ?, ? )
### 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 'insert into teacher_labels(
id,
' at line 19
; bad SQL grammar []; nested exception is 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 'insert into teacher_labels(
id,
' at line 19, path=/teacher/save}] as "application/json;charset=utf-8" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@39023dbf]
2017-11-20 14:22:55.547 DEBUG [http-nio-9090-exec-4] o.s.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
2017-11-20 14:22:55.547 DEBUG [http-nio-9090-exec-4] o.s.web.servlet.DispatcherServlet - Successfully completed request
只单个添加一条数据是正确的,当添加2个及以上就报上面的错,请问如何解决?
0
打赏
收藏
点击回答
网站公告
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部
