| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * @Description: 多表查询,传入表名集合,以及条件wrapper,返回数据 |
| | | * @Param: [wrapper, tableNames] |
| | | * @return: java.util.List<com.moral.api.entity.HistoryHourly> |
| | | * @Author: 陈凯裕 |
| | | * @Date: 2021/9/23 |
| | | */ |
| | | private List<HistoryMinutely> HistoryMinutelyQuery(Map<String, Object> params, List<String> tableNames) { |
| | | List<HistoryMinutely> result = new ArrayList<>(); |
| | | for (String tableName : tableNames) { |
| | | params.put("table",tableName); |
| | | List<HistoryMinutely> historyMinutelies = historyHourlyMapper.HistoryMinutelyQuery(params); |
| | | result.addAll(historyMinutelies); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private List<HistoryHourly> multiTableQueryLike(Map<String, Object> params, List<String> tableNames) { |
| | | List<HistoryHourly> result = new ArrayList<>(); |
| | | for (String tableName : tableNames) { |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * @param mac |
| | | * @param startDate |
| | | * @param endDate |
| | | * @Description: 根据一个mac查询时间段内分钟的数据 |
| | | * @Param: [mac, startDate, endDate] |
| | | * @return: java.util.Map<java.lang.String, com.moral.api.entity.HistoryDaily> |
| | | * @Author: 陈凯裕 |
| | | * @Date: 2021/9/26 |
| | | */ |
| | | @Override |
| | | public List<HistoryMinutely> getHistoryMinutely(String mac, Date startDate, Date endDate) { |
| | | Map<String, Object> mapParams = new HashMap<>(); |
| | | mapParams.put("startDate",startDate); |
| | | mapParams.put("endDate",endDate); |
| | | mapParams.put("mac",mac); |
| | | List<String> tableNames = MybatisPLUSUtils.getTableNamesByWrapper(startDate, endDate, SeparateTableType.MONTH); |
| | | List<HistoryMinutely> datas = HistoryMinutelyQuery(mapParams, tableNames); |
| | | return datas; |
| | | } |
| | | } |