コード例 #1
0
  public static final void test10() {
    SecurityLimit limit = new SecurityLimit();
    limit.setId(new SecurityLimitPK(4, 8));
    Calendar cal = Calendar.getInstance();
    cal.set(2009, 0, 1, 0, 0, 0);
    cal.set(Calendar.HOUR, -12);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    System.out.println("date from :" + CommonUtil.formatCalendar("yyyy-MM-dd", cal));
    Date date = cal.getTime();
    System.out.println("date :" + date);
    String[] order = {"depart.id", "line.id", "equipment.id", "downDate"};
    List a = BaseServiceUtil.getEquOnlinesForSafetyTree(limit, cal, order);
    System.out.println("EquOnlines List size: " + a.size());
    for (int i = 0; i < a.size(); i++) {
      EquOnline obj = (EquOnline) a.get(i);
      if (obj.getLine() == null) {
        System.out.println(
            "dept:"
                + obj.getDepart().getName()
                + " bus:"
                + obj.getEquipment().getUseId()
                + " ondate:"
                + CommonUtil.formatCalendar("yyyy-MM-dd", obj.getOnDate())
                + " downdate:"
                + CommonUtil.formatCalendar("yyyy-MM-dd", obj.getDownDate()));

      } else {
        System.out.println(
            "dept:"
                + obj.getDepart().getName()
                + " line:"
                + obj.getLine().getNo()
                + " bus:"
                + obj.getEquipment().getUseId()
                + " ondate:"
                + CommonUtil.formatCalendar("yyyy-MM-dd", obj.getOnDate())
                + " downdate:"
                + CommonUtil.formatCalendar("yyyy-MM-dd", obj.getDownDate()));
      }
    }
  }
コード例 #2
0
 public static final void test12() {
   List list = BaseServiceUtil.getEquOnlineLasts(4);
   System.out.println("getEquOnlineLasts list size : " + list.size());
 }