| | |
| | | achor.setBumen(sql);} |
| | | cardList = kaoQinDao.findSearchTime(achor); |
| | | } else { |
| | | String s = achor.getIntime().split(" ")[0]; |
| | | String e = achor.getOuttime().split(" ")[0]; |
| | | String[] start = s.split("-"); |
| | | String[] end = e.split("-"); |
| | | String sql = new String(); |
| | | //只根据时间查询 |
| | | LocalDate startDate = LocalDate.of(Integer.parseInt(start[0]), Integer.parseInt(start[1]), Integer.parseInt(start[2])); |
| | | LocalDate endDate = LocalDate.of(Integer.parseInt(end[0]), Integer.parseInt(end[1]), Integer.parseInt(end[2])); |
| | | long numOfDaysBetween = ChronoUnit.DAYS.between(startDate, endDate); |
| | | // 计算两个日期之间的天数 |
| | | for (int i = 1; i <= numOfDaysBetween; i++) { |
| | | LocalDate date = startDate.plusDays(i); |
| | | String riqi = date.toString().split("-")[0]+date.toString().split("-")[1]+date.toString().split("-")[2]; |
| | | sql += " UNION select * from tb_kaoqing_" + riqi+" WHERE name = '"+achor.getTagid()+"' or tagid = '"+achor.getTagid()+"' "; |
| | | achor.setBumen(sql);} |
| | | |
| | | if (achor.getName() == null || achor.getName().equals("")) { |
| | | LocalDate currentDate = LocalDate.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); |