com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect integer value: '' for column 'n_before_group_id' at row 1
mybatis foreach 插入时出现这个报错,原因是某字段插入空值时需要插入NULl而不是‘’
解决办法:
<choose> <when test="item.xxx == null || item.xxx == ''"> NULL, </when> <otherwise> #{item.xxx}, </otherwise> </choose>
- 39 truncation Incorrect mybatis integer39 truncation incorrect mybatis truncated incorrect double value truncated incorrect insert double 39 incorrect nick_name string business_license_url 39 incorrect business mysqldatatruncation 39 exceptions truncation mybatis integer类型 动态 mybatis integer类型 结果 等价mybatis integer类型 空字符mybatis integer类型