package com.hfkj.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

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

    @Select({"<script>" +
            " select order_no,response_code,response_msg,response_content,create_time from bs_mer_contract_record_msg" +
            " where order_no = (SELECT order_no FROM `bs_mer_contract_record` where mer_id = #{merId} <if test='platformType != null'> and platform_type = #{platformType} </if> ORDER BY create_time desc LIMIT 1)" +
            " and response_code = 'REJECT' " +
            " ORDER BY create_time desc LIMIT 1" +
            " </script>"})
    Map<String, Object> selectMerContractRecordMsg(@Param("merId") Long merId, @Param("platformType") Integer platformType);

}
