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.apache.ibatis.annotations.Update;
import org.ta.pddserver.entity.LogOrderEntity;

@Mapper
public interface LogOrderMapper extends BaseMapper<LogOrderEntity> {
    @Update("UPDATE `log_order` SET `packageQuantity` = ${packageQuantity} WHERE `logisticsOrderCode` = #{logisticsOrderCode};")
    Boolean savePackageQuantity(@Param("logisticsOrderCode") String logisticsOrderCode, @Param("packageQuantity") long packageQuantity);

    @Select("SELECT * FROM `log_order` WHERE `logisticsOrderCode` = #{logisticsOrderCode};")
    LogOrderEntity selectByOrderCode(String logisticsOrderCode);

    @Update("UPDATE `log_order` SET `status` = #{status} WHERE `uid` = #{uid};")
    int updateOrderStatusById(int status, String uid);
}
