<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.czg.service.account.mapper.PointsExchangeRecordMapper">

    <update id="authCancel">
        update tb_points_exchange_record
        set status                  = 'cancel',
            cancel_or_refund_time   = now(),
            cancel_or_refund_reason = '超时未支付，系统自动取消订单'
        where status = 'unpaid'
          and TIMESTAMPDIFF(MINUTE, create_time, NOW()) >= 5
    </update>
</mapper>