package org.ta.pddserver.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.ta.pddserver.entity.CollectOutMailDetailEntity;
import org.ta.pddserver.model.api.response.CollectOutMailDetailResponse;

import java.util.List;

@Mapper
public interface CollectOutMailDetailMapper extends BaseMapper<CollectOutMailDetailEntity> {

    @Select("SELECT * FROM `collect_out_mail_detail` WHERE `mailNo` = #{mailNo} AND `state` > 0")
    CollectOutMailDetailEntity getInfoByMailNo(@Param("mailNo") String mailNo);

    @Select("SELECT * FROM `collect_out_mail_detail` WHERE `orderCode` = #{orderCode} AND `state` > 0")
    List<CollectOutMailDetailResponse> getListByOrderCode(@Param("orderCode") String orderCode);
}
