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 getInfoByOrderCode(@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 getByOrderCode(@Param("orderCode") String orderCode);
}
