package cn.superdesk.uniorder.dubbo.provider.marketing;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirt;
import cn.superdesk.uniorder.dto.param.marketing.UnifiedStatisticsVirtParam;
import cn.superdesk.uniorder.dto.param.marketing.UnifiedStatisticsVirtQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade.marketing.DubboUnifiedStatisticsVirtDimMonthService;
import cn.superdesk.uniorder.service.marketing.UnifiedStatisticsVirtDimMonthService;
import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: linjinyu
 * @Email linjinyu@avic-s.com
 * @CreateDate: 2021-09-06 12:00:09
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021-09-06 12:00:09
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboUnifiedStatisticsVirtDimMonthServiceImpl implements DubboUnifiedStatisticsVirtDimMonthService {

	@Autowired
	private UnifiedStatisticsVirtDimMonthService unifiedStatisticsVirtDimMonthService;


	/****************************************** extends BaseService 部分 start ******************************************/

	@Override
	public void addObj(UnifiedStatisticsVirtParam param) {

		UnifiedStatisticsVirt unifiedStatisticsVirt = AnBeanUtils.copy(param, UnifiedStatisticsVirt.class);
		unifiedStatisticsVirtDimMonthService.insertSelective(unifiedStatisticsVirt);

	}

	@Override
	public void updateObj(UnifiedStatisticsVirtParam param) {

		UnifiedStatisticsVirt unifiedStatisticsVirt = AnBeanUtils.copy(param, UnifiedStatisticsVirt.class);
		unifiedStatisticsVirtDimMonthService.updateByPrimaryKeySelective(unifiedStatisticsVirt);
	}

	@Override
	public void deleteObj(Long id) {
		unifiedStatisticsVirtDimMonthService.deleteObj(id);
	}

	@Override
	public UnifiedStatisticsVirt findById(Long id) {
		return unifiedStatisticsVirtDimMonthService.findById(id);
	}

	@Override
	public PageInfo<UnifiedStatisticsVirt> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize) {
		return unifiedStatisticsVirtDimMonthService.findByPaging(conditions, pageNun, pageSize);
	}

	@Override
	public List<UnifiedStatisticsVirt> findAll(Map<String, Object> queryMap) {

		return unifiedStatisticsVirtDimMonthService.findAll(queryMap);
	}

	/****************************************** extends BaseService 部分   end ******************************************/


	@Override
	public void addUnifiedStatisticsVirt(UnifiedStatisticsVirtParam param) {

		UnifiedStatisticsVirt unifiedStatisticsVirt = AnBeanUtils.copy(param, UnifiedStatisticsVirt.class);
		unifiedStatisticsVirtDimMonthService.addUnifiedStatisticsVirt(unifiedStatisticsVirt);
	}

	@Override
	public void updateUnifiedStatisticsVirt(UnifiedStatisticsVirtParam param) {

		UnifiedStatisticsVirt unifiedStatisticsVirt = AnBeanUtils.copy(param, UnifiedStatisticsVirt.class);
		unifiedStatisticsVirtDimMonthService.updateUnifiedStatisticsVirt(unifiedStatisticsVirt);
	}

	@Override
	public void deleteUnifiedStatisticsVirt(Long id) {
		unifiedStatisticsVirtDimMonthService.deleteUnifiedStatisticsVirt(id);
	}

	@Override
	public UnifiedStatisticsVirt findUnifiedStatisticsVirtById(Long id) {
		return unifiedStatisticsVirtDimMonthService.findUnifiedStatisticsVirtById(id);
	}

	@Override
	public R<List<UnifiedStatisticsVirt>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {
		return unifiedStatisticsVirtDimMonthService.pageQuery(conditions, pageNun, pageSize);
	}

	@Override
	public R<List<UnifiedStatisticsVirt>> pageQueryGenericParam(UnifiedStatisticsVirtQueryCriteria criteria) {
		return unifiedStatisticsVirtDimMonthService.pageQueryGenericParam(criteria);
	}

	/****************************************** 统计 start ******************************************/

	@Override
	public List<UnifiedStatisticsVirt> queryVirtOrderStatisticalDimMonth(Map<String, Object> queryMap) {

		return unifiedStatisticsVirtDimMonthService.queryVirtOrderStatisticalDimMonth(queryMap);
	}

	@Override
	public void storeVirtOrderStatisticalDimMonth(UnifiedStatisticsVirt item, Integer year, Integer month) {

		unifiedStatisticsVirtDimMonthService.storeVirtOrderStatisticalDimMonth(item, year, month);
	}
}
