| | |
| | | |
| | | // 执行查询并处理结果 |
| | | ResultSet rs = pstmt.executeQuery(); |
| | | boolean colCount = rs.next(); |
| | | if(!colCount){ |
| | | if(!rs.isBeforeFirst()){ |
| | | pstmt.setString(1, lastMonth); |
| | | rs = pstmt.executeQuery(); |
| | | colCount = rs.next(); |
| | | if(!colCount){ |
| | | if(!rs.isBeforeFirst()){ |
| | | pstmt.setString(1, upMonth); |
| | | rs = pstmt.executeQuery(); |
| | | remark = "上月数据为空,同步上上月数据成功"; |
| | |
| | | } |
| | | } |
| | | byqlzAdsService.delete(yearMonth); |
| | | while (colCount) { |
| | | while (rs.next()) { |
| | | logger.error("进入循环"); |
| | | ByqlzAdsEntity entity = new ByqlzAdsEntity(); |
| | | |
| | | // 映射基础字段 |
| | |
| | | entity.setLoadTime(rs.getString("LOAD_TIME")); |
| | | resultList.add(entity); |
| | | } |
| | | |
| | | byqlzAdsService.save(resultList); |
| | | |
| | | syncLogService.save(remark); |
| | | // 输出结果 |
| | | resultList.forEach(System.out::println); |
| | | |
| | | byqlzAdsService.save(resultList); |
| | | syncLogService.save(remark); |
| | | resultList.clear(); |
| | | } catch (SQLException e) { |
| | | logger.error("SyncEmsTask运行异常"); |
| | | e.printStackTrace(); |