薪酬系统-福利档案基础信息表实体和mapper
This commit is contained in:
parent
7ffd295be0
commit
ad16c96910
|
|
@ -0,0 +1,80 @@
|
|||
package com.engine.salary.entity.siarchives.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: sy
|
||||
* @Description: 社保福利档案基础信息
|
||||
* @Date: 2022/10/8
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_insurance_base_info
|
||||
public class InsuranceArchivesBaseInfoPO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人id
|
||||
*/
|
||||
private Long paymentOrganization;
|
||||
|
||||
/**
|
||||
* 社保档案id
|
||||
*/
|
||||
private Long socialArchivesId;
|
||||
|
||||
/**
|
||||
* 公积金档案id
|
||||
*/
|
||||
private Long fundArchivesId;
|
||||
|
||||
/**
|
||||
* 其他福利档案id
|
||||
*/
|
||||
private Long otherArchivesId;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 福利执行状态
|
||||
*/
|
||||
private String runStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.engine.salary.mapper.siarchives;
|
||||
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author sy
|
||||
* @Date 2022/10/08
|
||||
**/
|
||||
public interface InsuranceBaseInfoMapper {
|
||||
|
||||
/**
|
||||
* 获取当前福利档案基础信息(由当前的社保、公积金、其他福利信息表获取)
|
||||
* 当设置employeeIds时,则是通过人员id、社保、公积金、其他福利信息表获取指定人员的福利档案基础信息
|
||||
*/
|
||||
List<InsuranceArchivesBaseInfoPO> getInsuranceBaseInfoListByInsuranceDetail(@Param("employeeIds")List<Long> employeeIds);
|
||||
|
||||
/**
|
||||
* 获取当前福利档案基础信息(由福利档案基础信息表获取)
|
||||
*/
|
||||
List<InsuranceArchivesBaseInfoPO> getInsuranceBaseInfoList();
|
||||
|
||||
/**
|
||||
* 批量保存
|
||||
*/
|
||||
void batchSave(@Param("infos") List<InsuranceArchivesBaseInfoPO> infos);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
void batchDeleteByEmployeeIds(@Param("employeeIds")List<Long> employeeIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
<?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.siarchives.InsuranceBaseInfoMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="employee_id" property="employeeId"/>
|
||||
<result column="payment_organization" property="paymentOrganization"/>
|
||||
<result column="social_archives_id" property="socialArchivesId"/>
|
||||
<result column="fund_archives_id" property="fundArchivesId"/>
|
||||
<result column="other_archives_id" property="otherArchivesId"/>
|
||||
<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"/>
|
||||
<result column="run_status" property="runStatus"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.employee_id
|
||||
, t.payment_organization
|
||||
, t.social_archives_id
|
||||
, t.fund_archives_id
|
||||
, t.other_archives_id
|
||||
, t.run_status
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
</sql>
|
||||
|
||||
<select id="getInsuranceBaseInfoListByInsuranceDetail" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">
|
||||
SELECT social.employee_id,
|
||||
social.id AS socialArchivesId,
|
||||
social.payment_organization,
|
||||
fund.id AS fundArchivesId,
|
||||
other.id AS otherArchivesId
|
||||
FROM hrsa_social_archives social
|
||||
LEFT JOIN( SELECT fund.employee_id, fund.id FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON social.employee_id = fund.employee_id
|
||||
LEFT JOIN( SELECT other.employee_id, other.id FROM hrsa_other_archives other WHERE other.delete_type = 0 )other ON social.employee_id = other.employee_id
|
||||
WHERE
|
||||
social.delete_type = 0
|
||||
<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="getInsuranceBaseInfoList" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_insurance_base_info
|
||||
WHERE
|
||||
delete_type = 0
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="batchSave">
|
||||
INSERT INTO hrsa_insurance_base_info
|
||||
(id,employee_id,payment_organization,social_archives_id,fund_archives_id,other_archives_id,tenant_key,creator,delete_type,create_time,update_time,run_status)
|
||||
VALUES
|
||||
<foreach collection="infos" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.employeeId},
|
||||
#{item.paymentOrganization},
|
||||
#{item.socialArchivesId},
|
||||
#{item.fundArchivesId},
|
||||
#{item.otherArchivesId},
|
||||
#{item.tenantKey},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.runStatus}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchSave" databaseId="oracle">
|
||||
INSERT INTO hrsa_insurance_base_info
|
||||
(id,employee_id,payment_organization,social_archives_id,fund_archives_id,other_archives_id,tenant_key,creator,delete_type,create_time,update_time,run_status)
|
||||
<foreach collection="infos" item="item" separator="union all">
|
||||
select
|
||||
#{item.id,jdbcType=DOUBLE},
|
||||
#{item.employeeId,jdbcType=DOUBLE},
|
||||
#{item.paymentOrganization,jdbcType=DOUBLE},
|
||||
#{item.socialArchivesId,jdbcType=DOUBLE},
|
||||
#{item.fundArchivesId,jdbcType=DOUBLE},
|
||||
#{item.otherArchivesId,jdbcType=DOUBLE},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item.deleteType},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.runStatus,jdbcType=VARCHAR}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchSave" databaseId="sqlserver">
|
||||
<foreach collection="infos" item="item" separator=";">
|
||||
INSERT INTO hrsa_insurance_base_info
|
||||
(id,employee_id,payment_organization,social_archives_id,fund_archives_id,other_archives_id,tenant_key,creator,delete_type,create_time,update_time,run_status)
|
||||
VALUES
|
||||
(
|
||||
#{item.id},
|
||||
#{item.employeeId},
|
||||
#{item.paymentOrganization},
|
||||
#{item.socialArchivesId},
|
||||
#{item.fundArchivesId},
|
||||
#{item.otherArchivesId},
|
||||
#{item.tenantKey},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.runStatus}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="batchDeleteByEmployeeIds">
|
||||
UPDATE hrsa_insurance_base_info
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
<if test="employeeIds != null and employeeIds.size()>0">
|
||||
AND employee_id IN
|
||||
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||
#{employeeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue