package com.jwipc.tender.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.tender.entity.TenderBid;
import com.jwipc.tender.mapper.TenderBidMapper;
import com.jwipc.tender.model.po.TenderBidListPO;
import com.jwipc.tender.model.query.BidQuery;
import com.jwipc.tender.service.ITenderBidService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 招标单 服务实现类
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-02-29
 */
@Service
public class TenderBidServiceImpl extends ServiceImpl<TenderBidMapper, TenderBid> implements ITenderBidService {

    @Override
    public List<TenderBidListPO> findConfirmJoinList(Page<TenderBidListPO> page, BidQuery query) {
        return this.baseMapper.findConfirmJoinList(page,query);
    }

    @Override
    public List<TenderBidListPO> findSecurityDepositList(Page<TenderBidListPO> page, BidQuery query) {
        return this.baseMapper.findSecurityDepositList(page,query);
    }

    @Override
    public List<TenderBidListPO> findToBeQuotedList(Page<TenderBidListPO> page, BidQuery query) {
        return this.baseMapper.findToBeQuotedList(page,query);
    }

    @Override
    public List<TenderBidListPO> getHistoryList(Page<TenderBidListPO> page, BidQuery query) {
        return this.baseMapper.findHistoryList(page,query);
    }

    @Override
    public void updateConState(Long bidDetailId, Integer state) {
        baseMapper.update(new LambdaUpdateWrapper<TenderBid>().set(TenderBid::getStateTurned,state).eq(TenderBid::getId,bidDetailId));
    }
}
