Cause: java.sql.SQLException: Column count doesn't match value count at row 1

异常:Cause: java.sql.SQLException: Column count doesn't match value count at row 1

原因:sql异常,字段列与值列数目或类型不匹配导致。

出现:mapper配置文件中,sql编写错误。

解决:核查sql,排除。

出错SQL:

  

      INSERT INTO delivery_mail_log
        (customer_id,mail_type,mail_title,mail_content,send_time,message,status,yn,ts,create_time,create_pin,update_pin)
        VALUES (
        #{customerId,jdbcType=BIGINT},#{mailType,jdbcType=VARCHAR},#{mailTitle,jdbcType=VARCHAR},
        #{mailContent,jdbcType=VARCHAR},#{sendTime,jdbcType=TIMESTAMP},#{message,jdbcType=VARCHAR},
        #{status,jdbcType=INTEGER},now(),now(),'system','system'
        )

修改SQL:

      INSERT INTO delivery_mail_log
        (customer_id,mail_type,mail_title,mail_content,send_time,message,status,yn,ts,create_time,create_pin,update_pin)
        VALUES (
        #{customerId,jdbcType=BIGINT},#{mailType,jdbcType=VARCHAR},#{mailTitle,jdbcType=VARCHAR},
        #{mailContent,jdbcType=VARCHAR},#{sendTime,jdbcType=TIMESTAMP},#{message,jdbcType=VARCHAR},
        #{status,jdbcType=INTEGER},0,now(),now(),'system','system'
        )


你可能感兴趣的:(work_exceptions)