台账核算

This commit is contained in:
MustangDeng 2022-05-30 11:27:39 +08:00
parent 2ccc30db96
commit bd7c3e45a5
3 changed files with 108 additions and 2 deletions

View File

@ -80,6 +80,51 @@
</trim>
</insert>
<insert id="insert" parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO" databaseId="oracle"
>
<selectKey keyProperty="id" resultType="long" order="BEFORE">
select nvl(max(id),0)+1 from hrsa_bill_batch
</selectKey>
INSERT INTO hrsa_bill_batch
<trim prefix="(" suffix=")" suffixOverrides=",">
bill_month,
bill_status,
social_num,
fund_num,
other_num,
social_pay,
fund_pay,
other_pay,
accountant,
remarks,
creator,
delete_type,
create_time,
update_time,
tenant_key,
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
#{billMonth},
#{billStatus},
#{socialNum},
#{fundNum},
#{otherNum},
#{socialPay},
#{fundPay},
#{otherPay},
#{accountant},
#{remarks},
#{creator},
#{deleteType},
#{createTime},
#{updateTime},
#{tenantKey},
</trim>
</insert>
<sql id="paramSql">
<if test="param.startTime != null and param.startTime != '' and param.endTime != null and param.endTime != ''">
AND

View File

@ -205,7 +205,7 @@
OR l.dismissdate
> #{time}
)
) AS t
) t
LEFT JOIN hrsa_social_archives social ON t.ID = social.employee_id
LEFT JOIN hrsa_fund_archives fund ON t.ID = fund.employee_id
LEFT JOIN hrsa_other_archives other ON t.ID = other.employee_id
@ -236,6 +236,67 @@
) a
</select>
<select id="selectAccountIds" resultType="java.lang.Long" databaseId="oracle">
SELECT DISTINCT a.ID
FROM (
SELECT t.ID,
social.social_start_time,
social.social_end_time,
fund.fund_start_time,
fund.fund_end_time,
other.other_start_time,
other.other_end_time
FROM (
SELECT e.ID
FROM hrmresource e
LEFT JOIN (SELECT
t.*
FROM
(
SELECT
log.resource_n,
log.dismissdate
FROM
bill_hrmdismiss log ) t) l
ON e.ID = l.resource_n
WHERE(
e.status != '5'
OR l.dismissdate IS NULL
OR l.dismissdate = ''
OR l.dismissdate
> #{time}
)
) t
LEFT JOIN hrsa_social_archives social ON t.ID = social.employee_id
LEFT JOIN hrsa_fund_archives fund ON t.ID = fund.employee_id
LEFT JOIN hrsa_other_archives other ON t.ID = other.employee_id
WHERE (
fund.fund_start_time IS NOT NULL
AND(
fund.fund_end_time IS NULL
OR fund.fund_end_time = ''
OR fund.fund_end_time > #{time}
)
)
OR (
social.social_start_time IS NOT NULL
AND(
social.social_end_time IS NULL
OR social.social_end_time = ''
OR social.social_end_time > #{time}
)
)
OR (
other.other_start_time IS NOT NULL
AND(
other.other_end_time IS NULL
OR other.other_end_time = ''
OR other.other_end_time > #{time}
)
)
) a
</select>
<!-- 根据主键删除记录 -->
<delete id="deleteById" parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO">

View File

@ -104,7 +104,7 @@
<insert id="insert" parameterType="com.engine.salary.entity.sischeme.po.InsuranceSchemePO" databaseId="oracle"
>
<selectKey keyProperty="id" resultType="long" order="BEFORE">
select hrsa_social_s_s_id.nextval from dual
select nvl(max(id),0)+1 from hrsa_social_security_scheme
</selectKey>
INSERT INTO hrsa_social_security_scheme
<trim prefix="(" suffix=")" suffixOverrides=",">