weaver-hrm-salary/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml

200 lines
6.2 KiB
XML
Raw Normal View History

2022-03-15 17:39:19 +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" >
2022-03-16 17:04:21 +08:00
<mapper namespace="com.engine.salary.mapper.siarchives.FundSchemeMapper">
2022-03-15 17:39:19 +08:00
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO">
<result column="id" property="id"/>
<result column="employee_id" property="employeeId"/>
<result column="non_payment" property="nonPayment"/>
<result column="welfare_type" property="welfareType"/>
<result column="fund_start_time" property="fundStartTime"/>
<result column="fund_end_time" property="fundEndTime"/>
<result column="fund_scheme_id" property="fundSchemeId"/>
<result column="fund_account" property="fundAccount"/>
<result column="supplement_fund_account" property="supplementFundAccount"/>
<result column="payment_organization" property="paymentOrganization"/>
<result column="under_take" property="underTake"/>
<result column="fund_payment_base_string" property="fundPaymentBaseString"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t.id
, t.employee_id
, t.non_payment
, t.welfare_type
, t.fund_start_time
, t.fund_end_time
, t.fund_scheme_id
, t.fund_account
, t.supplement_fund_account
, t.payment_organization
, t.under_take
, t.fund_payment_base_string
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
</sql>
2022-03-18 18:00:51 +08:00
<!-- 根据人员获取记录 -->
2022-03-15 17:39:19 +08:00
<select id="getFundByEmployeeId" resultMap="BaseResultMap" >
SELECT
<include refid="baseColumns"/>
FROM hrsa_fund_archives t
2022-03-18 18:00:51 +08:00
WHERE delete_type = 0
2022-04-19 17:46:24 +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>
2022-03-15 17:39:19 +08:00
</select>
2022-03-17 15:26:33 +08:00
<!-- 批量删除 -->
<delete id="batchDeleteByEmployeeIds">
UPDATE hrsa_fund_archives
SET delete_type = 1
WHERE delete_type = 0
2022-04-19 17:46:24 +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>
2022-03-17 15:26:33 +08:00
</delete>
<!-- 批量保存 -->
<insert id="batchSave">
INSERT INTO hrsa_fund_archives(
fund_scheme_id,
fund_account,
fund_end_time,
fund_start_time,
fund_payment_base_string,
supplement_fund_account,
create_time,
creator,
non_payment,
delete_type,
tenant_key,
under_take,
payment_organization,
update_time,
welfare_type,
employee_id)
VALUES
<foreach collection="fundSchemePOS" item="item" separator=",">
(
#{item.fundSchemeId},
#{item.fundAccount},
#{item.fundEndTime},
#{item.fundStartTime},
#{item.fundPaymentBaseString},
2022-04-21 14:08:18 +08:00
#{item.supplementFundAccount},
#{item.createTime},
#{item.creator},
#{item.nonPayment},
#{item.deleteType},
#{item.tenantKey},
#{item.underTake},
#{item.paymentOrganization},
#{item.updateTime},
#{item.welfareType},
2022-03-17 15:26:33 +08:00
#{item.employeeId}
)
</foreach>
</insert>
<insert id="batchSave" databaseId="oracle">
INSERT INTO hrsa_fund_archives(
fund_scheme_id,
fund_account,
fund_end_time,
fund_start_time,
fund_payment_base_string,
supplement_fund_account,
create_time,
creator,
non_payment,
delete_type,
tenant_key,
under_take,
payment_organization,
update_time,
welfare_type,
employee_id)
<foreach collection="fundSchemePOS" item="item" separator="union all">
select
#{item.fundSchemeId},
#{item.fundAccount},
#{item.fundEndTime},
#{item.fundStartTime},
#{item.fundPaymentBaseString},
2022-04-21 14:08:18 +08:00
#{item.supplementFundAccount},
#{item.createTime},
#{item.creator},
#{item.nonPayment},
#{item.deleteType},
#{item.tenantKey},
#{item.underTake},
#{item.paymentOrganization},
#{item.updateTime},
#{item.welfareType},
2022-03-17 15:26:33 +08:00
#{item.employeeId}
from dual
</foreach>
</insert>
<insert id="batchSave" databaseId="sqlserver">
INSERT INTO hrsa_fund_archives(
fund_scheme_id,
fund_account,
fund_end_time,
fund_start_time,
fund_payment_base_string,
supplement_fund_account,
create_time,
creator,
non_payment,
delete_type,
tenant_key,
under_take,
payment_organization,
update_time,
welfare_type,
employee_id)
VALUES
<foreach collection="fundSchemePOS" item="item" separator=",">
(
#{item.fundSchemeId},
#{item.fundAccount},
#{item.fundEndTime},
#{item.fundStartTime},
#{item.fundPaymentBaseString},
2022-04-21 14:08:18 +08:00
#{item.supplementFundAccount},
#{item.createTime},
#{item.creator},
#{item.nonPayment},
#{item.deleteType},
#{item.tenantKey},
#{item.underTake},
#{item.paymentOrganization},
#{item.updateTime},
#{item.welfareType},
2022-03-17 15:26:33 +08:00
#{item.employeeId}
)
</foreach>
</insert>
2022-03-15 17:39:19 +08:00
</mapper>