package cn.service.atv.impl;

import org.springframework.stereotype.Service;
import cn.service.atv.IAtvTrainService;
import cn.facade.abs.IService;
import java.util.HashMap;
import java.util.Map;

@Service
public class AtvTrainServiceImpl extends IService implements IAtvTrainService
{
	/**
	 * 更新车辆在线状态
	 * @param countryCode  国家编号
	 * @param areaCode     地区编号
	 * @param lineSn       线路编号
	 * @param trainSn      车辆编号
	 * @param onlineStatus 车辆在线状态
	 */
	@Override
	public void trainOnlineStatus(String countryCode, String areaCode, String lineSn, String trainSn, Integer onlineStatus)
	{
		Map<String, Object> paramsMap = new HashMap<>();
		paramsMap.put("trainSn",trainSn);
		paramsMap.put("lineSn",lineSn);
		paramsMap.put("areaCode",areaCode);
		paramsMap.put("countryCode",countryCode);
		paramsMap.put("onlineStatus",onlineStatus);
		//atvTrainMapper.trainOnlineStatus(countryCode, areaCode, lineSn, trainSn, onlineStatus);
		daoService.executeSql("atv_trainOnlineStatus",paramsMap);
		if (onlineStatus == 2) {
			//void equipmentOnlineStatus(@Param("countryCode") String countryCode, @Param("areaCode") String areaCode, @Param("lineSn") String lineSn, @Param("trainSn") String trainSn, @Param("onlineStatus") Integer onlineStatus);
			daoService.executeSql("atv_equipmentOnlineStatus",paramsMap);
		}
	}

}
