package com.artfess.yhxt.contract.manager.impl;

import com.artfess.base.query.PageList;
import com.artfess.base.query.QueryFilter;
import com.artfess.yhxt.contract.model.BillOfQuantities;
import com.artfess.yhxt.contract.dao.BillOfQuantitiesDao;
import com.artfess.yhxt.contract.manager.BillOfQuantitiesManager;
import com.artfess.base.manager.impl.BaseManagerImpl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 工程量清单表 服务实现类
 *
 * @company 阿特菲斯信息技术有限公司
 * @author xzh
 * @since 2021-08-18
 */
@Service
public class BillOfQuantitiesManagerImpl extends BaseManagerImpl<BillOfQuantitiesDao, BillOfQuantities> implements BillOfQuantitiesManager {

    @Override
    public PageList<BillOfQuantities> queryBillOfQuantities(QueryFilter<BillOfQuantities> queryFilter) {
        HashMap<String, Object> map = new HashMap<>();
        Map<String, Object> params = queryFilter.getParams();
        if (params != null) {
            map.putAll(params);
        }
        IPage<BillOfQuantities> result = baseMapper.queryBillOfQuantities(convert2IPage(queryFilter.getPageBean()), map, convert2Wrapper(queryFilter, currentModelClass()));
        //List<Contract> records = result.getRecords();
        return new PageList<>(result);
    }
}
