<insert id="insertLoanRecord" parameterType="loanRecord"> INSERT INTO loan_record ( serial_number, user_id, loan_id, bank_id, bank_province_id, apply_amount, apply_time, status, update_time, passed_time, repay_deadline, description ) VALUES ( #{serialNumber}, #{userId}, #{loanId}, #{bankId}, #{bankProvinceId}, #{applyAmount}, now(), #{status}, now(), null, #{repayDeadline}, #{desc} ) </insert>
代码中,以前没有加passed_time这个字段,而后加进去以后,就会报passed_time字段不能默认为空的sql异常,在此记下,以防以后遗忘。sql