对于时间冲突的判断问题
作者:互联网
List<Fa1> ydqs=faMapper.selectQs(fa1); Date start=fa1.getKs(); Date end =fa1.getJs(); if(start.after(new Date())&&start.before(end)){ if(ydqs.size()==0){ fa1.setIdd(UUIDUtil.getUUID()); fa1.setGl(UUIDUtil.getUUID()); faMapper.insertFa1(fa1); }else if(start.after(ydqs.get(ydqs.size()-1).getJs())){ fa1.setIdd(UUIDUtil.getUUID()); fa1.setGl(UUIDUtil.getUUID()); faMapper.insertFa1(fa1); }else if(end.before(ydqs.get(0).getKs())){ fa1.setIdd(UUIDUtil.getUUID()); fa1.setGl(UUIDUtil.getUUID()); faMapper.insertFa1(fa1); }else{ for(int i=0;i<ydqs.size();i++){ if(start.after(ydqs.get(i).getJs())&&end.before(ydqs.get(i+1).getKs())){ fa1.setIdd(UUIDUtil.getUUID()); fa1.setGl(UUIDUtil.getUUID()); faMapper.insertFa1(fa1); } } } }else { fa1.setIdd(null); faMapper.insertFa1(fa1); }
标签:判断,faMapper,UUIDUtil,对于,fa1,start,ydqs,冲突,getUUID 来源: https://blog.csdn.net/weixin_46071489/article/details/121074713