一些数据量大的表会采用按年月的格式分表,如xxx_201906,xxx_201907。一些数据需要夸表查询:
private Map<String,Object> test(Map<String,String> params)throws Exception{
long startTimeL=Tools.parseLong(params.get("startTime"),-1);
long endTimeL=Tools.parseLong(params.get("endTime"),-1);
Date startTime=new Date(startTimeL*1000);
Date endTime=new Date(endTimeL*1000);
Map<String,Object> retDate=new LinkedHashMap()<>;
if(!DateUtil.getYearMonth(startTime).equals(DateUtil.getYearMonth(endTime))){
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
String st=sdf.format(startTime)+"23:59:59";
String et=sdf.format(endTime)+"23:59:59";
SimpleDateFormat sdf0=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date endTime0=sdf0.parse(st);
List<Map<String,Object>> list=xxxSer