|
|
@@ -1254,25 +1254,40 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取薪酬核算人员
|
|
|
- * 新增
|
|
|
+ * 获取薪酬核算人员 新增
|
|
|
*
|
|
|
- * @param year 统计年
|
|
|
- * @param month 统计月
|
|
|
- * @param taxUnitId 纳税单位
|
|
|
+ * @param year
|
|
|
+ * 统计年
|
|
|
+ * @param month
|
|
|
+ * 统计月
|
|
|
+ * @param taxUnitId
|
|
|
+ * 纳税单位
|
|
|
*/
|
|
|
public String getSCmpCalTablePersonsSqlAndNew(Integer year, Integer month, String taxUnitId) {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- sb.append(" select scct.fid scctId,scct.fnumber scctNumber,scct.FPERSONID,scct.fname_l2 scctName,scct.FTaxUnitID scctTaxUnitID," +
|
|
|
- "rentry.FTAXUNITID rentryTaxUnitID,rentry.FBILLID,rentry.fid rentryId from ");
|
|
|
+ sb.append(" select scct.fid scctId,scct.fnumber scctNumber,scct.FPERSONID,scct.fname_l2 scctName,scct.FTaxUnitID scctTaxUnitID,"
|
|
|
+ + "rentry.FTAXUNITID rentryTaxUnitID,rentry.FBILLID,rentry.fid rentryId from ");
|
|
|
sb.append(" T_HR_SCmpCalTable scct ");
|
|
|
sb.append(" left join T_HR_STAXPERSONRECORDENTRY rentry on rentry.FPERSONID=scct.FPERSONID ");
|
|
|
sb.append(" and rentry.FPERSONSTATUS=1 and scct.FTaxUnitID = rentry.FTaxUnitID ");
|
|
|
+
|
|
|
+ // 20250731 方宇康 过滤掉用工关系类型为“灵活用工A类”、“类外包”的员工
|
|
|
+ sb.append(" LEFT JOIN T_HR_BDEmployeeType et ON scct.FEmployeeTypeID = et.FID");
|
|
|
+ sb.append(" LEFT JOIN T_BD_EMPLOYEEMODLE em ON et.FEmployeeModleID = em.FID");
|
|
|
+ sb.append(" LEFT JOIN T_HR_BDEmployeeType et_prev ON scct.CFEmpTypeLzPrevID = et_prev.FID");
|
|
|
+ sb.append(" LEFT JOIN T_BD_EMPLOYEEMODLE em_prev ON et_prev.FEmployeeModleID = em_prev.FID");
|
|
|
+
|
|
|
sb.append(" where scct.FPeriodYear = '" + year + "' and scct.FPeriodMonth = '" + month + "' ");
|
|
|
- sb.append(" and scct.FTaxUnitID ='" + taxUnitId + "' ");
|
|
|
- sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER in('JZT006','JZT022') ) ");
|
|
|
- sb.append(" and rentry.fid is null ");
|
|
|
- System.out.println("getSCmpCalTablePersonsSqlAndNew" + sb);
|
|
|
+ sb.append(" and scct.FTaxUnitID ='" + taxUnitId + "' and (");
|
|
|
+
|
|
|
+ // 20250731 方宇康 过滤掉用工关系类型为“灵活用工A类”、“类外包”的员工
|
|
|
+ // sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER
|
|
|
+ // in('JZT006','JZT022') ) ");
|
|
|
+ sb.append(" ( et.FNumber NOT IN ('JZT008') AND em.FNumber NOT IN ('13', '16') )");
|
|
|
+ sb.append(" OR ( et.FNumber IN ('JZT008') AND em_prev.FNumber NOT IN ('13', '16') )");
|
|
|
+
|
|
|
+ sb.append(" ) and rentry.fid is null ");
|
|
|
+ fileLogger.log(sb.toString());
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|
|
|
@@ -1286,16 +1301,29 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
|
|
|
*/
|
|
|
public String getSCmpCalTablePersonsSqlAlter(Integer year, Integer month, String taxUnitId) {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- sb.append(" select scct.fid scctId,scct.fnumber scctNumber,scct.FPERSONID,scct.fname_l2 scctName,scct.FTaxUnitID scctTaxUnitID," +
|
|
|
- "rentry.FTAXUNITID rentryTaxUnitID,rentry.FBILLID,rentry.fid rentryId from ");
|
|
|
+ sb.append(" select scct.fid scctId,scct.fnumber scctNumber,scct.FPERSONID,scct.fname_l2 scctName,scct.FTaxUnitID scctTaxUnitID,"
|
|
|
+ + "rentry.FTAXUNITID rentryTaxUnitID,rentry.FBILLID,rentry.fid rentryId from ");
|
|
|
sb.append(" T_HR_SCmpCalTable scct ");
|
|
|
sb.append(" inner join T_HR_STAXPERSONRECORDENTRY rentry on rentry.FPERSONID=scct.FPERSONID ");
|
|
|
sb.append(" and rentry.FPERSONSTATUS=1 and scct.FTaxUnitID!=rentry.FTaxUnitID ");
|
|
|
+
|
|
|
+ // 20250731 方宇康 过滤掉用工关系类型为“灵活用工A类”、“类外包”的员工
|
|
|
+ sb.append(" LEFT JOIN T_HR_BDEmployeeType et ON scct.FEmployeeTypeID = et.FID");
|
|
|
+ sb.append(" LEFT JOIN T_BD_EMPLOYEEMODLE em ON et.FEmployeeModleID = em.FID");
|
|
|
+ sb.append(" LEFT JOIN T_HR_BDEmployeeType et_prev ON scct.CFEmpTypeLzPrevID = et_prev.FID");
|
|
|
+ sb.append(" LEFT JOIN T_BD_EMPLOYEEMODLE em_prev ON et_prev.FEmployeeModleID = em_prev.FID");
|
|
|
+
|
|
|
sb.append(" where scct.FPeriodYear = '" + year + "' and scct.FPeriodMonth = '" + month + "' ");
|
|
|
sb.append(" and scct.FTaxUnitID ='" + taxUnitId + "' ");
|
|
|
- sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER in('JZT006','JZT022') ) ");
|
|
|
+
|
|
|
+ // 20250731 方宇康 过滤掉用工关系类型为“灵活用工A类”、“类外包”的员工
|
|
|
+ // sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER
|
|
|
+ // in('JZT006','JZT022') ) ");
|
|
|
+ sb.append(" and ( ( et.FNumber NOT IN ('JZT008') AND em.FNumber NOT IN ('13', '16') )");
|
|
|
+ sb.append(" OR ( et.FNumber IN ('JZT008') AND em_prev.FNumber NOT IN ('13', '16') ) )");
|
|
|
+
|
|
|
sb.append(" order by scct.FTaxUnitID,rentry.FTAXUNITID,rentry.fid ");
|
|
|
- System.out.println("getSCmpCalTablePersonsSqlAlter" + sb);
|
|
|
+ fileLogger.log(sb.toString());
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|
|
|
@@ -1309,16 +1337,29 @@ public class TaxPersonRecordListHandlerEx extends TaxPersonRecordListHandler {
|
|
|
*/
|
|
|
public String getSCmpCalTablePersonsSqlDel(Integer year, Integer month, String taxUnitId) {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- sb.append(" select scct.fid scctId,scct.fnumber scctNumber,rentry.FPERSONID,scct.fname_l2 scctName,scct.FTaxUnitID scctTaxUnitID," +
|
|
|
- "rentry.FTAXUNITID rentryTaxUnitID,rentry.FBILLID,rentry.fid rentryId ");
|
|
|
+ sb.append("/*dialect*/ select scct.fid scctId,scct.fnumber scctNumber,rentry.FPERSONID,scct.fname_l2 scctName,scct.FTaxUnitID scctTaxUnitID,"
|
|
|
+ + "rentry.FTAXUNITID rentryTaxUnitID,rentry.FBILLID,rentry.fid rentryId ");
|
|
|
sb.append(" from T_HR_STAXPERSONRECORDENTRY rentry ");
|
|
|
sb.append(" left join T_HR_SCmpCalTable scct on rentry.FPERSONID=scct.FPERSONID ");
|
|
|
sb.append(" and scct.FTaxUnitID=rentry.FTaxUnitID ");
|
|
|
- sb.append(" and scct.FPeriodYear = '"+year+"' and scct.FPeriodMonth = '"+month+"' ");
|
|
|
- sb.append(" and scct.FTaxUnitID ='"+taxUnitId+"' ");
|
|
|
- sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER in('JZT006','JZT022') ) ");
|
|
|
- sb.append(" where rentry.FPERSONSTATUS=1 and rentry.FTaxUnitID ='"+taxUnitId+"' and scct.fid is null ");
|
|
|
- System.out.println("getSCmpCalTablePersonsSqlDel" + sb);
|
|
|
+ sb.append(" and scct.FPeriodYear = '" + year + "' and scct.FPeriodMonth = '" + month + "' ");
|
|
|
+ sb.append(" and scct.FTaxUnitID ='" + taxUnitId + "' ");
|
|
|
+ // sb.append(" and scct.FEMPLOYEETYPEID not in( select t.fid from T_HR_BDEmployeeType t where t.FNUMBER
|
|
|
+ // in('JZT006','JZT022') ) ");
|
|
|
+
|
|
|
+ // 20250731 方宇康 过滤掉用工关系类型为“灵活用工A类”、“类外包”的员工
|
|
|
+ sb.append(" LEFT JOIN T_HR_BDEmployeeType et ON scct.FEmployeeTypeID = et.FID");
|
|
|
+ sb.append(" LEFT JOIN T_BD_EMPLOYEEMODLE em ON et.FEmployeeModleID = em.FID");
|
|
|
+ sb.append(" LEFT JOIN T_HR_BDEmployeeType et_prev ON scct.CFEmpTypeLzPrevID = et_prev.FID");
|
|
|
+ sb.append(" LEFT JOIN T_BD_EMPLOYEEMODLE em_prev ON et_prev.FEmployeeModleID = em_prev.FID");
|
|
|
+
|
|
|
+ sb.append(" where rentry.FPERSONSTATUS=1 and rentry.FTaxUnitID ='" + taxUnitId + "' and scct.fid is null ");
|
|
|
+
|
|
|
+ // 20250731 方宇康 过滤掉用工关系类型为“灵活用工A类”、“类外包”的员工
|
|
|
+ sb.append(" AND ( ( ( NVL(et.FNumber, 'null') NOT IN ( 'JZT008' ) ) AND ( NVL(em.FNumber, 'null') NOT IN ( '13', '16' ) ) ) ");
|
|
|
+ sb.append(" OR ( NVL(et.FNumber, 'null') IN ( 'JZT008' ) AND NVL(em_prev.FNumber, 'null') NOT IN ( '13', '16' ) ) ) ");
|
|
|
+
|
|
|
+ fileLogger.log(sb.toString());
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|