|
|
@@ -89,7 +89,7 @@ public class SwcUtils {
|
|
|
"left join t_hsas_caltable f on f.fcaltaskid = b.fid and f.fcalpersonid = c.fid\n" +
|
|
|
"left join t_hsas_caltableentry g on g.fid = f.fid\n" +
|
|
|
"left join t_hsbs_salaryitem h on h.fid = g.fsalaryitemid\n" +
|
|
|
- "where 1 = 1\n" +
|
|
|
+ "where 1 = 1 and b1.ftaskstatus in ('4','7','8','9') ---计算完成 9--已审核 7--审批处理中 8--审批通过 4 \n" +
|
|
|
" and a.fiscurrentversion = '1'\n" +
|
|
|
" and h.fnumber = 'JT_283'\n");
|
|
|
sb.append("and b1.fpaydate >= '"+startDateStr+"'\n");
|
|
|
@@ -100,6 +100,46 @@ public class SwcUtils {
|
|
|
return sb;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * 根据员工ID获取员工薪资明细
|
|
|
+ * @param empId
|
|
|
+ * @param salaryitem
|
|
|
+ * @param startDate
|
|
|
+ * @param endDate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static StringBuilder getSalaryDetailSqlByEmp(Long empId,String salaryitem, Date startDate, Date endDate) {
|
|
|
+
|
|
|
+ String startDateStr = dateToStr(startDate, 1);
|
|
|
+ String endDateStr = dateToStr(endDate, 2);
|
|
|
+
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ sb.append("/*dialect*/ SELECT c.femployeeid,d.fname empName,\n" +
|
|
|
+ //" h.fnumber itemName,\n" +
|
|
|
+ " d.fempnumber empNumber,\n" +
|
|
|
+ " count(distinct to_char(b1.fpaydate,'yyyy-MM')) monthCount,\n" +
|
|
|
+ " sum(g.fcalamountvalue) amount\n" +
|
|
|
+ "from t_hsas_calpayrolltask b \n" +
|
|
|
+ "left join t_hsas_calpayrolltask_a b1 on b1.fid = b.fid \n" +
|
|
|
+ "left join t_hsas_calperson c on c.fcaltaskid = b.fid \n" +
|
|
|
+ "left join t_hrpi_employee d on d.fid = c.femployeeid \n" +
|
|
|
+ "left join t_hrpi_percre e on e.femployeeid = d.fid and e.fcredentialstypeid = '1010'\n" +
|
|
|
+ "left join t_hsas_caltable f on f.fcaltaskid = b.fid and f.fcalpersonid = c.fid \n" +
|
|
|
+ "left join t_hsas_caltableentry g on g.fid = f.fid \n" +
|
|
|
+ "left join t_hsbs_salaryitem h on h.fid = g.fsalaryitemid \n" +
|
|
|
+ "where 1 = 1 and b1.ftaskstatus in ('4','7','8','9') ---计算完成 9--已审核 7--审批处理中 8--审批通过 4 \n" +
|
|
|
+ " and a.fiscurrentversion = '1'\n" +
|
|
|
+ " and h.fnumber in ("+salaryitem+") \n");
|
|
|
+ sb.append("and b1.fpaydate >= '"+startDateStr+"' \n");
|
|
|
+ sb.append("and b1.fpaydate <= '"+endDateStr+"' \n");
|
|
|
+ sb.append("and c.femployeeid in ("+empId+") \n");
|
|
|
+ sb.append("group by c.femployeeid,d.fname, d.fempnumber");
|
|
|
+
|
|
|
+ return sb;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static List<Long> getExcludePayRollGroupIds(Date startDate) {
|
|
|
List<Long> excludeGroupIds = new ArrayList<Long>();
|
|
|
QFilter filter = new QFilter("nckd_calyear", QCP.equals, startDate);
|