diff --git a/resource/wiki/人员生成不了档案.sql b/resource/wiki/人员生成不了档案.sql index 7060a660e..1ddc0e7e4 100644 --- a/resource/wiki/人员生成不了档案.sql +++ b/resource/wiki/人员生成不了档案.sql @@ -6,5 +6,5 @@ and employee_id not in where tax_agent_id =扣缴义务人id and delete_type = 0) -update hrsa_tax_agent_emp set delete_type = 3 +update hrsa_tax_agent_emp set delete_type = 3 where delete_type = 0 where tax_agent_id=扣缴义务人id and delete_type = 0 and employee_id not in (select employee_id from hrsa_salary_archive where tax_agent_id =扣缴义务人id and delete_type = 0) \ No newline at end of file diff --git a/resource/wiki/删除档案.txt b/resource/wiki/删除档案.txt index a3a0c6dbd..22d1976b0 100644 --- a/resource/wiki/删除档案.txt +++ b/resource/wiki/删除档案.txt @@ -18,7 +18,8 @@ update hrsa_salary_archive set delete_type=3 where tax_agent_id=扣缴义务人 二、删除停薪员工档案 -update hrsa_salary_archive set delete_type=3 where run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND') +update hrsa_salary_archive set delete_type=3 where delete_type=0 and run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND') +update hrsa_salary_archive_item set delete_type=3 where delete_type=0 二、删除停薪员工社保档案 update hrsa_insurance_base_info set delete_type=3 where run_status in ('4','5') @@ -28,10 +29,10 @@ update hrsa_insurance_base_info set delete_type=3 where run_status in ('4','5') --删除社保福利档案 -update hrsa_insurance_base_info set delete_type=3 WHERE employee_id = ? and payment_organization =? -update hrsa_social_archives set delete_type=3 WHERE employee_id = ? and payment_organization =? -update hrsa_fund_archives set delete_type=3 WHERE employee_id = ? and payment_organization =? -update hrsa_other_archives set delete_type=3 WHERE employee_id = ? and payment_organization =? +update hrsa_insurance_base_info set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =? +update hrsa_social_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =? +update hrsa_fund_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =? +update hrsa_other_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =? -- 删除薪资档案 update hrsa_salary_archive set delete_type=3 where employee_id = ? and tax_agent_id=? @@ -45,4 +46,11 @@ update hrsa_other_archives set delete_type=3; update hrsa_tax_agent_emp set delete_type=3; +-- 删除核算记录和工资单信息 +update hrsa_salary_acct_record set delete_type=3 where delete_type=0; +update hrsa_salary_acct_emp set delete_type=3 where delete_type=0; +update hrsa_salary_acct_result set delete_type=3 where delete_type=0; +update hrsa_salary_send set delete_type=3 where delete_type=0; +update hrsa_salary_send_info set delete_type=3 where delete_type=0; +