19 package org.turro.erp.time;
21 import java.util.ArrayList;
22 import java.util.Date;
23 import java.util.List;
24 import org.amic.util.date.CheckDate;
25 import org.turro.elephant.db.WhereClause;
26 import org.turro.erp.db.ErpPU;
27 import org.turro.erp.entity.HumanResource;
28 import org.turro.erp.entity.Task;
29 import org.turro.erp.entity.TimeControl;
30 import org.turro.jpa.Dao;
46 this.humanResource = humanResource;
58 if(humanResource !=
null) {
60 wc.
addClause(
"select tc from TimeControl as tc");
61 wc.
addClause(
"where tc.humanResource = :humanResource");
69 return dao.getResultList(wc);
71 return new ArrayList<TimeControl>();
89 tc = dao.saveObject(tc);
106 tc = dao.saveObject(tc);
111 CheckDate d =
new CheckDate(date);
113 wc.
addClause(
"select tc from TimeControl as tc");
114 wc.
addClause(
"where (year(tc.startTime) = :year1 and month(tc.startTime) = :month1 and day(tc.startTime) = :day1)");
115 wc.
addClause(
"or (year(tc.endTime) = :year2 and month(tc.endTime) = :month2 and day(tc.endTime) = :day2)");
123 return dao.getResultList(wc);
void addClause(String clause)
void addNamedValue(String name, Object value)
void setEndManual(boolean endManual)
void setHumanResource(HumanResource humanResource)
void setEndTime(Date endTime)
void setStartTime(Date startTime)
void setStartManual(boolean startManual)
void setHumanResource(HumanResource humanResource)
TimeControl start(Date date)
HumanResource getHumanResource()
TimeControl end(TimeControl tc)
List< TimeControl > getFromDate(Date date)
TimeControl end(TimeControl tc, Date date)
List< TimeControl > getPendingControl()