package com.elephant.framework.galaxy.aroad.module.emergency.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.emergency.dto.TeamEquipmentCoordinateDto;
import com.elephant.framework.galaxy.aroad.module.emergency.entity.EmergencyTeam;
import com.elephant.framework.galaxy.aroad.module.emergency.entity.EmergencyTeamEquipment;
import com.elephant.framework.galaxy.aroad.module.emergency.mapper.EmergencyTeamEquipmentMapper;
import com.elephant.framework.galaxy.aroad.module.emergency.service.EmergencyTeamEquipmentService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 获取队伍装备基础信息
 *
 * @author XingYuyang
 * @date 2019-04-04 11:03:17
 */
@Service
public class EmergencyTeamEquipmentServiceImpl extends ServiceImpl<EmergencyTeamEquipmentMapper, EmergencyTeamEquipment> implements EmergencyTeamEquipmentService {
    /**
     * @Description: 获取队伍装备的坐标信息
     * @Param:
     * @return:
     * @Author: XingYuyang
     * @Date: 2019-04-04 11:11:56
     */
    @Cacheable("teamEquipmentCoordinates")
    public List<TeamEquipmentCoordinateDto> getCoordinates() {
        return baseMapper.getCoordinates();
    }

    @Transactional
    public boolean save(EmergencyTeam emergencyTeam){
        return baseMapper.save(emergencyTeam);
    }

    @Transactional
    public boolean updateWithId(EmergencyTeam emergencyTeam){
        return baseMapper.updateWithId(emergencyTeam);
    }
}
