/**
 * Copyright 2019 DH
 * All right reserved.
 * 项目名称:
 * 创建日期:2022/8/28
 */
package org.springblade.modules.business.data.service.impl;

import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.business.data.dto.RtuDataGroundDTO;
import org.springblade.modules.business.data.entity.RtuDataGroundStoreEntity;
import org.springblade.modules.business.data.mapper.RtuDataGroundStoreMapper;
import org.springblade.modules.business.data.service.IRtuDataGroundStoreService;
import org.springblade.modules.etl.entity.EtlGroundDataEntity;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


/***
 * Date:2022/8/28
 * Title:文件所属模块（必须填写）
 * Description：对本文件的详细描述，原则上不能少于30字
 * @author dylan
 * @version 1.0
 * Remark：认为有必要的其他信息
 */
@Service
public class RtuDataGroundStoreServiceImpl extends BaseServiceImpl<RtuDataGroundStoreMapper, RtuDataGroundStoreEntity> implements IRtuDataGroundStoreService {

	@Override
	public boolean saveGroundData(EtlGroundDataEntity etlGroundDataEntity) {
		RtuDataGroundStoreEntity groundDataEntity = new RtuDataGroundStoreEntity();
		groundDataEntity.setRtuCode(etlGroundDataEntity.getRtuCode());
		groundDataEntity.setCreateTime(new Date());
		groundDataEntity.setStatus(1);
		groundDataEntity.setIsDeleted(0);
		groundDataEntity.setSlm10(etlGroundDataEntity.getMoco10cm());
		groundDataEntity.setSlm20(etlGroundDataEntity.getMoco20cm());
		groundDataEntity.setSlm30(etlGroundDataEntity.getMoco30cm());
		groundDataEntity.setSlm40(etlGroundDataEntity.getMoco40cm());
		groundDataEntity.setSlm50(etlGroundDataEntity.getMoco50cm());
		groundDataEntity.setSlm60(etlGroundDataEntity.getMoco60cm());
		groundDataEntity.setSlm80(etlGroundDataEntity.getMoco80cm());
		groundDataEntity.setSlm100(etlGroundDataEntity.getMoco100cm());
		groundDataEntity.setSrlslm(etlGroundDataEntity.getSurfMoco());
		groundDataEntity.setVtavslm(etlGroundDataEntity.getVertAverMoco());
		groundDataEntity.setTm(etlGroundDataEntity.getTm());
		groundDataEntity.setFromTime(etlGroundDataEntity.getFromDate());
		return this.save(groundDataEntity);
	}

	@Override
	public long rtuUpDataCount(RtuDataGroundDTO groundDTO) {
		return this.baseMapper.rtuUpDataCount(groundDTO);
	}

	@Override
	public List<RtuDataGroundStoreEntity> selectList(RtuDataGroundDTO dto) {
		return this.baseMapper.selectList(dto);
	}
}
