<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~
  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
  ~
  ~  Redistribution and use in source and binary forms, with or without
  ~  modification, are permitted provided that the following conditions are met:
  ~
  ~ Redistributions of source code must retain the above copyright notice,
  ~  this list of conditions and the following disclaimer.
  ~  Redistributions in binary form must reproduce the above copyright
  ~  notice, this list of conditions and the following disclaimer in the
  ~  documentation and/or other materials provided with the distribution.
  ~  Neither the name of the yifu4cloud.com developer nor the names of its
  ~  contributors may be used to endorse or promote products derived from
  ~  this software without specific prior written permission.
  ~  Author: lengleng (wangiegie@gmail.com)
  ~
  -->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundHistoryMapper">

  <resultMap id="tSocialFundHistoryMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundHistory">
    <id property="id" column="ID"/>
    <result property="empName" column="EMP_NAME"/>
    <result property="empIdcard" column="ID_CARD"/>
    <result property="empId" column="EMP_ID"/>
	<result property="unitPensionCardinal" column="UNIT_PENSION_CARDINAL"/>
    <result property="unitMedicalCardinal" column="UNIT_MEDICAL_CARDINAL"/>
    <result property="unitUnemploymentCardinal" column="UNIT_UNEMPLOYMENT_CARDINAL"/>
    <result property="unitWorkInjuryCardinal" column="UNIT_WORK_INJURY_CARDINAL"/>
    <result property="unitBirthCardinal" column="UNIT_BIRTH_CARDINAL"/>
    <result property="unitBigailmentCardinal" column="UNIT_BIGAILMENT_CARDINAL"/>

    <result property="unitPersionPro" column="UNIT_PERSION_PRO"/>
    <result property="unitPersionMoney" column="UNIT_PERSION_MONEY"/>
    <result property="unitMedicalPro" column="UNIT_MEDICAL_PRO"/>
    <result property="unitMedicalMoney" column="UNIT_MEDICAL_MONEY"/>
    <result property="unitUnemploymentPro" column="UNIT_UNEMPLOYMENT_PRO"/>
    <result property="unitUnemploymentMoney" column="UNIT_UNEMPLOYMENT_MONEY"/>
    <result property="unitInjuryPro" column="UNIT_INJURY_PRO"/>
    <result property="unitInjuryMoney" column="UNIT_INJURY_MONEY"/>
    <result property="unitBirthPro" column="UNIT_BIRTH_PRO"/>
    <result property="unitBirthMoney" column="UNIT_BIRTH_MONEY"/>
    <result property="unitBigailmentPro" column="UNIT_BIGAILMENT_PRO"/>
    <result property="unitBigailmentMoney" column="UNIT_BIGAILMENT_MONEY"/>
    <result property="personalPersionPro" column="PERSONAL_PERSION_PRO"/>
    <result property="personalPersionMoney" column="PERSONAL_PERSION_MONEY"/>
    <result property="personalMedicalPro" column="PERSONAL_MEDICAL_PRO"/>
    <result property="personalMedicalMoney" column="PERSONAL_MEDICAL_MONEY"/>
    <result property="personalUnemploymentPro" column="PERSONAL_UNEMPLOYMENT_PRO"/>
    <result property="personalUnemploymentMoney" column="PERSONAL_UNEMPLOYMENT_MONEY"/>
    <result property="personalBigailmentPro" column="PERSONAL_BIGAILMENT_PRO"/>
    <result property="personalBigailmentMoney" column="PERSONAL_BIGAILMENT_MONEY"/>
    <result property="unitFundBase" column="UNIT_FUND_BASE"/>
    <result property="personalFundBase" column="PERSONAL_FUND_BASE"/>
    <result property="unitFundProp" column="UNIT_FUND_PROP"/>
    <result property="personalFundProp" column="PERSONAL_FUND_PROP"/>
    <result property="unitFundMoney" column="UNIT_FUND_MONEY"/>
    <result property="personalFundMoney" column="PERSONAL_FUND_MONEY"/>
    <result property="paymentType" column="PAYMENT_TYPE"/>
    <result property="isSocial" column="IS_SOCIAL"/>
    <result property="isFund" column="IS_FUND"/>
    <result property="socialFundId" column="SOCIAL_FUND_ID"/>
    <result property="createBy" column="CREATE_BY"/>
    <result property="updateBy" column="UPDATE_BY"/>
    <result property="createName" column="CREATE_NAME"/>
    <result property="updateTime" column="UPDATE_TIME"/>
  </resultMap>
    <sql id="Base_Column_List">
			a.ID,
			a.EMP_NAME,
			a.EMP_IDCARD,
			a.EMP_ID,

			a.UNIT_PENSION_CARDINAL,
			a.UNIT_MEDICAL_CARDINAL,
			a.UNIT_UNEMPLOYMENT_CARDINAL,
			a.UNIT_WORK_INJURY_CARDINAL,
			a.UNIT_BIRTH_CARDINAL,
			a.UNIT_BIGAILMENT_CARDINAL,

			a.UNIT_PERSION_PRO,
			a.UNIT_PERSION_MONEY,
			a.UNIT_MEDICAL_PRO,
			a.UNIT_MEDICAL_MONEY,
			a.UNIT_UNEMPLOYMENT_PRO,
			a.UNIT_UNEMPLOYMENT_MONEY,
			a.UNIT_INJURY_PRO,
			a.UNIT_INJURY_MONEY,
			a.UNIT_BIRTH_PRO,
			a.UNIT_BIRTH_MONEY,
			a.UNIT_BIGAILMENT_PRO,
			a.UNIT_BIGAILMENT_MONEY,
			a.PERSONAL_PERSION_PRO,
			a.PERSONAL_PERSION_MONEY,
			a.PERSONAL_MEDICAL_PRO,
			a.PERSONAL_MEDICAL_MONEY,
			a.PERSONAL_UNEMPLOYMENT_PRO,
			a.PERSONAL_UNEMPLOYMENT_MONEY,
			a.PERSONAL_BIGAILMENT_PRO,
			a.PERSONAL_BIGAILMENT_MONEY,
			a.UNIT_FUND_BASE,
			a.PERSONAL_FUND_BASE,
			a.UNIT_FUND_PROP,
			a.PERSONAL_FUND_PROP,
			a.UNIT_FUND_MONEY,
			a.PERSONAL_FUND_MONEY,
			a.PAYMENT_TYPE,
			a.IS_SOCIAL,
			a.IS_FUND,
			a.SOCIAL_FUND_ID,
			a.CREATE_BY,
			a.UPDATE_BY,
			a.CREATE_NAME,
			a.UPDATE_TIME
    </sql>
    <sql id="tSocialFundHistory_where">
        <if test="tSocialFundHistory != null">
				<if test="tSocialFundHistory.id != null and tSocialFundHistory.id.trim() != ''">
					AND a.ID = #{tSocialFundHistory.id}
				</if>
				<if test="tSocialFundHistory.empName != null and tSocialFundHistory.empName.trim() != ''">
					AND a.EMP_NAME = #{tSocialFundHistory.empName}
				</if>
				<if test="tSocialFundHistory.empIdcard != null and tSocialFundHistory.empIdcard.trim() != ''">
					AND a.EMP_IDCARD = #{tSocialFundHistory.empIdcard}
				</if>
				<if test="tSocialFundHistory.empId != null and tSocialFundHistory.empId.trim() != ''">
					AND a.EMP_ID = #{tSocialFundHistory.empId}
				</if>

				<if test="tSocialFundHistory.unitPersionPro != null">
					AND a.UNIT_PERSION_PRO = #{tSocialFundHistory.unitPersionPro}
				</if>
				<if test="tSocialFundHistory.unitPersionMoney != null">
					AND a.UNIT_PERSION_MONEY = #{tSocialFundHistory.unitPersionMoney}
				</if>
				<if test="tSocialFundHistory.unitMedicalPro != null">
					AND a.UNIT_MEDICAL_PRO = #{tSocialFundHistory.unitMedicalPro}
				</if>
				<if test="tSocialFundHistory.unitMedicalMoney != null">
					AND a.UNIT_MEDICAL_MONEY = #{tSocialFundHistory.unitMedicalMoney}
				</if>
				<if test="tSocialFundHistory.unitUnemploymentPro != null">
					AND a.UNIT_UNEMPLOYMENT_PRO = #{tSocialFundHistory.unitUnemploymentPro}
				</if>
				<if test="tSocialFundHistory.unitUnemploymentMoney != null">
					AND a.UNIT_UNEMPLOYMENT_MONEY = #{tSocialFundHistory.unitUnemploymentMoney}
				</if>
				<if test="tSocialFundHistory.unitInjuryPro != null">
					AND a.UNIT_INJURY_PRO = #{tSocialFundHistory.unitInjuryPro}
				</if>
				<if test="tSocialFundHistory.unitInjuryMoney != null">
					AND a.UNIT_INJURY_MONEY = #{tSocialFundHistory.unitInjuryMoney}
				</if>
				<if test="tSocialFundHistory.unitBirthPro != null">
					AND a.UNIT_BIRTH_PRO = #{tSocialFundHistory.unitBirthPro}
				</if>
				<if test="tSocialFundHistory.unitBirthMoney != null">
					AND a.UNIT_BIRTH_MONEY = #{tSocialFundHistory.unitBirthMoney}
				</if>
				<if test="tSocialFundHistory.unitBigailmentPro != null">
					AND a.UNIT_BIGAILMENT_PRO = #{tSocialFundHistory.unitBigailmentPro}
				</if>
				<if test="tSocialFundHistory.unitBigailmentMoney != null">
					AND a.UNIT_BIGAILMENT_MONEY = #{tSocialFundHistory.unitBigailmentMoney}
				</if>
				<if test="tSocialFundHistory.personalPersionPro != null">
					AND a.PERSONAL_PERSION_PRO = #{tSocialFundHistory.personalPersionPro}
				</if>
				<if test="tSocialFundHistory.personalPersionMoney != null">
					AND a.PERSONAL_PERSION_MONEY = #{tSocialFundHistory.personalPersionMoney}
				</if>
				<if test="tSocialFundHistory.personalMedicalPro != null">
					AND a.PERSONAL_MEDICAL_PRO = #{tSocialFundHistory.personalMedicalPro}
				</if>
				<if test="tSocialFundHistory.personalMedicalMoney != null">
					AND a.PERSONAL_MEDICAL_MONEY = #{tSocialFundHistory.personalMedicalMoney}
				</if>
				<if test="tSocialFundHistory.personalUnemploymentPro != null">
					AND a.PERSONAL_UNEMPLOYMENT_PRO = #{tSocialFundHistory.personalUnemploymentPro}
				</if>
				<if test="tSocialFundHistory.personalUnemploymentMoney != null">
					AND a.PERSONAL_UNEMPLOYMENT_MONEY = #{tSocialFundHistory.personalUnemploymentMoney}
				</if>
				<if test="tSocialFundHistory.personalBigailmentPro != null">
					AND a.PERSONAL_BIGAILMENT_PRO = #{tSocialFundHistory.personalBigailmentPro}
				</if>
				<if test="tSocialFundHistory.personalBigailmentMoney != null">
					AND a.PERSONAL_BIGAILMENT_MONEY = #{tSocialFundHistory.personalBigailmentMoney}
				</if>
				<if test="tSocialFundHistory.unitFundBase != null">
					AND a.UNIT_FUND_BASE = #{tSocialFundHistory.unitFundBase}
				</if>
				<if test="tSocialFundHistory.personalFundBase != null">
					AND a.PERSONAL_FUND_BASE = #{tSocialFundHistory.personalFundBase}
				</if>
				<if test="tSocialFundHistory.unitFundProp != null">
					AND a.UNIT_FUND_PROP = #{tSocialFundHistory.unitFundProp}
				</if>
				<if test="tSocialFundHistory.personalFundProp != null">
					AND a.PERSONAL_FUND_PROP = #{tSocialFundHistory.personalFundProp}
				</if>
				<if test="tSocialFundHistory.unitFundMoney != null">
					AND a.UNIT_FUND_MONEY = #{tSocialFundHistory.unitFundMoney}
				</if>
				<if test="tSocialFundHistory.personalFundMoney != null">
					AND a.PERSONAL_FUND_MONEY = #{tSocialFundHistory.personalFundMoney}
				</if>
				<if test="tSocialFundHistory.paymentType != null">
					AND a.PAYMENT_TYPE = #{tSocialFundHistory.paymentType}
				</if>
				<if test="tSocialFundHistory.isSocial != null">
					AND a.IS_SOCIAL = #{tSocialFundHistory.isSocial}
				</if>
				<if test="tSocialFundHistory.isFund != null">
					AND a.IS_FUND = #{tSocialFundHistory.isFund}
				</if>
				<if test="tSocialFundHistory.socialFundId != null and tSocialFundHistory.socialFundId.trim() != ''">
					AND a.SOCIAL_FUND_ID = #{tSocialFundHistory.socialFundId}
				</if>
				<if test="tSocialFundHistory.createBy != null and tSocialFundHistory.createBy.trim() != ''">
					AND a.CREATE_BY = #{tSocialFundHistory.createBy}
				</if>
				<if test="tSocialFundHistory.updateBy != null and tSocialFundHistory.updateBy.trim() != ''">
					AND a.UPDATE_BY = #{tSocialFundHistory.updateBy}
				</if>
				<if test="tSocialFundHistory.createName != null and tSocialFundHistory.createName.trim() != ''">
					AND a.CREATE_NAME = #{tSocialFundHistory.createName}
				</if>
				<if test="tSocialFundHistory.updateTime != null">
					AND a.UPDATE_TIME = #{tSocialFundHistory.updateTime}
				</if>
        </if>
    </sql>
    <!--tSocialFundHistory简单分页查询-->
    <select id="getTSocialFundHistoryPage" resultMap="tSocialFundHistoryMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_social_fund_history a
        <where>
            1=1
            <include refid="tSocialFundHistory_where"/>
        </where>
    </select>
</mapper>
