package org.ts.ddcs.DataController.service.impl;

import org.ts.ddcs.DataController.service.RtuDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

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

@Service("RtuDataService")
@Transactional
@SuppressWarnings("all")
public class RtuDataServiceImpl implements RtuDataService {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public List<Map<String, Object>> waterLevelList() {
        String sql = "SELECT b.RTU_CD as rtuCode,b.RTU_NAME as rtuName,r.TM as collectTm,r.Z as waterLevel FROM st_river_r_cache r  LEFT JOIN t_base_rtu_info b on b.RTU_CD = R.STCD  ORDER BY r.TM DESC";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}
