package com.cool.store.mapper.order;

import com.cool.store.entity.order.PreAllocationRecordDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface PreAllocationRecordMapper extends Mapper<PreAllocationRecordDO> {

    PreAllocationRecordDO getById(@Param("id") Long id);

    List<PreAllocationRecordDO> queryPageByOrderId(@Param("orderId") Long orderId);

    List<PreAllocationRecordDO> queryPageByShopId(@Param("shopId") Long shopId);

    PreAllocationRecordDO queryPageByShopIdAndExpenseType(Long shopId,String expenseType);

    PreAllocationRecordDO queryPageByPayNo(@Param("payNo") String payNo);

    int updateStatus(@Param("id") Long id, @Param("status") Integer status);

    int deleteByShopId(@Param("shopId") Long shopId);

    int insertBatch(@Param("list") List<PreAllocationRecordDO> list);

    int updateBatch(@Param("list") List<PreAllocationRecordDO> list);

    int batchUpdateEditableFields(@Param("list") List<PreAllocationRecordDO> list);

    int updateByOrderId(Long orderId);

    int deleteByIdsNotPaid(@Param("ids") List<Long> ids);

    Integer updateByPayNoList(@Param("payNoList") List<String> payNoList, @Param("status") Integer status);

    /**
     * 软删除
     */
    int softDeleteById(@Param("id") Long id);

    /**
     * 批量软删除
     */
    int softDeleteByIds(@Param("ids") List<Long> ids);
}
