表中存在类型为dateTime的字段,而且插入语句,不包括该字段时,会插入失败

<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

相关文章
相关标签/搜索