| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | KaoQinDao kaoQinDao; |
| | | |
| | | @Override |
| | | public PageInfo<TbKaoqing> findAll(Integer page, Integer limit) { |
| | | QueryWrapper queryWrapper = new QueryWrapper<>(); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | if (achor.getTagid() == null || achor.getTagid().equals("")){ |
| | | 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+" "; |
| | | 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"); |