Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect
Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value:
解决方法
在mybatis 的xml文件中制定数据库字段类型
原来的xml如下
<delete id="deleteByCustomerId" parameterType="java.lang.String">
delete from customer_manage
where customer_id =${customerId}
</delete>
修改为#{}
(需要将mapper里用@param
注解方式传入参数,并添加jdbcType=VARCHAR
<delete id="deleteByCustomerId" parameterType="java.lang.String">
delete from customer_manage
where customer_id =#{customerId, jdbcType=VARCHAR}
</delete>