package com.steerinfo.baseinfo.meterbasematterunit.service.impl;

import com.steerinfo.baseinfo.meterbasecustomersupplier.mapper.MeterBaseCustomerSupplierMapper;
import com.steerinfo.baseinfo.meterbasecustomersupplier.model.MeterBaseCustomerSupplier;
import com.steerinfo.baseinfo.meterbasematterinfo.mapper.MeterBaseMatterInfoMapper;
import com.steerinfo.baseinfo.meterbasematterinfo.model.MeterBaseMatterInfo;
import com.steerinfo.framework.mapper.IBaseMapper;
import com.steerinfo.framework.service.impl.BaseServiceImpl;
import com.steerinfo.baseinfo.meterbasematterunit.model.MeterBaseMatterUnit;
import com.steerinfo.baseinfo.meterbasematterunit.mapper.MeterBaseMatterUnitMapper;
import com.steerinfo.baseinfo.meterbasematterunit.service.IMeterBaseMatterUnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

/**
 * MeterBaseMatterUnit服务实现：
 * @author generator
 * @version 1.0-SNAPSHORT 2023-03-29 03:00
 * 类描述
 * 修订历史：
 * 日期：2023-03-29
 * 作者：generator
 * 参考：
 * 描述：MeterBaseMatterUnit服务实现
 * @see null
 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
 */
@Service(value = "meterBaseMatterUnitService")
public class MeterBaseMatterUnitServiceImpl extends BaseServiceImpl<MeterBaseMatterUnit, String> implements IMeterBaseMatterUnitService {

    @Autowired
    private MeterBaseMatterUnitMapper meterBaseMatterUnitMapper;

    @Resource
    private MeterBaseMatterInfoMapper meterBaseMatterInfoMapper;

    @Resource
    private MeterBaseCustomerSupplierMapper meterBaseCustomerSupplierMapper;

    @Override
    protected IBaseMapper<MeterBaseMatterUnit, String> getMapper() {
        return meterBaseMatterUnitMapper;
    }

    @Override
    public List<MeterBaseMatterInfo> getMatterInfo(HashMap map) {
        if(map==null){
            map=new HashMap();
        }
        map.put("validFlag","1");
        List<MeterBaseMatterInfo> list = meterBaseMatterInfoMapper.selectByParametersOrder(map);
        return list;
    }

    @Override
    public List<MeterBaseCustomerSupplier> getCustomerSupplier(HashMap map) {
        if(map==null){
            map=new HashMap();
        }
        map.put("validFlag","1");
        List<MeterBaseCustomerSupplier> list = meterBaseCustomerSupplierMapper.selectByParametersOrder(map);
        return list;
    }
}
