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

import java.util.List;

@Mapper
public interface LogOrderItemMapper extends BaseMapper<LogOrderItemEntity> {

    @Select("SELECT `itemName`, `categoryName`, `totalActualPayment`,`currencyUnit`, `currency`, `itemQuantity`, `itemPicUrl`,`itemSkuProperty`,`chargedStatus`,`goodsType`,`magneticStatus` FROM `log_order_item` WHERE  `logisticsOrderCode` = #{logisticsOrderCode}")
    List<LogOrderItemResponse> getListByLogisticsOrderCode(@Param("logisticsOrderCode") String logisticsOrderCode);

    @Select("SELECT * FROM `log_order_item` WHERE `logisticsOrderCode` = #{logisticsOrderCode};")
    List<LogOrderItemEntity> getListByOrderCode(String logisticsOrderCode);
}
