package com.lightinit.hsdataplatform.impl.admin;

import com.lightinit.hsdataplatform.mapper.OrderMapper;
import com.lightinit.hsdataplatform.model.admin.DownstreamListModel;
import com.lightinit.hsdataplatform.model.admin.DownstreamSearchModel;
import com.lightinit.hsdataplatform.service.admin.IDownstreamService;
import com.lightinit.hsdataplatform.spring.DynamicDataContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DownstreamServiceImpl implements IDownstreamService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public List<DownstreamListModel> queryList(DownstreamSearchModel inputModel) {
        DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
        return orderMapper.queryList(inputModel);
    }

    @Override
    public long queryCount(DownstreamSearchModel inputModel) {
        DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
        return orderMapper.queryCount(inputModel);
    }
}
