package org.springblade.activity.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springblade.activity.dto.vo.ForeignUnsubscribeKcVO;

/**
 * <p>
 * 活动管理表 Mapper 接口
 * </p>
 *
 * @author zbc
 * @since 2021-04-21
 */
public interface ForeignApiMapper {

	@Select("SELECT\n" +
		"\t MONTH_ID AS MONTH,\n" +
		"\t DEVICE_NUMBER AS phone,\n" +
		"\t CPID_REC_1 AS cpid1,\n" +
		"\t CPID_REC_2 AS cpid2,\n" +
		"\t CPID_REC_3 AS cpid3 \n" +
		"FROM\n" +
		"\t ads.ADS_ORDER_RECOMMEND_RESULT \n" +
		"WHERE\n" +
		"\t DEVICE_NUMBER = #{phone} ORDER BY MONTH DESC limit 1")
	ForeignUnsubscribeKcVO getDetailByPhone(@Param("phone") String phone);

}
