<insert id="addOrderSatisFaction" parameterType="java.util.List">
INSERT INTO APP_SATISFACTION (ORDERNO, USERNAME, USERNO, ADDTIME, SATISFACTIONGRADE, SATISFACTIONTITLE, REMARKS)
<foreach collection="list" item="item" index="index" separator="union all" >
(select
#{item.orderno,jdbcType=VARCHAR},
#{item.username,jdbcType=VARCHAR},
#{item.userno,jdbcType=VARCHAR},
#{item.addtime,jdbcType=TIMESTAMP},
#{item.satisfactiongrade,jdbcType=VARCHAR},
#{item.satisfactiontitle,jdbcType=VARCHAR},
#{item.remarks,jdbcType=VARCHAR}
from dual)
</foreach>
</insert >
报错:
### Error updating database. Cause: java.sql.SQLException: ORA-00926: 缺失 VALUES 关键字
### The error may involve com.cn.ssm.dao.OrderSatisFactionDao.addOrderSatisFaction-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO APP_SATISFACTION (ORDERNO, USERNAME, USERNO, ADDTIME, SATISFACTIONGRADE, SATISFACTIONTITLE, REMARKS)
### Cause: java.sql.SQLException: ORA-00926: 缺失 VALUES 关键字
; bad SQL grammar []; nested exception is java.sql.SQLException: ORA-00926: 缺失 VALUES 关键字
INSERT INTO APP_SATISFACTION (ORDERNO, USERNAME, USERNO, ADDTIME, SATISFACTIONGRADE, SATISFACTIONTITLE, REMARKS)
<foreach collection="list" item="item" index="index" separator="union all" >
(select
#{item.orderno,jdbcType=VARCHAR},
#{item.username,jdbcType=VARCHAR},
#{item.userno,jdbcType=VARCHAR},
#{item.addtime,jdbcType=TIMESTAMP},
#{item.satisfactiongrade,jdbcType=VARCHAR},
#{item.satisfactiontitle,jdbcType=VARCHAR},
#{item.remarks,jdbcType=VARCHAR}
from dual)
</foreach>
</insert >
报错:
### Error updating database. Cause: java.sql.SQLException: ORA-00926: 缺失 VALUES 关键字
### The error may involve com.cn.ssm.dao.OrderSatisFactionDao.addOrderSatisFaction-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO APP_SATISFACTION (ORDERNO, USERNAME, USERNO, ADDTIME, SATISFACTIONGRADE, SATISFACTIONTITLE, REMARKS)
### Cause: java.sql.SQLException: ORA-00926: 缺失 VALUES 关键字
; bad SQL grammar []; nested exception is java.sql.SQLException: ORA-00926: 缺失 VALUES 关键字