| | |
| | | return result; |
| | | } |
| | | |
| | | /*List<String> idList = new ArrayList<>(); |
| | | for (MonitorPointPosition c : checkPoints) { |
| | | idList.add("'" + c.getId() + "'"); |
| | | } |
| | | String ids = String.join(",", idList);*/ |
| | | |
| | | for (MonitorPointPosition c : checkPoints) { |
| | | Map<String, Object> map = suYuanMapper.getMonthValueDataMax(tableNames, c.getId()); |
| | | if (null != map && map.size() > 0) { |
| | | String suYuanId = map.get("id").toString(); |
| | | map.put("name", commonService.select3dCheckPointById(suYuanId).getName()); |
| | | map.remove("id"); |
| | | //String suYuanId = map.get("id").toString(); |
| | | //map.put("name", commonService.select3dCheckPointById(suYuanId).getName()); |
| | | //map.remove("id"); |
| | | map.put("name", c.getName()); |
| | | } |
| | | result.add(map); |
| | | } |
| | |
| | | |
| | | <select id="getMonthValueDataMax" resultType="java.util.Map"> |
| | | <foreach collection="tableNames" item="tableName" separator=" UNION "> |
| | | SELECT id, TRUNCATE(c, 2) AS value, SUBSTRING_INDEX(#{tableName},'_',-1) AS time |
| | | FROM ${tableName} |
| | | SELECT TRUNCATE(c, 2) AS value, SUBSTRING_INDEX(#{tableName}, '_', -1) AS time |
| | | FROM ${tableName} |
| | | WHERE id = #{id} |
| | | </foreach> |
| | | ORDER BY value DESC |
| | | LIMIT 0, 1 |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getTemporary" resultMap="TemporaryResult"> |