package com.lightinit.hsdataportal.impl;

import com.lightinit.hsdataportal.mapper.OfflineConferenceMapper;
import com.lightinit.hsdataportal.model.OfflineConferenceListModel;
import com.lightinit.hsdataportal.model.OfflineConferenceSearchModel;
import com.lightinit.hsdataportal.service.IOfflineConferenceService;
import com.lightinit.hsdataportal.spring.DynamicDataContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OfflineConferenceServiceImpl implements IOfflineConferenceService{

    @Autowired
    private OfflineConferenceMapper offlineConferenceMapper ;

    @Override
    public List<OfflineConferenceListModel> queryOpenList(OfflineConferenceSearchModel offlineConferenceSearchModel) {
        DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
        return offlineConferenceMapper.queryOpenList(offlineConferenceSearchModel);
    }

    @Override
    public long queryOpenCount(OfflineConferenceSearchModel offlineConferenceSearchModel) {
        DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
        return offlineConferenceMapper.queryOpenCount(offlineConferenceSearchModel);
    }
}
