package com.zfire.mall.manager.datasource.engin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zfire.mall.manager.datasource.engin.entity.AgencyBills;
import com.zfire.mall.manager.datasource.engin.entity.Machine4Agency;
import com.zfire.mall.manager.plus.entity.DepositManage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

@Mapper
public interface AgencyBillsMapper extends BaseMapper<AgencyBills> {

    IPage<AgencyBills> queryAllowAgencyBills(Page<Object> objectPage,
                                             @Param("subOrganizationList") List<Integer> subOrganizationList,
                                             @Param("recordNo") String recordNo,
                                             @Param("projectName") String projectName,
                                             @Param("useUnit") String useUnit);

    AgencyBills findBills(@Param("recordNo") String recordNo, @Param("userId") String userId);

    List<Machine4Agency> machine4AgencyList(@Param("billsId")long billsId);

    List<Integer> findOrganizationByUserIds(@Param("userIds") List<Integer> userIds);

    List<Integer> findSubOrganization(@Param("ids") List<Integer> ids);


    void updateAgencyBillsStatus(@Param("userId") String userId, @Param("recordNo") String recordNo);

    void depositConfirmUpdateAgencyBills(@Param("depositManage") DepositManage depositManage);

    List<AgencyBills> queryBills(@Param("bills") Collection<String> bills);

    AgencyBills findAgencyBillsByRecordNo(@Param("refEnginRecordNo") String refEnginRecordNo);

}
