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.CollectReceiverDetailEntity;
import org.ta.pddserver.model.api.response.CollectReceiverDetailResponse;

@Mapper
public interface CollectReceiverDetailMapper extends BaseMapper<CollectReceiverDetailEntity> {
    @Select("SELECT  * FROM `collect_order_receiver_detail` WHERE `orderCode`  = #{orderCode} AND `state` > 0")
    CollectReceiverDetailEntity findByOrderCode(@Param("orderCode") String orderCode);

    @Select("SELECT `uid`, `name`, `idNumber`, `telePhone`, `country`, `province`, `city`, `district`, `detailAddress`, `postCode` FROM `collect_order_receiver_detail` WHERE `orderCode`  = #{orderCode} AND `state` > 0")
    CollectReceiverDetailResponse findInfoByOrderCode(@Param("orderCode") String orderCode);
}
