package com.dcit.danger.service.impl;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dcit.danger.dao.EnterpriseBasicInfoMapper;
import com.dcit.danger.dto.EnterpriseDangerNumDTO;
import com.dcit.danger.dto.EnterpriseRegDTO;
import com.dcit.danger.dto.query.EnterpriseInfoQuery;
import com.dcit.danger.model.EnterpriseBasicInfo;
import com.dcit.danger.model.EnterpriseBasicInfoExample;
import com.dcit.danger.service.EnterpriseInfoService;

@Service
public class EnterpriseInfoServiceImpl implements EnterpriseInfoService {
	
	@Autowired
	private EnterpriseBasicInfoMapper enterpriseBasicInfoMapper;

	@Override
	public List<EnterpriseBasicInfo> selectEnterpriseInfoByExample(
			EnterpriseBasicInfoExample enterpriseBasicInfoExample) {
		// TODO Auto-generated method stub
		return enterpriseBasicInfoMapper.selectByExample(enterpriseBasicInfoExample);
	}

	@Override
	public int addEnterpriseInfo(EnterpriseBasicInfo enterpriseBasicInfo) {
		// TODO Auto-generated method stub
		return enterpriseBasicInfoMapper.insertSelective(enterpriseBasicInfo);
	}

	@Override
	public int updateEnterpriseInfoById(EnterpriseBasicInfo enterpriseBasicInfo) {
		// TODO Auto-generated method stub
		return enterpriseBasicInfoMapper.updateByPrimaryKeySelective(enterpriseBasicInfo);
	}

	@Override
	public int deleteEnterpriseInfoById(String id) {
		// TODO Auto-generated method stub
		return enterpriseBasicInfoMapper.deleteByPrimaryKey(id);
	}

	@Override
	public EnterpriseBasicInfo selectEnterpriseInfoById(String id) {
		// TODO Auto-generated method stub
		return enterpriseBasicInfoMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<EnterpriseRegDTO> selectEnterpriseRegInfo(EnterpriseInfoQuery enterpriseInfoQuery) {
		// TODO Auto-generated method stub
		return enterpriseBasicInfoMapper.selectEnterpriseRegInfo(enterpriseInfoQuery);
	}

	@Override
	public EnterpriseRegDTO selectEnterpriseRegInfoById(String enterpriseId) {
		// TODO Auto-generated method stub
		return enterpriseBasicInfoMapper.selectEnterpriseRegInfoById(enterpriseId);
	}

	@Override
	public List<EnterpriseDangerNumDTO> selectEnterpriseDangerNum(String enterpriseId) {
		// TODO Auto-generated method stub
		return enterpriseBasicInfoMapper.selectEnterpriseDangerNum(enterpriseId);
	}

	@Override
	public List<Map<Object, Object>> countByRegulation() {
		return enterpriseBasicInfoMapper.countByRegulation();
	}

}
