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

182 lines
5.7 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.OtherSchemeMapper">
2022-03-15 17:39:19 +08:00
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO">
<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="other_start_time" property="otherStartTime"/>
<result column="other_end_time" property="otherEndTime"/>
<result column="other_scheme_id" property="otherSchemeId"/>
<result column="payment_organization" property="paymentOrganization"/>
<result column="under_take" property="underTake"/>
<result column="other_payment_base_string" property="otherPaymentBaseString"/>
<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.other_start_time
, t.other_end_time
, t.other_scheme_id
, t.payment_organization
, t.under_take
, t.other_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="getOtherByEmployeeId" resultMap="BaseResultMap" >
SELECT
<include refid="baseColumns"/>
FROM hrsa_other_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_other_archives
SET delete_type = 1
WHERE delete_type = 0
AND employee_id IN
2022-04-19 17:46:24 +08:00
<if test="employeeIds != null and employeeIds.size()>0">
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
2022-03-17 15:26:33 +08:00
</delete>
2022-03-15 17:39:19 +08:00
2022-03-17 15:26:33 +08:00
<!-- 批量保存 -->
<insert id="batchSave">
INSERT INTO hrsa_other_archives(
other_scheme_id,
other_start_time,
under_take,
tenant_key,
welfare_type,
other_end_time,
employee_id,
delete_type,
update_time,
create_time,
non_payment,
creator,
payment_organization,
other_payment_base_string)
VALUES
<foreach collection="otherSchemePOS" item="item" separator=",">
(
#{item.otherSchemeId},
#{item.otherStartTime},
#{item.underTake},
#{item.tenantKey},
#{item.welfareType},
2022-04-21 14:08:18 +08:00
#{item.otherEndTime},
#{item.employeeId},
#{item.deleteType},
#{item.updateTime},
#{item.createTime},
#{item.nonPayment},
#{item.creator},
#{item.paymentOrganization},
2022-03-17 15:26:33 +08:00
#{item.otherPaymentBaseString}
)
</foreach>
</insert>
<insert id="batchSave" databaseId="oracle">
INSERT INTO hrsa_other_archives(
other_scheme_id,
other_start_time,
under_take,
tenant_key,
welfare_type,
other_end_time,
employee_id,
delete_type,
update_time,
create_time,
non_payment,
creator,
payment_organization,
other_payment_base_string)
<foreach collection="otherSchemePOS" item="item" separator="union all">
select
#{item.otherSchemeId},
#{item.otherStartTime},
#{item.underTake},
#{item.tenantKey},
#{item.welfareType},
2022-04-21 14:08:18 +08:00
#{item.otherEndTime},
#{item.employeeId},
#{item.deleteType},
#{item.updateTime},
#{item.createTime},
#{item.nonPayment},
#{item.creator},
#{item.paymentOrganization},
2022-03-17 15:26:33 +08:00
#{item.otherPaymentBaseString}
from dual
</foreach>
</insert>
<insert id="batchSave" databaseId="sqlserver">
INSERT INTO hrsa_other_archives(
other_scheme_id,
other_start_time,
under_take,
tenant_key,
welfare_type,
other_end_time,
employee_id,
delete_type,
update_time,
create_time,
non_payment,
creator,
payment_organization,
other_payment_base_string)
VALUES
<foreach collection="otherSchemePOS" item="item" separator=",">
(
#{item.otherSchemeId},
#{item.otherStartTime},
#{item.underTake},
#{item.tenantKey},
#{item.welfareType},
2022-04-21 14:08:18 +08:00
#{item.otherEndTime},
#{item.employeeId},
#{item.deleteType},
#{item.updateTime},
#{item.createTime},
#{item.nonPayment},
#{item.creator},
#{item.paymentOrganization},
2022-03-17 15:26:33 +08:00
#{item.otherPaymentBaseString}
)
</foreach>
</insert>
2022-03-15 17:39:19 +08:00
</mapper>