1 /** 2 * Copyright 2004-2013 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.kuali.kpme.core.job.dao; 17 18 import java.util.List; 19 20 import org.joda.time.LocalDate; 21 import org.kuali.kpme.core.job.Job; 22 23 public interface JobDao { 24 25 /** 26 * Saves or Updates a Job 27 * @param job 28 */ 29 public void saveOrUpdate(Job job); 30 /** 31 * Saves or updates a job list 32 * @param jobList 33 */ 34 public void saveOrUpdate(List<Job> jobList); 35 36 /** 37 * Provides a list of current jobs that are valid relative to the provided effective date. 38 * Timestamp of row creation is taken into account when two rows with the same job number 39 * have the same effective date. 40 * 41 * @param principalId 42 * @param payPeriodEndDate 43 * @return 44 */ 45 public List<Job> getJobs(String principalId, LocalDate payPeriodEndDate); 46 /** 47 * 48 * @param principalId 49 * @param jobNumber 50 * @param asOfDate 51 * @return a Job per the critieria passed in 52 */ 53 public Job getJob(String principalId, Long jobNumber, LocalDate asOfDate); 54 55 /** 56 * Get Primary Job as indicated by primary indicator on Job table 57 * @param principalId 58 * @param payPeriodEndDate 59 * @return 60 */ 61 public Job getPrimaryJob(String principalId, LocalDate payPeriodEndDate); 62 63 /** 64 * Fetch active jobs that are incumbents of the payType 65 * @param hrPayType 66 * @param asOfDate 67 * @return 68 */ 69 public List<Job> getActiveJobsForPayType(String hrPayType, LocalDate asOfDate); 70 71 /** 72 * Get job based on id 73 * @param hrJobId 74 * @return 75 */ 76 public Job getJob(String hrJobId); 77 78 /** 79 * Get job with max(jobNumber) for a certain principalId 80 * @param principalId 81 * @return 82 */ 83 public Job getMaxJob(String principalId); 84 85 List<Job> getJobs(String principalId, String jobNumber, String dept, String positionNbr, String payType, LocalDate fromEffdt, LocalDate toEffdt, String active, 86 String showHistory); 87 88 /** 89 * Fetch the count of the jobs with the given principalId and jobNumber 90 * @param principalId 91 * @param jobNumber 92 * @return the count of the jobs with the given principalId and jobNumber 93 */ 94 public int getJobCount(String principalId, Long jobNumber, String dept); 95 96 public List<Job> getActiveLeaveJobs(String principalId, LocalDate asOfDate); 97 98 public List<Job> getAllActiveLeaveJobs(String principalId, LocalDate asOfDate); 99 100 public List<Job> getInactiveLeaveJobs(Long jobNumber, LocalDate endDate); 101 102 public List<Job> getAllInActiveLeaveJobsInRange(String principalId, LocalDate endDate); 103 104 public Job getMaxTimestampJob(String principalId); 105 106 /** 107 * Returns all of the principal ids actively particpating in a job in the given position number 108 * 109 * @param positionNumber 110 * @param asOfDate 111 * @return 112 */ 113 public List<String> getPrincipalIdsInPosition(String positionNumber, LocalDate asOfDate); 114 115 }