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.pdd.entity.TraceObjectEntity;

import java.util.List;

@Mapper
public interface TraceObjectMapper extends BaseMapper<TraceObjectEntity> {
    // 根据用户名查找用户
    @Select("SELECT * FROM `trace_object` WHERE `trackingNumber` = #{trackingNumber} AND `state` > 0;")
    List<TraceObjectEntity> selectByTrackingNumber(String trackingNumber);

    @Select("SELECT * FROM `trace_object` WHERE `trackingOrderNo` = #{orderNo} AND `state` > 0;")
    List<TraceObjectEntity> findByTrackOrderNo(@Param("orderNo") String orderNo);
}
