2022-10-31 16:19:42 +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.datacollection.SpecialAddDeductionMapper">
|
2022-11-02 17:27:07 +08:00
|
|
|
<resultMap id="BaseResultMap" type="com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
<!--@Table hrsa_special_add_deduction-->
|
|
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
|
|
<result column="employee_id" jdbcType="BIGINT" property="employeeId"/>
|
|
|
|
|
<result column="tax_agent_id" jdbcType="BIGINT" property="taxAgentId"/>
|
|
|
|
|
<result column="children_education" jdbcType="VARCHAR" property="childrenEducation"/>
|
|
|
|
|
<result column="continuing_education" jdbcType="VARCHAR" property="continuingEducation"/>
|
|
|
|
|
<result column="housing_loan_interest" jdbcType="VARCHAR" property="housingLoanInterest"/>
|
|
|
|
|
<result column="housing_rent" jdbcType="VARCHAR" property="housingRent"/>
|
|
|
|
|
<result column="supporting_elder" jdbcType="VARCHAR" property="supportingElder"/>
|
|
|
|
|
<result column="serious_illness_treatment" jdbcType="VARCHAR" property="seriousIllnessTreatment"/>
|
|
|
|
|
<result column="infant_care" jdbcType="VARCHAR" property="infantCare"/>
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
|
|
<result column="creator" jdbcType="BIGINT" property="creator"/>
|
|
|
|
|
<result column="delete_type" jdbcType="INTEGER" property="deleteType"/>
|
|
|
|
|
<result column="tenant_key" jdbcType="VARCHAR" property="tenantKey"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
t1.id,
|
|
|
|
|
t1.employee_id,
|
|
|
|
|
t1.tax_agent_id,
|
|
|
|
|
t1.children_education,
|
|
|
|
|
t1.continuing_education,
|
|
|
|
|
t1.housing_loan_interest,
|
|
|
|
|
t1.housing_rent,
|
|
|
|
|
t1.supporting_elder,
|
|
|
|
|
t1.serious_illness_treatment,
|
|
|
|
|
t1.infant_care,
|
|
|
|
|
t1.create_time,
|
|
|
|
|
t1.update_time,
|
|
|
|
|
t1.creator,
|
|
|
|
|
t1.delete_type,
|
|
|
|
|
t1.tenant_key
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="Special_Column_List">
|
|
|
|
|
t1.id,
|
|
|
|
|
t1.employee_id,
|
|
|
|
|
t2.id AS tax_agent_id,
|
|
|
|
|
t2.name AS tax_agent_name,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
e.certificatenum as idNo,
|
|
|
|
|
d.departmentname AS departmentName,
|
|
|
|
|
e.mobile,
|
|
|
|
|
e.workcode as job_num,
|
|
|
|
|
e.companystartdate as hiredate,
|
|
|
|
|
t1.children_education,
|
|
|
|
|
t1.continuing_education,
|
|
|
|
|
t1.housing_loan_interest,
|
|
|
|
|
t1.housing_rent,
|
|
|
|
|
t1.serious_illness_treatment,
|
|
|
|
|
t1.supporting_elder,
|
|
|
|
|
t1.infant_care
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="paramSql">
|
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
|
|
|
AND t1.id IN
|
|
|
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
2022-11-04 15:16:27 +08:00
|
|
|
<if test="param.specialAddDeductionId != null">
|
|
|
|
|
AND t1.id = #{param.specialAddDeductionId}
|
|
|
|
|
</if>
|
2022-11-02 17:27:07 +08:00
|
|
|
<if test="param.employeeId != null">
|
|
|
|
|
AND t1.employee_id = #{param.employeeId}
|
|
|
|
|
</if>
|
|
|
|
|
<!-- 关键字(姓名、部门、工号 -->
|
|
|
|
|
<if test="param.keyword != null and param.keyword != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.lastname like CONCAT('%',#{param.keyword},'%')
|
|
|
|
|
OR d.departmentname like CONCAT('%',#{param.keyword},'%')
|
|
|
|
|
OR e.workcode like CONCAT('%',#{param.keyword},'%')
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<!-- 姓名 -->
|
|
|
|
|
<if test="param.username != null and param.username != ''">
|
|
|
|
|
AND e.lastname like CONCAT('%',#{param.username},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<!-- 个税扣缴义务人 -->
|
|
|
|
|
<if test="param.taxAgentId != null">
|
|
|
|
|
AND t1.tax_agent_id = #{param.taxAgentId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
|
|
|
|
AND t1.tax_agent_id IN
|
|
|
|
|
<foreach collection="param.taxAgentIds" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<!-- 部门 -->
|
|
|
|
|
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
|
|
|
|
AND d.id IN
|
|
|
|
|
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<!-- 工号 -->
|
|
|
|
|
<if test="param.jobNum != null and param.jobNum != ''">
|
|
|
|
|
AND e.workcode like CONCAT('%',#{param.jobNum},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<!-- 入职日期 -->
|
|
|
|
|
<if test="param.hiredate != null and param.hiredate.size() == 2">
|
|
|
|
|
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
|
|
|
|
|
</if>
|
|
|
|
|
<!-- 手机号 -->
|
|
|
|
|
<if test="param.mobile != null and param.mobile != ''">
|
|
|
|
|
AND e.mobile like CONCAT('%',#{param.mobile},'%')
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="paramSql" databaseId="oracle">
|
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
|
|
|
AND t1.id IN
|
|
|
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
2022-11-04 15:16:27 +08:00
|
|
|
<if test="param.specialAddDeductionId != null">
|
|
|
|
|
AND t1.id = #{param.specialAddDeductionId}
|
|
|
|
|
</if>
|
2022-11-02 17:27:07 +08:00
|
|
|
<if test="param.employeeId != null">
|
|
|
|
|
AND t1.employee_id = #{param.employeeId}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.keyword != null and param.keyword != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.lastname like '%'||#{param.keyword}||'%'
|
|
|
|
|
OR d.departmentname like '%'||#{param.keyword}||'%'
|
|
|
|
|
OR e.workcode like '%'||#{param.keyword}||'%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.username != null and param.username != ''">
|
|
|
|
|
AND e.lastname like '%'||#{param.username}||'%'
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.taxAgentId != null">
|
|
|
|
|
AND t1.tax_agent_id = #{param.taxAgentId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
|
|
|
|
AND t1.tax_agent_id IN
|
|
|
|
|
<foreach collection="param.taxAgentIds" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
|
|
|
|
AND d.id IN
|
|
|
|
|
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.jobNum != null and param.jobNum != ''">
|
|
|
|
|
AND e.workcode like '%'||#{param.jobNum}||'%'
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.hiredate != null and param.hiredate.size() == 2">
|
|
|
|
|
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.mobile != null and param.mobile != ''">
|
|
|
|
|
AND e.mobile like '%'||#{param.mobile}||'%'
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="paramSql" databaseId="sqlserver">
|
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
|
|
|
AND t1.id IN
|
|
|
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
2022-11-04 15:16:27 +08:00
|
|
|
<if test="param.specialAddDeductionId != null">
|
|
|
|
|
AND t1.id = #{param.specialAddDeductionId}
|
|
|
|
|
</if>
|
2022-11-02 17:27:07 +08:00
|
|
|
<if test="param.employeeId != null">
|
|
|
|
|
AND t1.employee_id = #{param.employeeId}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.keyword != null and param.keyword != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.lastname like '%'+#{param.keyword}+'%'
|
|
|
|
|
OR d.departmentname like '%'+#{param.keyword}+'%'
|
|
|
|
|
OR e.workcode like '%'+#{param.keyword}+'%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.username != null and param.username != ''">
|
|
|
|
|
AND e.lastname like '%'+#{param.username}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.taxAgentId != null">
|
|
|
|
|
AND t1.tax_agent_id = #{param.taxAgentId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
|
|
|
|
AND t1.tax_agent_id IN
|
|
|
|
|
<foreach collection="param.taxAgentIds" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
|
|
|
|
AND d.id IN
|
|
|
|
|
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.jobNum != null and param.jobNum != ''">
|
|
|
|
|
AND e.workcode like '%'+#{param.jobNum}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.hiredate != null and param.hiredate.size() == 2">
|
|
|
|
|
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.mobile != null and param.mobile != ''">
|
|
|
|
|
AND e.mobile like '%'+#{param.mobile}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="getById" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from hrsa_special_add_deduction t1
|
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
|
</select>
|
|
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id"
|
|
|
|
|
parameterType="com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into hrsa_special_add_deduction
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="employeeId != null">
|
|
|
|
|
employee_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="taxAgentId != null">
|
|
|
|
|
tax_agent_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="childrenEducation != null">
|
|
|
|
|
children_education,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="continuingEducation != null">
|
|
|
|
|
continuing_education,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="housingLoanInterest != null">
|
|
|
|
|
housing_loan_interest,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="housingRent != null">
|
|
|
|
|
housing_rent,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supportingElder != null">
|
|
|
|
|
supporting_elder,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="seriousIllnessTreatment != null">
|
|
|
|
|
serious_illness_treatment,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="infantCare != null">
|
|
|
|
|
infant_care,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creator != null">
|
|
|
|
|
creator,
|
|
|
|
|
</if>
|
|
|
|
|
delete_type,
|
|
|
|
|
<if test="tenantKey != null">
|
|
|
|
|
tenant_key,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="employeeId != null">
|
|
|
|
|
#{employeeId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="taxAgentId != null">
|
|
|
|
|
#{taxAgentId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="childrenEducation != null">
|
|
|
|
|
#{childrenEducation,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="continuingEducation != null">
|
|
|
|
|
#{continuingEducation,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="housingLoanInterest != null">
|
|
|
|
|
#{housingLoanInterest,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="housingRent != null">
|
|
|
|
|
#{housingRent,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supportingElder != null">
|
|
|
|
|
#{supportingElder,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="seriousIllnessTreatment != null">
|
|
|
|
|
#{seriousIllnessTreatment,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="infantCare != null">
|
|
|
|
|
#{infantCare,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creator != null">
|
|
|
|
|
#{creator,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
0,
|
|
|
|
|
<if test="tenantKey != null">
|
|
|
|
|
#{tenantKey,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateByPrimaryKeySelective"
|
|
|
|
|
parameterType="com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update hrsa_special_add_deduction
|
|
|
|
|
<set>
|
|
|
|
|
<if test="employeeId != null">
|
|
|
|
|
employee_id = #{employeeId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="taxAgentId != null">
|
|
|
|
|
tax_agent_id = #{taxAgentId,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="childrenEducation != null">
|
|
|
|
|
children_education = #{childrenEducation,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="continuingEducation != null">
|
|
|
|
|
continuing_education = #{continuingEducation,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="housingLoanInterest != null">
|
|
|
|
|
housing_loan_interest = #{housingLoanInterest,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="housingRent != null">
|
|
|
|
|
housing_rent = #{housingRent,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supportingElder != null">
|
|
|
|
|
supporting_elder = #{supportingElder,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="seriousIllnessTreatment != null">
|
|
|
|
|
serious_illness_treatment = #{seriousIllnessTreatment,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="infantCare != null">
|
|
|
|
|
infant_care = #{infantCare,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creator != null">
|
|
|
|
|
creator = #{creator,jdbcType=BIGINT},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deleteType != null">
|
|
|
|
|
delete_type = #{deleteType,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tenantKey != null">
|
|
|
|
|
tenant_key = #{tenantKey,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateBatchSelective" parameterType="java.util.List">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update hrsa_special_add_deduction
|
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
|
<trim prefix="employee_id = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.employeeId != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.employeeId,jdbcType=BIGINT}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="tax_agent_id = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.taxAgentId != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.taxAgentId,jdbcType=BIGINT}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="children_education = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.childrenEducation != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.childrenEducation,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="continuing_education = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.continuingEducation != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.continuingEducation,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="housing_loan_interest = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.housingLoanInterest != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.housingLoanInterest,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="housing_rent = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.housingRent != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.housingRent,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="supporting_elder = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.supportingElder != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.supportingElder,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="serious_illness_treatment = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.seriousIllnessTreatment != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.seriousIllnessTreatment,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="infant_care = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.infantCare != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.infantCare,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="create_time = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.createTime != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.createTime,jdbcType=TIMESTAMP}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="update_time = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.updateTime != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="creator = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.creator != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.creator,jdbcType=BIGINT}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="delete_type = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.deleteType != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.deleteType,jdbcType=INTEGER}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="tenant_key = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.tenantKey != null">
|
|
|
|
|
when id = #{item.id,jdbcType=BIGINT} then #{item.tenantKey,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
</trim>
|
|
|
|
|
where id in
|
|
|
|
|
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
|
|
|
|
#{item.id,jdbcType=BIGINT}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into hrsa_special_add_deduction
|
2022-11-04 09:41:32 +08:00
|
|
|
(employee_id, tax_agent_id, children_education, continuing_education,
|
2022-11-02 17:27:07 +08:00
|
|
|
housing_loan_interest, housing_rent, supporting_elder, serious_illness_treatment,
|
|
|
|
|
infant_care, create_time, update_time, creator, delete_type, tenant_key)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(#{item.employeeId,jdbcType=BIGINT}, #{item.taxAgentId,jdbcType=BIGINT},
|
|
|
|
|
#{item.childrenEducation,jdbcType=VARCHAR}, #{item.continuingEducation,jdbcType=VARCHAR},
|
|
|
|
|
#{item.housingLoanInterest,jdbcType=VARCHAR}, #{item.housingRent,jdbcType=VARCHAR},
|
|
|
|
|
#{item.supportingElder,jdbcType=VARCHAR}, #{item.seriousIllnessTreatment,jdbcType=VARCHAR},
|
|
|
|
|
#{item.infantCare,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{item.creator,jdbcType=BIGINT}, 0, #{item.tenantKey,jdbcType=VARCHAR})
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<select id="listDtoByParam" resultType="com.engine.salary.entity.datacollection.dto.SpecialAddDeductionRecordDTO">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Special_Column_List"/>
|
|
|
|
|
from hrsa_special_add_deduction t1
|
|
|
|
|
LEFT JOIN hrsa_tax_agent t2 ON t1.tax_agent_id = t2.id
|
|
|
|
|
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
|
|
|
|
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
|
|
|
|
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
|
|
|
|
WHERE
|
|
|
|
|
t1.delete_type = 0 AND t2.delete_type = 0
|
|
|
|
|
AND e.status not in (7)
|
|
|
|
|
and (e.accounttype is null or e.accounttype = 0)
|
|
|
|
|
<include refid="paramSql"/>
|
2022-11-04 15:16:27 +08:00
|
|
|
ORDER BY t1.create_time desc
|
2022-11-02 17:27:07 +08:00
|
|
|
</select>
|
|
|
|
|
|
2022-11-04 09:41:32 +08:00
|
|
|
<select id="listByTaxAgentIds" resultMap="BaseResultMap">
|
2022-11-02 17:27:07 +08:00
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from hrsa_special_add_deduction t1
|
|
|
|
|
LEFT JOIN hrsa_tax_agent t2 ON t1.tax_agent_id = t2.id
|
|
|
|
|
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
|
|
|
|
WHERE
|
|
|
|
|
t1.delete_type = 0 AND t2.delete_type = 0
|
|
|
|
|
AND e.status not in (7)
|
|
|
|
|
and (e.accounttype is null or e.accounttype = 0)
|
|
|
|
|
<if test="taxAgentIds != null and taxAgentIds.size() != 0">
|
|
|
|
|
AND t1.tax_agent_id IN
|
|
|
|
|
<foreach collection="taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
|
|
|
|
|
#{taxAgentId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listByParam" resultType="com.engine.salary.entity.datacollection.dto.SpecialAddDeductionListDTO">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Special_Column_List"/>
|
|
|
|
|
from hrsa_special_add_deduction t1
|
|
|
|
|
LEFT JOIN hrsa_tax_agent t2 ON t1.tax_agent_id = t2.id
|
|
|
|
|
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
|
|
|
|
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
|
|
|
|
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
|
|
|
|
WHERE
|
|
|
|
|
t1.delete_type = 0 AND t2.delete_type = 0
|
|
|
|
|
AND e.status not in (7)
|
|
|
|
|
and (e.accounttype is null or e.accounttype = 0)
|
|
|
|
|
<include refid="paramSql"/>
|
2022-11-04 15:16:27 +08:00
|
|
|
<if test="param.orderRule != null ">
|
|
|
|
|
order by ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
|
|
|
|
</if>
|
2022-11-02 17:27:07 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteByIds">
|
|
|
|
|
update hrsa_special_add_deduction
|
|
|
|
|
set delete_type = 1
|
|
|
|
|
where id in (
|
|
|
|
|
<foreach collection="ids" item="id" separator=",">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
) and delete_type = 0
|
|
|
|
|
</delete>
|
2022-11-04 15:16:27 +08:00
|
|
|
|
|
|
|
|
<select id="getByEmployeeIds" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
2022-11-07 16:20:21 +08:00
|
|
|
from hrsa_special_add_deduction t1
|
2022-11-08 13:46:56 +08:00
|
|
|
<where>
|
|
|
|
|
<if test="employeeIds != null and employeeIds.size() != 0">
|
|
|
|
|
<foreach collection="employeeIds" item="employeeId" separator="," open="employee_id in (" close=") ">
|
|
|
|
|
#{employeeId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
and tax_agent_id = #{taxAgentId}
|
|
|
|
|
and delete_type = 0
|
|
|
|
|
</where>
|
2022-11-04 15:16:27 +08:00
|
|
|
</select>
|
2022-10-31 16:19:42 +08:00
|
|
|
</mapper>
|