package services

import (
	"gin-vue-admin/common"
	"gin-vue-admin/repository"
)

func DeviceSum(phone, t string, deviceID int) (interface{}, error) {

	db, err := common.NewCommonConn()
	if err != nil {
		return nil, err
	}

	return repository.DeviceSum(db, t, deviceID)
}

func DeviceCollectionAnalysis(phone, t string, deviceID int) (interface{}, error) {

	db, err := common.NewCommonConn()
	if err != nil {
		return nil, err
	}

	return repository.DeviceCollectionAnalysisRes(db, t, deviceID)
}

func DeviceCollectionDistribution(phone, t string, deviceID int) (interface{}, error) {

	db, err := common.NewCommonConn()
	if err != nil {
		return nil, err
	}

	return repository.DeviceCollectionDistributionRes(db, t, deviceID)
}

func DeviceHospitalRank(phone, t string, deviceID int) (interface{}, error) {

	db, err := common.NewCommonConn()
	if err != nil {
		return nil, err
	}

	return repository.DeviceHospitalRank(db, t, deviceID)
}

func DeviceHospitalRankDetail(phone, t, hospitalName string, deviceID int) (interface{}, error) {

	db, err := common.NewCommonConn()
	if err != nil {
		return nil, err
	}

	return repository.DeviceHospitalRankDetail(db, t, hospitalName, deviceID)
}
