package com.winsun.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.winsun.bean.YxtOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 〈院线通订单Mapper〉
 *
 * @author PXL
 * @create 2020/5/7 16:22
 */
@Mapper
@Component
public interface YxtOrderMapper extends BaseMapper<YxtOrder> {

    @Select("select cardT.*,date_format(validity_period,'%Y-%m-%d') validity_date from yx_yxt_order orderT,yx_yxt_order_detail detailT,yx_yxt_card cardT where orderT.order_num = #{orderNumber} and orderT.id = detailT.order_id and detailT.yxt_id = cardT.id and orderT.state = 2 ")
    List<Map<String,Object>> getCardByNumber(@Param("orderNumber") String orderNumber);
}
