weaver-hrm-salary/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMappe...

1244 lines
50 KiB
XML
Raw Normal View History

2022-04-12 10:24:21 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO">
<result column="id" property="id"/>
<result column="employee_id" property="employeeId"/>
<result column="bill_month" property="billMonth"/>
<result column="bill_status" property="billStatus"/>
<result column="payment_status" property="paymentStatus"/>
<result column="supplementary_month" property="supplementaryMonth"/>
<result column="supplementary_projects" property="supplementaryProjects"/>
<result column="resource_from" property="resourceFrom"/>
<result column="social_pay_org" property="socialPayOrg"/>
<result column="social_account" property="socialAccount"/>
<result column="fund_pay_org" property="fundPayOrg"/>
<result column="fund_account" property="fundAccount"/>
<result column="supplement_fund_account" property="supplementFundAccount"/>
<result column="other_pay_org" property="otherPayOrg"/>
<result column="social_scheme_id" property="socialSchemeId"/>
<result column="social_payment_base_string" property="socialPaymentBaseString"/>
<result column="fund_scheme_id" property="fundSchemeId"/>
<result column="fund_payment_base_string" property="fundPaymentBaseString"/>
<result column="other_scheme_id" property="otherSchemeId"/>
<result column="other_payment_base_string" property="otherPaymentBaseString"/>
<result column="social_per_json" property="socialPerJson"/>
<result column="social_per_sum" property="socialPerSum"/>
<result column="fund_per_json" property="fundPerJson"/>
<result column="fund_per_sum" property="fundPerSum"/>
<result column="other_per_json" property="otherPerJson"/>
<result column="other_per_sum" property="otherPerSum"/>
<result column="per_sum" property="perSum"/>
<result column="social_com_json" property="socialComJson"/>
<result column="social_com_sum" property="socialComSum"/>
<result column="fund_com_json" property="fundComJson"/>
<result column="fund_com_sum" property="fundComSum"/>
<result column="other_com_json" property="otherComJson"/>
<result column="other_com_sum" property="otherComSum"/>
<result column="com_sum" property="comSum"/>
<result column="social_sum" property="socialSum"/>
<result column="fund_sum" property="fundSum"/>
<result column="other_sum" property="otherSum"/>
<result column="total" property="total"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="tenant_key" property="tenantKey"/>
2022-06-06 19:08:39 +08:00
<result column="payment_organization" property="paymentOrganization"/>
2022-04-12 10:24:21 +08:00
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
2022-04-12 10:24:21 +08:00
, t.employee_id
2022-05-30 17:31:29 +08:00
, e.status as employee_status
2022-04-12 10:24:21 +08:00
, t.bill_month
, t.bill_status
, t.payment_status
, t.supplementary_month
, t.supplementary_projects
, t.resource_from
, t.social_pay_org
, t.social_account
, t.fund_pay_org
, t.fund_account
, t.supplement_fund_account
, t.other_pay_org
, t.social_scheme_id
, t.social_payment_base_string
, t.fund_scheme_id
, t.fund_payment_base_string
, t.other_scheme_id
, t.other_payment_base_string
, t.social_per_json
, t.social_per_sum
, t.fund_per_json
, t.fund_per_sum
, t.other_per_json
, t.other_per_sum
, t.per_sum
, t.social_com_json
, t.social_com_sum
, t.fund_com_json
, t.fund_com_sum
, t.other_com_json
, t.other_com_sum
, t.com_sum
, t.social_sum
, t.fund_sum
, t.other_sum
, t.total
, t.creator
, t.delete_type
, t.create_time
, t.update_time
, t.tenant_key
2022-06-06 19:08:39 +08:00
, t.payment_organization
2022-04-12 10:24:21 +08:00
</sql>
2022-10-10 09:43:57 +08:00
<sql id="baseColumnsNoJoin">
t
.
id
, t.employee_id
, t.bill_month
, t.bill_status
, t.payment_status
, t.supplementary_month
, t.supplementary_projects
, t.resource_from
, t.social_pay_org
, t.social_account
, t.fund_pay_org
, t.fund_account
, t.supplement_fund_account
, t.other_pay_org
, t.social_scheme_id
, t.social_payment_base_string
, t.fund_scheme_id
, t.fund_payment_base_string
, t.other_scheme_id
, t.other_payment_base_string
, t.social_per_json
, t.social_per_sum
, t.fund_per_json
, t.fund_per_sum
, t.other_per_json
, t.other_per_sum
, t.per_sum
, t.social_com_json
, t.social_com_sum
, t.fund_com_json
, t.fund_com_sum
, t.other_com_json
, t.other_com_sum
, t.com_sum
, t.social_sum
, t.fund_sum
, t.other_sum
, t.total
, t.creator
, t.delete_type
, t.create_time
, t.update_time
, t.tenant_key
, t.payment_organization
</sql>
2022-04-12 10:24:21 +08:00
<sql id="paramSqlCommon">
2022-04-12 10:24:21 +08:00
<if test="param.billMonth != null and param.billMonth != ''">
AND
2022-04-15 19:01:09 +08:00
t.bill_month = #{param.billMonth}
2022-04-12 10:24:21 +08:00
</if>
2022-06-29 14:13:23 +08:00
<if test="param.paymentStatus != null">
2022-04-12 10:24:21 +08:00
AND
2022-04-15 19:01:09 +08:00
t.payment_status = #{param.paymentStatus}
2022-04-12 10:24:21 +08:00
</if>
2022-06-09 18:31:36 +08:00
<if test="param.paymentOrganization != null and param.paymentOrganization != ''">
AND
t.payment_organization = #{param.paymentOrganization}
</if>
<!-- <if test="param.creator != null">-->
<!-- AND-->
<!-- t.creator = #{param.creator}-->
<!-- </if>-->
2022-04-19 17:46:24 +08:00
</sql>
<sql id="paramSql">
<if test="param.userName != null and param.userName != ''">
AND
(
e.lastname like CONCAT('%',#{param.userName},'%')
)
</if>
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode like CONCAT('%',#{param.workcode},'%')
</if>
<if test="param.employeeIds != null and param.employeeIds.size()>0">
AND t.employee_id IN
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
<if test="param.recessionMonthList != null and param.recessionMonthList.size()>0">
AND t.bill_month IN
<foreach collection="param.recessionMonthList" open="(" item="recessionMonth" separator="," close=")">
#{recessionMonth}
</foreach>
</if>
<if test="param.taxAgents != null and param.taxAgents.size()>0">
AND t.payment_organization IN
<foreach collection="param.taxAgents" open="(" item="taxAgent" separator="," close=")">
#{taxAgent}
</foreach>
</if>
2022-04-19 17:46:24 +08:00
</sql>
<sql id="paramSql" databaseId="oracle">
<if test="param.userName != null and param.userName != ''">
AND
(
e.lastname like '%'||#{param.userName}||'%'
2022-04-19 17:46:24 +08:00
)
</if>
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode like '%'||#{param.workcode}||'%'
</if>
<if test="param.employeeIds != null and param.employeeIds.size()>0">
AND t.employee_id IN
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
<if test="param.recessionMonthList != null and param.recessionMonthList.size()>0">
AND t.bill_month IN
<foreach collection="param.recessionMonthList" open="(" item="recessionMonth" separator="," close=")">
#{recessionMonth}
</foreach>
</if>
<if test="param.taxAgents != null and param.taxAgents.size()>0">
AND t.payment_organization IN
<foreach collection="param.taxAgents" open="(" item="taxAgent" separator="," close=")">
#{taxAgent}
</foreach>
</if>
2022-04-19 17:46:24 +08:00
</sql>
<sql id="paramSql" databaseId="sqlserver">
<if test="param.userName != null and param.userName != ''">
AND
(
e.lastname like '%'+#{param.userName}+'%'
)
2022-04-12 19:29:19 +08:00
</if>
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode like '%'+#{param.workcode}+'%'
</if>
<if test="param.employeeIds != null and param.employeeIds.size()>0">
AND t.employee_id IN
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
<if test="param.recessionMonthList != null and param.recessionMonthList.size()>0">
AND t.bill_month IN
<foreach collection="param.recessionMonthList" open="(" item="recessionMonth" separator="," close=")">
#{recessionMonth}
</foreach>
</if>
<if test="param.taxAgents != null and param.taxAgents.size()>0">
AND t.payment_organization IN
<foreach collection="param.taxAgents" open="(" item="taxAgent" separator="," close=")">
#{taxAgent}
</foreach>
</if>
2022-04-12 10:24:21 +08:00
</sql>
<select id="list" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
hrsa_bill_detail t
2022-09-27 14:28:21 +08:00
left join hrmresource e on e.ID = t.employee_id
2022-09-27 10:19:09 +08:00
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
2022-04-12 10:24:21 +08:00
WHERE t.delete_type = 0
2022-06-06 10:19:11 +08:00
and e.status not in (7)
and (e.accounttype is null or e.accounttype = 0)
2022-04-19 17:46:24 +08:00
<include refid="paramSqlCommon"/>
2022-04-12 10:24:21 +08:00
<include refid="paramSql"/>
2022-09-27 10:19:09 +08:00
<!-- 排序 -->
<if test="param.orderRule != null">
2022-10-10 09:43:57 +08:00
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
2022-09-27 10:19:09 +08:00
</if>
2022-04-12 10:24:21 +08:00
</select>
2022-04-14 11:54:16 +08:00
<select id="selectList" resultMap="BaseResultMap">
SELECT
2022-04-18 20:24:43 +08:00
t.employee_id,t.social_sum,t.fund_sum,t.other_sum,t.fund_pay_org,t.social_pay_org,
t.other_pay_org, t.payment_status
2022-04-14 11:54:16 +08:00
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.bill_month = #{billMonth}
2022-06-29 14:13:23 +08:00
<if test="paymentOrganization != null">
2022-06-09 18:31:36 +08:00
AND t.payment_organization = #{paymentOrganization}
</if>
2022-04-14 11:54:16 +08:00
</select>
2022-04-27 14:36:05 +08:00
<select id="queryList" resultMap="BaseResultMap">
SELECT
2022-09-20 10:13:05 +08:00
t.id,t.employee_id,t.social_per_json,t.social_com_json,
2022-04-27 14:36:05 +08:00
t.fund_per_json,t.fund_com_json,t.other_per_json,
t.other_com_json,t.social_per_sum,t.social_com_sum,
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
t.other_com_sum,t.per_sum,t.com_sum,t.payment_status,
t.social_payment_base_string,t.fund_payment_base_string,t.other_payment_base_string
2022-04-27 14:36:05 +08:00
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
2022-10-10 09:43:57 +08:00
-- AND t.payment_status = 0
2022-04-27 14:36:05 +08:00
AND t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
2022-04-27 14:36:05 +08:00
<if test="employeeIds != null and employeeIds.size()>0">
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
</select>
<select id="queryNormalList" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id,t.social_per_json,t.social_com_json,
t.fund_per_json,t.fund_com_json,t.other_per_json,
t.other_com_json,t.social_per_sum,t.social_com_sum,
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization,
t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.payment_status = 0
AND t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
AND employee_id = #{employeeId}
</select>
<select id="querySupplementList" resultMap="BaseResultMap">
SELECT
2022-09-20 10:13:05 +08:00
t.id,t.employee_id,t.social_per_json,t.social_com_json,
t.fund_per_json,t.fund_com_json,t.other_per_json,
t.other_com_json,t.social_per_sum,t.social_com_sum,
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
AND t.employee_id = #{employeeId}
AND t.supplementary_month = #{supplementaryMonth}
AND t.payment_status = 1
</select>
2022-04-14 11:54:16 +08:00
<select id="querySupplementListByBillMonth" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id,t.supplementary_month,t.supplementary_projects
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.payment_status = 1
AND t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
</select>
<select id="queryNormalListByBillMonth" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.payment_status = 0
AND t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
</select>
2022-04-15 13:17:25 +08:00
<select id="selectAccountIds" resultType="java.lang.Long">
2022-04-20 19:12:01 +08:00
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
2022-04-20 19:12:01 +08:00
LEFT JOIN (SELECT
t.*
FROM
(
2022-04-14 11:54:16 +08:00
SELECT
2022-04-20 19:12:01 +08:00
log.resource_n,
log.dismissdate
2022-04-14 11:54:16 +08:00
FROM
2022-05-19 11:23:25 +08:00
bill_hrmdismiss log ) t) l
ON e.ID = l.resource_n
WHERE(
e.status != '5'
and (e.accounttype is null or e.accounttype = 0)
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.delete_type = 0 and
fund.fund_start_time IS NOT NULL AND fund.fund_start_time != ''
2022-04-20 19:12:01 +08:00
AND(
fund.fund_end_time IS NULL
OR fund.fund_end_time = ''
OR fund.fund_end_time > #{time}
)
)
OR (
2022-06-29 14:13:23 +08:00
social.delete_type = 0 and
social.social_start_time IS NOT NULL AND social.social_start_time != ''
<if test="paymentOrganization != null">
AND
-- 个税扣缴义务人
social.payment_organization = #{paymentOrganization}
</if>
2022-04-20 19:12:01 +08:00
AND(
social.social_end_time IS NULL
OR social.social_end_time = ''
OR social.social_end_time > #{time}
)
)
OR (
other.delete_type = 0 and
other.other_start_time IS NOT NULL AND other.other_start_time != ''
2022-04-20 19:12:01 +08:00
AND(
other.other_end_time IS NULL
OR other.other_end_time = ''
OR other.other_end_time > #{time}
)
)
) a
2022-04-14 11:54:16 +08:00
</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'-->
<!-- and (e.accounttype is null or e.accounttype = 0)-->
<!-- 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>-->
2022-05-30 11:27:39 +08:00
2022-04-14 11:54:16 +08:00
<select id="selectEmpByPaymentOrg" resultType="java.lang.Long">
SELECT employee_id
from hrsa_insurance_base_info base
where delete_type = 0
and base.payment_organization = #{paymentOrganization}
</select>
2022-04-14 11:54:16 +08:00
<!-- 根据主键删除记录 -->
2022-04-15 13:17:25 +08:00
<delete id="deleteById" parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO">
2022-04-14 11:54:16 +08:00
UPDATE hrsa_bill_detail
SET delete_type = 1
WHERE id = #{id}
AND delete_type = 0
2022-04-14 11:54:16 +08:00
</delete>
2022-04-15 13:17:25 +08:00
<delete id="batchDeleteNotFile" parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO">
DELETE
2022-04-15 13:17:25 +08:00
FROM hrsa_bill_detail
WHERE delete_type = 0
AND bill_month = #{billMonth}
AND bill_status = 0
<if test="paymentOrganization != null">
AND payment_organization = #{paymentOrganization}
</if>
2022-04-15 13:17:25 +08:00
</delete>
<delete id="batchDelSupplementAccountDetails">
UPDATE hrsa_bill_detail
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="pos" open="(" item="po" separator="," close=")">
#{po.id}
</foreach>
</delete>
<update id="batchUnConfirmedInspectDetails">
UPDATE
hrsa_bill_inspect
SET
inspect_status = 0
WHERE
delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
2022-04-15 19:01:09 +08:00
<update id="batchIgnoreInspectDetails">
UPDATE
hrsa_bill_inspect
SET
inspect_status = 1
WHERE
delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
2022-04-14 11:54:16 +08:00
<!-- 批量删除 -->
<delete id="batchDelAccountDetails">
UPDATE hrsa_bill_detail
SET delete_type = 1
WHERE delete_type = 0
AND payment_status = #{paymentStatus}
2022-04-14 11:54:16 +08:00
AND bill_month = #{billMonth}
2022-06-06 19:08:39 +08:00
AND payment_organization = #{paymentOrganization}
2022-04-20 19:12:01 +08:00
<if test="employeeIds != null and employeeIds.size()>0">
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
2022-04-20 19:12:01 +08:00
</if>
2022-04-14 11:54:16 +08:00
</delete>
<!-- 根据id批量删除 -->
<delete id="batchDelAccountDetailsByIds">
UPDATE hrsa_bill_detail
SET delete_type = 1
WHERE delete_type = 0
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
</delete>
2022-04-14 11:54:16 +08:00
2022-04-15 13:17:25 +08:00
<delete id="batchDelSupplementDetailsByIds">
UPDATE hrsa_bill_detail
SET delete_type = 1
WHERE delete_type = 0
AND employee_id IN
<foreach collection="pos" open="(" item="po" separator="," close=")">
#{po.employeeId}
</foreach>
</delete>
2022-04-14 11:54:16 +08:00
<insert id="batchSaveAccountDetails">
INSERT INTO hrsa_bill_detail
(employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
2022-04-22 18:05:19 +08:00
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
2022-06-06 19:08:39 +08:00
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
2022-04-14 11:54:16 +08:00
VALUES
<foreach collection="accounts" item="item" separator=",">
(
#{item.employeeId},
#{item.billMonth},
#{item.billStatus},
#{item.paymentStatus},
#{item.supplementaryMonth},
#{item.supplementaryProjects},
2022-04-14 11:54:16 +08:00
#{item.resourceFrom},
#{item.socialPayOrg},
#{item.socialAccount},
2022-04-22 18:05:19 +08:00
#{item.socialSchemeId},
#{item.socialPaymentBaseString},
2022-04-14 11:54:16 +08:00
#{item.fundPayOrg},
2022-04-22 18:05:19 +08:00
#{item.fundAccount},
#{item.supplementFundAccount},
#{item.fundSchemeId},
#{item.fundPaymentBaseString},
#{item.otherPayOrg},
#{item.otherSchemeId},
#{item.otherPaymentBaseString},
#{item.socialPerJson},
#{item.socialPerSum},
#{item.fundPerJson},
#{item.fundPerSum},
#{item.otherPerJson},
#{item.otherPerSum},
#{item.perSum},
#{item.socialComJson},
#{item.socialComSum},
#{item.fundComJson},
#{item.fundComSum},
#{item.otherComJson},
#{item.otherComSum},
#{item.comSum},
#{item.socialSum},
#{item.fundSum},
#{item.otherSum},
#{item.total},
#{item.creator},
#{item.createTime},
#{item.updateTime},
#{item.deleteType},
2022-06-06 19:08:39 +08:00
#{item.tenantKey},
#{item.paymentOrganization}
2022-04-14 11:54:16 +08:00
)
</foreach>
</insert>
2022-04-26 10:06:09 +08:00
<insert id="batchSaveAccountDetails" databaseId="oracle">
INSERT INTO hrsa_bill_detail
(employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
2022-04-22 18:05:19 +08:00
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
2022-06-06 19:08:39 +08:00
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
2022-04-14 11:54:16 +08:00
<foreach collection="accounts" item="item" separator="union all">
select
2022-08-16 20:01:47 +08:00
#{item.employeeId,jdbcType=DOUBLE},
#{item.billMonth,jdbcType=VARCHAR},
#{item.billStatus,jdbcType=INTEGER},
#{item.paymentStatus,jdbcType=INTEGER},
#{item.supplementaryMonth,jdbcType=VARCHAR},
#{item.supplementaryProjects,jdbcType=VARCHAR},
2022-08-16 20:01:47 +08:00
#{item.resourceFrom,jdbcType=INTEGER},
#{item.socialPayOrg,jdbcType=DOUBLE},
#{item.socialAccount,jdbcType=VARCHAR},
#{item.socialSchemeId,jdbcType=DOUBLE},
#{item.socialPaymentBaseString,jdbcType=VARCHAR},
#{item.fundPayOrg,jdbcType=DOUBLE},
#{item.fundAccount,jdbcType=VARCHAR},
#{item.supplementFundAccount,jdbcType=VARCHAR},
#{item.fundSchemeId,jdbcType=DOUBLE},
#{item.fundPaymentBaseString,jdbcType=VARCHAR},
#{item.otherPayOrg,jdbcType=DOUBLE},
#{item.otherSchemeId,jdbcType=DOUBLE},
#{item.otherPaymentBaseString,jdbcType=VARCHAR},
#{item.socialPerJson,jdbcType=VARCHAR},
#{item.socialPerSum,jdbcType=VARCHAR},
#{item.fundPerJson,jdbcType=VARCHAR},
#{item.fundPerSum,jdbcType=VARCHAR},
#{item.otherPerJson,jdbcType=VARCHAR},
#{item.otherPerSum,jdbcType=VARCHAR},
#{item.perSum,jdbcType=VARCHAR},
#{item.socialComJson,jdbcType=VARCHAR},
#{item.socialComSum,jdbcType=VARCHAR},
#{item.fundComJson,jdbcType=VARCHAR},
#{item.fundComSum,jdbcType=VARCHAR},
#{item.otherComJson,jdbcType=VARCHAR},
#{item.otherComSum,jdbcType=VARCHAR},
#{item.comSum,jdbcType=VARCHAR},
#{item.socialSum,jdbcType=VARCHAR},
#{item.fundSum,jdbcType=VARCHAR},
#{item.otherSum,jdbcType=VARCHAR},
#{item.total,jdbcType=VARCHAR},
#{item.creator,jdbcType=DOUBLE},
2022-04-22 18:05:19 +08:00
#{item.createTime},
#{item.updateTime},
#{item.deleteType},
2022-08-16 20:01:47 +08:00
#{item.tenantKey,jdbcType=VARCHAR},
#{item.paymentOrganization,jdbcType=DOUBLE}
2022-04-14 11:54:16 +08:00
from dual
</foreach>
</insert>
2022-04-26 10:06:09 +08:00
<insert id="batchSaveAccountDetails" databaseId="sqlserver">
2022-04-22 18:00:35 +08:00
<foreach collection="accounts" item="item" separator=";">
INSERT INTO hrsa_bill_detail
(employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string,
fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json,
social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum,
com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization)
VALUES
2022-04-14 11:54:16 +08:00
(
#{item.employeeId},
#{item.billMonth},
#{item.billStatus},
#{item.paymentStatus},
#{item.supplementaryMonth},
#{item.supplementaryProjects},
2022-04-14 11:54:16 +08:00
#{item.resourceFrom},
#{item.socialPayOrg},
#{item.socialAccount},
2022-04-22 18:05:19 +08:00
#{item.socialSchemeId},
#{item.socialPaymentBaseString},
2022-04-14 11:54:16 +08:00
#{item.fundPayOrg},
2022-04-22 18:05:19 +08:00
#{item.fundAccount},
#{item.supplementFundAccount},
#{item.fundSchemeId},
#{item.fundPaymentBaseString},
#{item.otherPayOrg},
#{item.otherSchemeId},
#{item.otherPaymentBaseString},
#{item.socialPerJson},
#{item.socialPerSum},
#{item.fundPerJson},
#{item.fundPerSum},
#{item.otherPerJson},
#{item.otherPerSum},
#{item.perSum},
#{item.socialComJson},
#{item.socialComSum},
#{item.fundComJson},
#{item.fundComSum},
#{item.otherComJson},
#{item.otherComSum},
#{item.comSum},
#{item.socialSum},
#{item.fundSum},
#{item.otherSum},
#{item.total},
#{item.creator},
#{item.createTime},
#{item.updateTime},
#{item.deleteType},
2022-06-06 19:08:39 +08:00
#{item.tenantKey},
#{item.paymentOrganization}
2022-04-14 11:54:16 +08:00
)
</foreach>
</insert>
2022-04-12 10:24:21 +08:00
<sql id="likeCondition" >
2022-04-16 16:43:33 +08:00
<if test="userName != null and userName != ''">
2022-04-19 17:46:24 +08:00
AND e.lastname like CONCAT('%',#{userName},'%')
2022-04-16 16:43:33 +08:00
</if>
2022-05-19 11:23:25 +08:00
</sql>
<sql id="likeCondition" databaseId="oracle">
2022-04-16 16:43:33 +08:00
<if test="userName != null and userName != ''">
2022-04-19 17:46:24 +08:00
AND e.lastname like '%'||#{userName}||'%'
2022-04-16 16:43:33 +08:00
</if>
2022-05-19 11:23:25 +08:00
</sql>
<sql id="likeCondition" databaseId="sqlserver">
2022-04-16 16:43:33 +08:00
<if test="userName != null and userName != ''">
2022-05-19 11:23:25 +08:00
AND e.lastname like '%'+#{userName}+'%'
2022-04-16 16:43:33 +08:00
</if>
2022-05-19 11:23:25 +08:00
</sql>
2022-04-16 16:43:33 +08:00
2022-05-19 11:23:25 +08:00
<select id="changeList" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO">
2022-04-16 16:43:33 +08:00
SELECT DISTINCT
a.employeeId,
a.userName,
a.departmentId,
a.jobNum,
a.telephone,
a.departmentName,
a.position,
a.userStatus,
a.hiredate,
a.dimissionDate,
a.siSchemeId,
a.fundSchemeId,
a.otherSchemeId
FROM
(
SELECT
t.*, social.social_start_time,
social.social_end_time,
fund.fund_start_time,
fund.fund_end_time,
other.other_start_time,
other.other_end_time,
social.social_scheme_id AS siSchemeId,
fund.fund_scheme_id AS fundSchemeId,
other.other_scheme_id AS otherSchemeId
FROM
(
SELECT
2022-04-19 17:46:24 +08:00
e.lastname AS userName,
e.jobtitle AS jobNum,
e.departmentid AS departmentId,
d.departmentname AS departmentName,
2022-05-09 11:18:54 +08:00
e.STATUS AS userStatus,
2022-04-19 17:46:24 +08:00
e.jobtitle AS position,
2022-04-16 16:43:33 +08:00
h.payment_status AS paymentStatus,
2022-04-19 17:46:24 +08:00
e.companystartdate AS hiredate,
l.dismissdate AS dimissionDate,
2022-04-16 16:43:33 +08:00
e.ID AS employeeId,
e.MOBILE AS telephone
FROM
hrsa_bill_detail h
2022-04-19 17:46:24 +08:00
LEFT JOIN hrmresource e ON e.ID = h.employee_id AND h.delete_type = 0
LEFT JOIN bill_hrmdismiss l ON e.ID = l.resource_n
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
2022-04-16 16:43:33 +08:00
WHERE
2022-06-06 10:19:11 +08:00
e.STATUS = 5 and (e.accounttype is null or e.accounttype = 0) AND h.payment_status = 0
2022-05-19 11:23:25 +08:00
<include refid="likeCondition"/>
2022-04-19 17:46:24 +08:00
AND(l.dismissdate IS NOT NULL)
2022-04-16 16:43:33 +08:00
)AS t
LEFT JOIN hrsa_social_archives social ON t.employeeId = social.employee_id AND social.delete_type = 0
LEFT JOIN hrsa_fund_archives fund ON t.employeeId = fund.employee_id AND fund.delete_type = 0
LEFT JOIN hrsa_other_archives other ON t.employeeId = other.employee_id AND other.delete_type = 0
WHERE
(
fund.fund_start_time IS NOT NULL
AND(
fund.fund_end_time IS NULL
OR fund.fund_end_time = ''
)
)
OR(
social.social_start_time IS NOT NULL
AND(
social.social_end_time IS NULL
OR social.social_end_time = ''
)
)
OR(
other.other_start_time IS NOT NULL
AND(
other.other_end_time IS NULL
OR other.other_end_time = ''
)
)
)a
UNION
2022-05-19 11:23:25 +08:00
SELECT
2022-04-16 16:43:33 +08:00
a.employeeId,
a.userName,
a.departmentId,
a.jobNum,
a.telephone,
a.departmentName,
a.position,
a.userStatus,
a.hiredate,
a.dimissionDate,
a.siSchemeId,
a.fundSchemeId,
a.otherSchemeId
FROM
(
SELECT
t.*, social.social_start_time,
social.social_end_time,
fund.fund_start_time,
fund.fund_end_time,
other.other_start_time,
other.other_end_time,
social.social_scheme_id AS siSchemeId,
fund.fund_scheme_id AS fundSchemeId,
other.other_scheme_id AS otherSchemeId
FROM
(
SELECT
2022-04-19 17:46:24 +08:00
e.lastname AS userName,
e.jobtitle AS jobNum,
e.departmentid AS departmentId,
d.departmentname AS departmentName,
2022-05-09 11:18:54 +08:00
e.STATUS AS userStatus,
2022-04-19 17:46:24 +08:00
e.jobtitle AS position,
e.companystartdate AS hiredate,
l.dismissdate AS dimissionDate,
2022-04-16 16:43:33 +08:00
e.ID AS employeeId,
e.MOBILE AS telephone
FROM
2022-04-19 17:46:24 +08:00
hrmresource e
LEFT JOIN bill_hrmdismiss l ON e.ID = l.resource_n
LEFT JOIN hrmdepartment d ON d.ID = e.departmentid
2022-04-16 16:43:33 +08:00
WHERE
2022-04-19 17:46:24 +08:00
e.STATUS not in (4,5,6,7)
2022-06-06 10:19:11 +08:00
and (e.accounttype is null or e.accounttype = 0)
2022-05-19 11:23:25 +08:00
<include refid="likeCondition"/>
2022-04-16 16:43:33 +08:00
AND(
2022-04-19 17:46:24 +08:00
l.dismissdate IS NULL OR l.dismissdate = ''
2022-04-16 16:43:33 +08:00
)
)AS t
LEFT JOIN hrsa_social_archives social ON t.employeeId = social.employee_id AND social.delete_type = 0
LEFT JOIN hrsa_fund_archives fund ON t.employeeId = fund.employee_id AND fund.delete_type = 0
LEFT JOIN hrsa_other_archives other ON t.employeeId = other.employee_id AND other.delete_type = 0
WHERE
(
(
fund.fund_start_time IS NULL
OR fund.fund_start_time = ''
)
AND(
fund.fund_end_time IS NULL
OR fund.fund_end_time = ''
)
)
AND(
(
social.social_start_time IS NULL
OR social.social_start_time = ''
)
AND(
social.social_end_time IS NULL
OR social.social_end_time = ''
)
)
AND(
(
other.other_start_time IS NULL
OR other.other_start_time = ''
)
AND(
other.other_end_time IS NULL
OR other.other_end_time = ''
)
)
)a
</select>
2022-05-19 11:23:25 +08:00
2022-10-10 09:43:57 +08:00
<update id="updateByEmployeeIdAndBillMonth"
parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO">
UPDATE hrsa_bill_detail
<set>
<if test="null != socialPerJson and '' != socialPerJson">social_per_json = #{socialPerJson},</if>
<if test="null != socialPerSum and '' != socialPerSum">social_per_sum = #{socialPerSum},</if>
<if test="null != fundPerJson and '' != fundPerJson">fund_per_json = #{fundPerJson},</if>
<if test="null != fundPerSum and '' != fundPerSum">fund_per_sum = #{fundPerSum},</if>
<if test="null != otherPerJson and '' != otherPerJson">other_per_json = #{otherPerJson},</if>
<if test="null != otherPerSum and '' != otherPerSum">other_per_sum = #{otherPerSum},</if>
<if test="null != perSum and '' != perSum">per_sum = #{perSum},</if>
<if test="null != comSum and '' != comSum">com_sum = #{comSum},</if>
<if test="null != socialComJson and '' != socialComJson">social_com_json = #{socialComJson},</if>
<if test="null != socialComSum and '' != socialComSum">social_com_sum = #{socialComSum},</if>
<if test="null != fundComJson and '' != fundComJson">fund_com_json = #{fundComJson},</if>
<if test="null != fundComSum and '' != fundComSum">fund_com_sum = #{fundComSum},</if>
<if test="null != otherComJson and '' != otherComJson">other_com_json = #{otherComJson},</if>
<if test="null != otherComSum and '' != otherComSum">other_com_sum = #{otherComSum},</if>
<if test="null != socialSum and '' != socialSum">social_sum = #{socialSum},</if>
<if test="null != fundSum and '' != fundSum">fund_sum = #{fundSum},</if>
<if test="null != otherSum and '' != otherSum">other_sum = #{otherSum},</if>
<if test="null != total and '' != total">total = #{total},</if>
<if test="null != updateTime">update_time = #{updateTime},</if>
2022-10-10 09:43:57 +08:00
<if test="null != supplementaryMonth and '' != supplementaryMonth">supplementary_month =
#{supplementaryMonth},
</if>
</set>
2022-09-20 10:13:05 +08:00
WHERE id = #{id}
2022-10-10 09:43:57 +08:00
</update>
2022-09-20 10:13:05 +08:00
2022-10-10 09:43:57 +08:00
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumnsNoJoin"/>
FROM hrsa_bill_detail t
WHERE delete_type = 0
</select>
2022-10-10 09:43:57 +08:00
<update id="batchUpdate" parameterType="java.util.List">
update hrsa_bill_detail
<trim prefix="set" suffixOverrides=",">
<trim prefix="social_payment_base_string =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.socialPaymentBaseString!=null">
when id=#{item.id} then #{item.socialPaymentBaseString}
</if>
</foreach>
</trim>
<trim prefix="fund_payment_base_string =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.fundPaymentBaseString!=null">
when id=#{item.id} then #{item.fundPaymentBaseString}
</if>
</foreach>
</trim>
<trim prefix="other_payment_base_string =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.otherPaymentBaseString!=null">
when id=#{item.id} then #{item.otherPaymentBaseString}
</if>
</foreach>
</trim>
2022-10-10 09:43:57 +08:00
<trim prefix="social_per_json =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.socialPerJson!=null">
when id=#{item.id} then #{item.socialPerJson}
</if>
</foreach>
</trim>
<trim prefix="social_per_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.socialPerSum!=null">
when id=#{item.id} then #{item.socialPerSum}
</if>
</foreach>
</trim>
<trim prefix="fund_per_json =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.fundPerJson!=null">
when id=#{item.id} then #{item.fundPerJson}
</if>
</foreach>
</trim>
<trim prefix="fund_per_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.fundPerSum!=null">
when id=#{item.id} then #{item.fundPerSum}
</if>
</foreach>
</trim>
<trim prefix="other_per_json =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.otherPerJson!=null">
when id=#{item.id} then #{item.otherPerJson}
</if>
</foreach>
</trim>
<trim prefix="other_per_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.otherPerSum!=null">
when id=#{item.id} then #{item.otherPerSum}
</if>
</foreach>
</trim>
<trim prefix="per_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.perSum!=null">
when id=#{item.id} then #{item.perSum}
</if>
</foreach>
</trim>
<trim prefix="social_com_json =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.socialComJson!=null">
when id=#{item.id} then #{item.socialComJson}
</if>
</foreach>
</trim>
<trim prefix="social_com_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.socialComSum!=null">
when id=#{item.id} then #{item.socialComSum}
</if>
</foreach>
</trim>
<trim prefix="fund_com_json =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.fundComJson!=null">
when id=#{item.id} then #{item.fundComJson}
</if>
</foreach>
</trim>
<trim prefix="fund_com_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.fundComSum!=null">
when id=#{item.id} then #{item.fundComSum}
</if>
</foreach>
</trim>
<trim prefix="other_com_json =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.otherComJson!=null">
when id=#{item.id} then #{item.otherComJson}
</if>
</foreach>
</trim>
<trim prefix="other_com_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.otherComSum!=null">
when id=#{item.id} then #{item.otherComSum}
</if>
</foreach>
</trim>
<trim prefix="com_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.comSum!=null">
when id=#{item.id} then #{item.comSum}
</if>
</foreach>
</trim>
<trim prefix="social_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.socialSum!=null">
when id=#{item.id} then #{item.socialSum}
</if>
</foreach>
</trim>
<trim prefix="fund_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.fundSum!=null">
when id=#{item.id} then #{item.fundSum}
</if>
</foreach>
</trim>
<trim prefix="other_sum =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.otherSum!=null">
when id=#{item.id} then #{item.otherSum}
</if>
</foreach>
</trim>
<trim prefix="total =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.total!=null">
when id=#{item.id} then #{item.total}
</if>
</foreach>
</trim>
2022-10-10 14:55:36 +08:00
<trim prefix="delete_type =case" suffix="end,">
<foreach collection="collection" item="item" index="index">
<if test="item.deleteType!=null">
when id=#{item.id} then #{item.deleteType}
</if>
</foreach>
</trim>
2022-10-10 09:43:57 +08:00
</trim>
where
id in
<foreach collection="collection" item="item" index="index" separator="," open="(" close=")">
#{item.id}
</foreach>
</update>
<select id="getById" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
hrsa_bill_detail t
left join hrmresource e on e.ID = t.employee_id
WHERE t.delete_type = 0
and t.id = #{id}
</select>
<update id="updateById" parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO">
UPDATE hrsa_bill_detail
<set>
<if test="null != socialPerJson and '' != socialPerJson">social_per_json = #{socialPerJson},</if>
<if test="null != socialPerSum and '' != socialPerSum">social_per_sum = #{socialPerSum},</if>
<if test="null != fundPerJson and '' != fundPerJson">fund_per_json = #{fundPerJson},</if>
<if test="null != fundPerSum and '' != fundPerSum">fund_per_sum = #{fundPerSum},</if>
<if test="null != otherPerJson and '' != otherPerJson">other_per_json = #{otherPerJson},</if>
<if test="null != otherPerSum and '' != otherPerSum">other_per_sum = #{otherPerSum},</if>
<if test="null != perSum and '' != perSum">per_sum = #{perSum},</if>
<if test="null != comSum and '' != comSum">com_sum = #{comSum},</if>
<if test="null != socialComJson and '' != socialComJson">social_com_json = #{socialComJson},</if>
<if test="null != socialComSum and '' != socialComSum">social_com_sum = #{socialComSum},</if>
<if test="null != fundComJson and '' != fundComJson">fund_com_json = #{fundComJson},</if>
<if test="null != fundComSum and '' != fundComSum">fund_com_sum = #{fundComSum},</if>
<if test="null != otherComJson and '' != otherComJson">other_com_json = #{otherComJson},</if>
<if test="null != otherComSum and '' != otherComSum">other_com_sum = #{otherComSum},</if>
<if test="null != socialSum and '' != socialSum">social_sum = #{socialSum},</if>
<if test="null != fundSum and '' != fundSum">fund_sum = #{fundSum},</if>
<if test="null != otherSum and '' != otherSum">other_sum = #{otherSum},</if>
<if test="null != total and '' != total">total = #{total},</if>
<if test="null != updateTime">update_time = #{updateTime},</if>
<if test="null != supplementaryMonth and '' != supplementaryMonth">supplementary_month =
#{supplementaryMonth},
</if>
</set>
WHERE id = #{id}
</update>
<delete id="deleteRecessionData" parameterType="com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO">
UPDATE hrsa_bill_detail
SET delete_type = 1
WHERE delete_type = 0
AND bill_month = #{billMonth}
AND payment_status = #{paymentStatus}
AND payment_organization = #{paymentOrganization}
AND supplementary_month = #{supplementaryMonth}
AND employee_id = #{employeeId}
</delete>
<select id="getOneByBpep" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id,t.social_per_json,t.social_com_json,
t.fund_per_json,t.fund_com_json,t.other_per_json,
t.other_com_json,t.social_per_sum,t.social_com_sum,
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization,
t.total, t.social_sum, t.fund_sum, t.other_sum
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.bill_month = #{billMonth}
AND t.payment_status = #{paymentStatus}
AND t.payment_organization = #{paymentOrganization}
AND t.employee_id = #{employeeId}
</select>
<select id="queryBalanceList" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id,t.social_per_json,t.social_com_json,
t.fund_per_json,t.fund_com_json,t.other_per_json,
t.other_com_json,t.social_per_sum,t.social_com_sum,
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization,
t.total, t.social_sum, t.fund_sum, t.other_sum, t.bill_month
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.bill_month = #{billMonth}
AND t.payment_status = 4
AND t.payment_organization = #{paymentOrganization}
AND t.employee_id = #{employeeId}
</select>
2022-04-12 10:24:21 +08:00
</mapper>