package com.hai.dao;

import com.hai.entity.ApiOrderRecord;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

/**
 * mapper扩展类
 */
public interface ApiOrderRecordMapperExt {

    @Select({"SELECT * FROM api_order_record aor WHERE TIMESTAMPDIFF(MINUTE,aor.request_time,SYSDATE()) < 15 AND aor.status = 100"})
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
            @Result(column="mch_id", property="mchId", jdbcType=JdbcType.VARCHAR),
            @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
            @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
            @Result(column="source_order_no", property="sourceOrderNo", jdbcType=JdbcType.VARCHAR),
            @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.VARCHAR),
            @Result(column="notify_url", property="notifyUrl", jdbcType=JdbcType.VARCHAR),
            @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
            @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
            @Result(column="request_time", property="requestTime", jdbcType=JdbcType.TIMESTAMP),
            @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
            @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
            @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
            @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
            @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
            @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    List<ApiOrderRecord> callBackOrderList();
}
