<?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.TSocialFundInfoMapper">

	<resultMap id="tSocialFundInfoMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo">
		<id property="id" column="ID"/>
		<result property="empId" column="EMP_ID"/>
		<result property="empNo" column="EMP_NO"/>
		<result property="empName" column="EMP_NAME"/>
		<result property="empIdcard" column="EMP_IDCARD"/>
		<result property="empType" column="EMP_TYPE"/>
		<result property="settleDomain" column="SETTLE_DOMAIN"/>
		<result property="settleDomainCode" column="SETTLE_DOMAIN_CODE"/>
		<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
		<result property="unitName" column="UNIT_NAME"/>
		<result property="unitId" column="UNIT_ID"/>

		<result property="settleDomainFund" column="SETTLE_DOMAIN_FUND"/>
		<result property="settleDomainCodeFund" column="SETTLE_DOMAIN_CODE_FUND"/>
		<result property="settleDomainNameFund" column="SETTLE_DOMAIN_NAME_FUND"/>
		<result property="unitNameFund" column="UNIT_NAME_FUND"/>
		<result property="unitIdFund" column="UNIT_ID_FUND"/>

		<result property="socialHousehold" column="SOCIAL_HOUSEHOLD"/>
		<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
		<result property="socialProvince" column="SOCIAL_PROVINCE"/>
		<result property="socialCity" column="SOCIAL_CITY"/>
		<result property="socialTown" column="SOCIAL_TOWN"/>
		<result property="providentHousehold" column="PROVIDENT_HOUSEHOLD"/>
		<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
		<result property="fundProvince" column="FUND_PROVINCE"/>
		<result property="fundCity" column="FUND_CITY"/>
		<result property="fundTown" column="FUND_TOWN"/>
		<result property="socialAddStatus" column="SOCIAL_ADD_STATUS"/>
		<result property="fundAddStatus" column="FUND_ADD_STATUS"/>
		<result property="socialReduceStatus" column="SOCIAL_REDUCE_STATUS"/>
		<result property="fundReduceStatus" column="FUND_REDUCE_STATUS"/>
		<result property="socialId" column="SOCIAL_ID"/>
		<result property="fundId" column="FUND_ID"/>
		<result property="createBy" column="CREATE_BY"/>
		<result property="updateBy" column="UPDATE_BY"/>
		<result property="createName" column="CREATE_NAME"/>
		<result property="createTime" column="CREATE_TIME"/>
		<result property="updateTime" column="UPDATE_TIME"/>
		<result property="firstBuyMonthSocial" column="FIRST_BUY_MONTH_SOCIAL"/>
		<result property="unitPensionCardinal" column="UNIT_PENSION_CARDINAL"/>
		<result property="unitMedicalCardinal" column="UNIT_MEDICAL_CARDINAL"/>
		<result property="unitUnemploymentCardinal" column="UNIT_UNEMPLOYMENT_CARDINAL"/>
		<result property="unitBigailmentCardinal" column="UNIT_BIGAILMENT_CARDINAL"/>
		<result property="unitWorkInjuryCardinal" column="UNIT_WORK_INJURY_CARDINAL"/>
		<result property="unitBirthCardinal" column="UNIT_BIRTH_CARDINAL"/>
		<result property="personalPensionCardinal" column="PERSONAL_PENSION_CARDINAL"/>
		<result property="personalMedicalCardinal" column="PERSONAL_MEDICAL_CARDINAL"/>
		<result property="personalBigailmentCardinal" column="PERSONAL_BIGAILMENT_CARDINAL"/>
		<result property="personalUnemploymentCardinal" column="PERSONAL_UNEMPLOYMENT_CARDINAL"/>
		<result property="unitPensionPer" column="UNIT_PENSION_PER"/>
		<result property="unitMedicalPer" column="UNIT_MEDICAL_PER"/>
		<result property="unitUnemploymentPer" column="UNIT_UNEMPLOYMENT_PER"/>
		<result property="unitWorkUnjuryPer" column="UNIT_WORK_UNJURY_PER"/>
		<result property="unitBirthPer" column="UNIT_BIRTH_PER"/>
		<result property="personalPensionPer" column="PERSONAL_PENSION_PER"/>
		<result property="personalMedicalPer" column="PERSONAL_MEDICAL_PER"/>
		<result property="personalUnemploymentPer" column="PERSONAL_UNEMPLOYMENT_PER"/>
		<result property="handleStatus" column="HANDLE_STATUS"/>
		<result property="personalBigailmentPer" column="PERSONAL_BIGAILMENT_PER"/>
		<result property="unitBigailmentPer" column="UNIT_BIGAILMENT_PER"/>
		<result property="socialReduceDate" column="SOCIAL_REDUCE_DATE"/>
		<result property="canOverpay" column="CAN_OVERPAY"/>
		<result property="payPolicy" column="PAY_POLICY"/>
		<result property="overpayNumber" column="OVERPAY_NUMBER"/>
		<result property="haveThisMonth" column="HAVE_THIS_MONTH"/>
		<result property="insurancePension" column="INSURANCE_PENSION"/>
		<result property="insuranceMedical" column="INSURANCE_MEDICAL"/>
		<result property="insuranceUnemployment" column="INSURANCE_UNEMPLOYMENT"/>
		<result property="insuranceInjury" column="INSURANCE_INJURY"/>
		<result property="insuranceBirth" column="INSURANCE_BIRTH"/>
		<result property="insuranceBigailment" column="INSURANCE_BIGAILMENT"/>
		<result property="latestCardinality" column="LATEST_CARDINALITY"/>
		<result property="isIllness" column="IS_ILLNESS"/>
		<result property="collectType" column="COLLECT_TYPE"/>
		<result property="valueType" column="VALUE_TYPE"/>
		<result property="collectMoth" column="COLLECT_MOTH"/>
		<result property="isChargePersonal" column="IS_CHARGE_PERSONAL"/>
		<result property="recordBase" column="RECORD_BASE"/>
		<result property="trustRemark" column="TRUST_REMARK"/>
		<result property="paymentType" column="PAYMENT_TYPE"/>
		<result property="upperLimit" column="UPPER_LIMIT"/>
		<result property="lowerLimit" column="LOWER_LIMIT"/>
		<result property="pensionStart" column="PENSION_START"/>
		<result property="medicalStart" column="MEDICAL_START"/>
		<result property="unemployStart" column="UNEMPLOY_START"/>
		<result property="workInjuryStart" column="WORK_INJURY_START"/>
		<result property="birthStart" column="BIRTH_START"/>
		<result property="bigailmentStart" column="BIGAILMENT_START"/>
		<result property="pensionHandle" column="PENSION_HANDLE"/>
		<result property="medicalHandle" column="MEDICAL_HANDLE"/>
		<result property="unemployHandle" column="UNEMPLOY_HANDLE"/>
		<result property="workInjuryHandle" column="WORK_INJURY_HANDLE"/>
		<result property="birthHandle" column="BIRTH_HANDLE"/>
		<result property="bigailmentHandle" column="BIGAILMENT_HANDLE"/>
		<result property="unitPersionMoney" column="UNIT_PERSION_MONEY"/>
		<result property="unitMedicalMoney" column="UNIT_MEDICAL_MONEY"/>
		<result property="unitUnemploymentMoney" column="UNIT_UNEMPLOYMENT_MONEY"/>
		<result property="unitInjuryMoney" column="UNIT_INJURY_MONEY"/>
		<result property="unitBirthMoney" column="UNIT_BIRTH_MONEY"/>
		<result property="unitBigailmentMoney" column="UNIT_BIGAILMENT_MONEY"/>
		<result property="personalPersionMoney" column="PERSONAL_PERSION_MONEY"/>
		<result property="personalMedicalMoney" column="PERSONAL_MEDICAL_MONEY"/>
		<result property="personalUnemploymentMoney" column="PERSONAL_UNEMPLOYMENT_MONEY"/>
		<result property="personalBigailmentMoney" column="PERSONAL_BIGAILMENT_MONEY"/>
		<result property="unitProvidengCardinal" column="UNIT_PROVIDENG_CARDINAL"/>
		<result property="personalProvidentCardinal" column="PERSONAL_PROVIDENT_CARDINAL"/>
		<result property="socialStartDate" column="SOCIAL_START_DATE"/>
		<result property="unitProvidentPer" column="UNIT_PROVIDENT_PER"/>
		<result property="personalProvidentPer" column="PERSONAL_PROVIDENT_PER"/>
		<result property="providentStart" column="PROVIDENT_START"/>
		<result property="firstBuyMothFund" column="FIRST_BUY_MOTH_FUND"/>
		<result property="upperLimitFund" column="UPPER_LIMIT_FUND"/>
		<result property="lowerLimitFund" column="LOWER_LIMIT_FUND"/>
		<result property="fundPayPoint" column="FUND_PAY_POINT"/>
		<result property="canOverpayFund" column="CAN_OVERPAY_FUND"/>
		<result property="overpayNumberFund" column="OVERPAY_NUMBER_FUND"/>
		<result property="payPolicyFund" column="PAY_POLICY_FUND"/>
		<result property="trustRemarkFund" column="TRUST_REMARK_FUND"/>
		<result property="haveThisMonthFund" column="HAVE_THIS_MONTH_FUND"/>
		<result property="latestCardinalityFund" column="LATEST_CARDINALITY_FUND"/>
		<result property="fundReduceDate" column="FUND_REDUCE_DATE"/>

		<result property="personalFundSum" column="PERSONAL_FUND_SUM"/>
		<result property="unitFundSum" column="UNIT_FUND_SUM"/>
		<result property="unitSocialSum" column="UNIT_SOCIAL_SUM"/>
		<result property="personalSocialSum" column="PERSONAL_SOCIAL_SUM"/>
		<result property="unitInterestFee" column="UNIT_INTEREST_FEE"/>
		<result property="personalInterestFee" column="PERSONAL_INTEREST_FEE"/>
		<result property="socialStatus" column="SOCIAL_STATUS"/>
		<result property="fundStatus" column="FUND_STATUS"/>
		<result property="dispatchId" column="DISPATCH_ID"/>

	</resultMap>

	<!-- 社保公积金查询的导出专用 -->
	<resultMap id="exportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TSocialFundInfoExportVo">
		<id property="id" column="ID"/>
		<result property="empName" column="EMP_NAME"/>
		<result property="empIdcard" column="EMP_IDCARD"/>
		<result property="empType" column="EMP_TYPE"/>
		<result property="empMobile" column="EMP_MOBILE"/>
		<result property="settleDomainCode" column="SETTLE_DOMAIN_CODE"/>
		<result property="unitName" column="UNIT_NAME"/>
		<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
		<result property="idCardProvince" column="ID_CARD_PROVINCE"/>
		<result property="idCardCity" column="ID_CARD_CITY"/>
		<result property="idCardTown" column="ID_CARD_TOWN"/>
		<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
		<result property="fileProvince" column="FILE_PROVINCE"/>
		<result property="fileCity" column="FILE__CITY"/>
		<result property="fileTown" column="FILE__TOWN"/>
		<result property="post" column="POST"/>
		<result property="tryPeriod" column="TRY_PERIOD"/>
		<result property="workingHours" column="WORKING_HOURS"/>
		<result property="contractName" column="CONTRACT_NAME"/>
		<result property="contractSubName" column="CONTRACT_SUB_NAME"/>
		<result property="contractParty" column="CONTRACT_PARTY"/>
		<result property="contractType" column="CONTRACT_TYPE"/>
		<result property="contractStart" column="CONTRACT_START"/>
		<result property="contractEnd" column="CONTRACT_END"/>
		<result property="contractTerm" column="CONTRACT_TERM"/>
		<result property="educationName" column="EDUCATION_NAME"/>
		<result property="recordBase" column="RECORD_BASE"/>
		<result property="socialStatus" column="SOCIAL_STATUS"/>
		<result property="fundStatus" column="FUND_STATUS"/>
		<result property="socialStartDate" column="SOCIAL_START_DATE"/>
		<result property="providentStart" column="PROVIDENT_START"/>
		<result property="socialReduceDate" column="SOCIAL_REDUCE_DATE"/>
		<result property="fundReduceDate" column="FUND_REDUCE_DATE"/>
		<result property="unitSocialSum" column="UNIT_SOCIAL_SUM"/>
		<result property="personalSocialSum" column="PERSONAL_SOCIAL_SUM"/>
		<result property="unitFundSum" column="UNIT_FUND_SUM"/>
		<result property="personalFundSum" column="PERSONAL_FUND_SUM"/>
		<result property="allSum" column="ALL_SUM"/>
		<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
		<result property="socialProvince" column="SOCIAL_PROVINCE"/>
		<result property="socialCity" column="SOCIAL_CITY"/>
		<result property="socialTown" column="SOCIAL_TOWN"/>
		<result property="pensionStart" column="PENSION_START"/>
		<result property="medicalStart" column="MEDICAL_START"/>
		<result property="unemployStart" column="UNEMPLOY_START"/>
		<result property="workInjuryStart" column="WORK_INJURY_START"/>
		<result property="birthStart" column="BIRTH_START"/>
		<result property="bigailmentStart" column="BIGAILMENT_START"/>
		<result property="paymentType" column="PAYMENT_TYPE"/>

		<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="unitPensionPer" column="UNIT_PENSION_PER"/>
		<result property="unitMedicalPer" column="UNIT_MEDICAL_PER"/>
		<result property="unitUnemploymentPer" column="UNIT_UNEMPLOYMENT_PER"/>
		<result property="unitWorkUnjuryPer" column="UNIT_WORK_UNJURY_PER"/>
		<result property="unitBirthPer" column="UNIT_BIRTH_PER"/>
		<result property="unitBigailmentPer" column="UNIT_BIGAILMENT_PER"/>
		<result property="unitPersionMoney" column="UNIT_PERSION_MONEY"/>
		<result property="unitMedicalMoney" column="UNIT_MEDICAL_MONEY"/>
		<result property="unitUnemploymentMoney" column="UNIT_UNEMPLOYMENT_MONEY"/>
		<result property="unitInjuryMoney" column="UNIT_INJURY_MONEY"/>
		<result property="unitBirthMoney" column="UNIT_BIRTH_MONEY"/>
		<result property="unitBigailmentMoney" column="UNIT_BIGAILMENT_MONEY"/>

		<result property="personalPensionPer" column="PERSONAL_PENSION_PER"/>
		<result property="personalMedicalPer" column="PERSONAL_MEDICAL_PER"/>
		<result property="personalUnemploymentPer" column="PERSONAL_UNEMPLOYMENT_PER"/>
		<result property="personalBigailmentPer" column="PERSONAL_BIGAILMENT_PER"/>
		<result property="personalPersionMoney" column="PERSONAL_PERSION_MONEY"/>
		<result property="personalMedicalMoney" column="PERSONAL_MEDICAL_MONEY"/>
		<result property="personalUnemploymentMoney" column="PERSONAL_UNEMPLOYMENT_MONEY"/>
		<result property="personalBigailmentMoney" column="PERSONAL_BIGAILMENT_MONEY"/>

		<result property="persionMoney" column="PERSION_MONEY"/>
		<result property="medicalMoney" column="MEDICAL_MONEY"/>
		<result property="unemploymentMoney" column="UNEMPLOYMENT_MONEY"/>
		<result property="bigailmentMoney" column="BIGAILMENT_MONEY"/>

		<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
		<result property="fundProvince" column="FUND_PROVINCE"/>
		<result property="fundCity" column="FUND_CITY"/>
		<result property="fundTown" column="FUND_TOWN"/>
		<result property="unitProvidengCardinal" column="UNIT_PROVIDENG_CARDINAL"/>
		<result property="unitProvidentPer" column="UNIT_PROVIDENT_PER"/>
		<result property="personalProvidentPer" column="PERSONAL_PROVIDENT_PER"/>
		<result property="unitFundSum2" column="UNIT_FUND_SUM2"/>
		<result property="personalFundSum2" column="PERSONAL_FUND_SUM2"/>
		<result property="fundSum" column="FUND_SUM"/>

		<result property="trustRemark" column="TRUST_REMARK"/>
	</resultMap>
	<sql id="Base_Column_List">
				a.ID,
                a.EMP_ID,
                a.EMP_NO,
                a.EMP_NAME,
                a.EMP_IDCARD,
                a.EMP_TYPE,
                a.SETTLE_DOMAIN,
                if(a.SETTLE_DOMAIN_CODE = a.SETTLE_DOMAIN_CODE_FUND,a.SETTLE_DOMAIN_CODE,concat(ifnull(a.SETTLE_DOMAIN_CODE,""),if(a.SETTLE_DOMAIN_CODE is null or a.SETTLE_DOMAIN_CODE_FUND is null,"",","),ifnull(a.SETTLE_DOMAIN_CODE_FUND,""))) SETTLE_DOMAIN_CODE,
				if(a.SETTLE_DOMAIN_NAME = a.SETTLE_DOMAIN_NAME_FUND,a.SETTLE_DOMAIN_NAME,concat(ifnull(a.SETTLE_DOMAIN_NAME,""),if(a.SETTLE_DOMAIN_NAME is null or a.SETTLE_DOMAIN_NAME_FUND is null,"",","),ifnull(a.SETTLE_DOMAIN_NAME_FUND,""))) SETTLE_DOMAIN_NAME,
				if(a.UNIT_NAME = a.UNIT_NAME_FUND,a.UNIT_NAME,concat(ifnull(a.UNIT_NAME,""),if(a.UNIT_NAME is null or a.UNIT_NAME_FUND is null,"",","),ifnull(a.UNIT_NAME_FUND,""))) UNIT_NAME,
                a.UNIT_ID,
 				a.SETTLE_DOMAIN_FUND,
				a.SETTLE_DOMAIN_CODE_FUND,
                a.SETTLE_DOMAIN_NAME_FUND,
                a.UNIT_NAME_FUND,
                a.UNIT_ID_FUND,
                a.SOCIAL_HOUSEHOLD,
                a.SOCIAL_HOUSEHOLD_NAME,
                a.SOCIAL_PROVINCE,
                a.SOCIAL_CITY,
                a.SOCIAL_TOWN,
                a.PROVIDENT_HOUSEHOLD,
                a.PROVIDENT_HOUSEHOLD_NAME,
                a.FUND_PROVINCE,
                a.FUND_CITY,
                a.FUND_TOWN,
                a.SOCIAL_ADD_STATUS,
                a.FUND_ADD_STATUS,
                a.SOCIAL_REDUCE_STATUS,
                a.FUND_REDUCE_STATUS,
                a.SOCIAL_ID,
                a.FUND_ID,
                a.CREATE_BY,
                a.UPDATE_BY,
                a.CREATE_NAME,
                a.UPDATE_TIME,
                a.CREATE_TIME,
                a.FIRST_BUY_MONTH_SOCIAL,
                a.UNIT_PENSION_CARDINAL,
                a.UNIT_MEDICAL_CARDINAL,
                a.UNIT_UNEMPLOYMENT_CARDINAL,
                a.UNIT_BIGAILMENT_CARDINAL,
                a.UNIT_WORK_INJURY_CARDINAL,
                a.UNIT_BIRTH_CARDINAL,
                a.PERSONAL_PENSION_CARDINAL,
                a.PERSONAL_MEDICAL_CARDINAL,
                a.PERSONAL_BIGAILMENT_CARDINAL,
                a.PERSONAL_UNEMPLOYMENT_CARDINAL,
                a.UNIT_PENSION_PER,
                a.UNIT_MEDICAL_PER,
                a.UNIT_UNEMPLOYMENT_PER,
                a.UNIT_WORK_UNJURY_PER,
                a.UNIT_BIRTH_PER,
                a.PERSONAL_PENSION_PER,
                a.PERSONAL_MEDICAL_PER,
                a.PERSONAL_UNEMPLOYMENT_PER,
                a.HANDLE_STATUS,
                a.PERSONAL_BIGAILMENT_PER,
                a.UNIT_BIGAILMENT_PER,
                a.SOCIAL_REDUCE_DATE,
                a.CAN_OVERPAY,
                a.PAY_POLICY,
                a.OVERPAY_NUMBER,
                a.HAVE_THIS_MONTH,
                a.INSURANCE_PENSION,
                a.INSURANCE_MEDICAL,
                a.INSURANCE_UNEMPLOYMENT,
                a.INSURANCE_INJURY,
                a.INSURANCE_BIRTH,
                a.INSURANCE_BIGAILMENT,
                a.LATEST_CARDINALITY,
                a.IS_ILLNESS,
                a.COLLECT_TYPE,
                a.VALUE_TYPE,
                a.COLLECT_MOTH,
                a.IS_CHARGE_PERSONAL,
                a.RECORD_BASE,
                a.TRUST_REMARK,
                a.PAYMENT_TYPE,
                a.UPPER_LIMIT,
                a.LOWER_LIMIT,
                a.PENSION_START,
                a.MEDICAL_START,
                a.UNEMPLOY_START,
                a.WORK_INJURY_START,
                a.BIRTH_START,
                a.BIGAILMENT_START,
                a.PENSION_HANDLE,
                a.MEDICAL_HANDLE,
                a.UNEMPLOY_HANDLE,
                a.WORK_INJURY_HANDLE,
                a.BIRTH_HANDLE,
                a.BIGAILMENT_HANDLE,
                a.UNIT_PERSION_MONEY,
                a.UNIT_MEDICAL_MONEY,
                a.UNIT_UNEMPLOYMENT_MONEY,
                a.UNIT_INJURY_MONEY,
                a.UNIT_BIRTH_MONEY,
                a.UNIT_BIGAILMENT_MONEY,
                a.PERSONAL_PERSION_MONEY,
                a.PERSONAL_MEDICAL_MONEY,
                a.PERSONAL_UNEMPLOYMENT_MONEY,
                a.PERSONAL_BIGAILMENT_MONEY,
                a.UNIT_PROVIDENG_CARDINAL,
                a.PERSONAL_PROVIDENT_CARDINAL,
                a.SOCIAL_START_DATE,
                a.UNIT_PROVIDENT_PER,
                a.PERSONAL_PROVIDENT_PER,
                a.PROVIDENT_START,
                a.FIRST_BUY_MOTH_FUND,
                a.UPPER_LIMIT_FUND,
                a.LOWER_LIMIT_FUND,
                a.FUND_PAY_POINT,
                a.CAN_OVERPAY_FUND,
                a.OVERPAY_NUMBER_FUND,
                a.PAY_POLICY_FUND,
                a.TRUST_REMARK_FUND,
                a.HAVE_THIS_MONTH_FUND,
                a.LATEST_CARDINALITY_FUND,
				a.FUND_REDUCE_DATE,
				a.PERSONAL_FUND_SUM,
				a.UNIT_FUND_SUM,
				a.UNIT_SOCIAL_SUM,
				a.PERSONAL_SOCIAL_SUM,
				a.UNIT_INTEREST_FEE,
				a.PERSONAL_INTEREST_FEE,
				a.SOCIAL_STATUS,
				a.FUND_STATUS,
				a.DISPATCH_ID,a.UNIT_SOCIAL_SUM,a.PERSONAL_SOCIAL_SUM
	</sql>

	<!-- 其他地方查询，不需要拼接项目名称 -->
	<sql id="Other_Base_Column_List">
				a.ID,
                a.EMP_ID,
                a.EMP_NO,
                a.EMP_NAME,
                a.EMP_IDCARD,
                a.EMP_TYPE,
                a.SETTLE_DOMAIN,
                a.SETTLE_DOMAIN_CODE,
                a.SETTLE_DOMAIN_NAME,
                a.UNIT_NAME,
                a.UNIT_ID,
 				a.SETTLE_DOMAIN_FUND,
				a.SETTLE_DOMAIN_CODE_FUND,
                a.SETTLE_DOMAIN_NAME_FUND,
                a.UNIT_NAME_FUND,
                a.UNIT_ID_FUND,
                a.SOCIAL_HOUSEHOLD,
                a.SOCIAL_HOUSEHOLD_NAME,
                a.SOCIAL_PROVINCE,
                a.SOCIAL_CITY,
                a.SOCIAL_TOWN,
                a.PROVIDENT_HOUSEHOLD,
                a.PROVIDENT_HOUSEHOLD_NAME,
                a.FUND_PROVINCE,
                a.FUND_CITY,
                a.FUND_TOWN,
                a.SOCIAL_ADD_STATUS,
                a.FUND_ADD_STATUS,
                a.SOCIAL_REDUCE_STATUS,
                a.FUND_REDUCE_STATUS,
                a.SOCIAL_ID,
                a.FUND_ID,
                a.CREATE_BY,
                a.UPDATE_BY,
                a.CREATE_NAME,
                a.UPDATE_TIME,
                a.CREATE_TIME,
                a.FIRST_BUY_MONTH_SOCIAL,
                a.UNIT_PENSION_CARDINAL,
                a.UNIT_MEDICAL_CARDINAL,
                a.UNIT_UNEMPLOYMENT_CARDINAL,
                a.UNIT_BIGAILMENT_CARDINAL,
                a.UNIT_WORK_INJURY_CARDINAL,
                a.UNIT_BIRTH_CARDINAL,
                a.PERSONAL_PENSION_CARDINAL,
                a.PERSONAL_MEDICAL_CARDINAL,
                a.PERSONAL_BIGAILMENT_CARDINAL,
                a.PERSONAL_UNEMPLOYMENT_CARDINAL,
                a.UNIT_PENSION_PER,
                a.UNIT_MEDICAL_PER,
                a.UNIT_UNEMPLOYMENT_PER,
                a.UNIT_WORK_UNJURY_PER,
                a.UNIT_BIRTH_PER,
                a.PERSONAL_PENSION_PER,
                a.PERSONAL_MEDICAL_PER,
                a.PERSONAL_UNEMPLOYMENT_PER,
                a.HANDLE_STATUS,
                a.PERSONAL_BIGAILMENT_PER,
                a.UNIT_BIGAILMENT_PER,
                a.SOCIAL_REDUCE_DATE,
                a.CAN_OVERPAY,
                a.PAY_POLICY,
                a.OVERPAY_NUMBER,
                a.HAVE_THIS_MONTH,
                a.INSURANCE_PENSION,
                a.INSURANCE_MEDICAL,
                a.INSURANCE_UNEMPLOYMENT,
                a.INSURANCE_INJURY,
                a.INSURANCE_BIRTH,
                a.INSURANCE_BIGAILMENT,
                a.LATEST_CARDINALITY,
                a.IS_ILLNESS,
                a.COLLECT_TYPE,
                a.VALUE_TYPE,
                a.COLLECT_MOTH,
                a.IS_CHARGE_PERSONAL,
                a.RECORD_BASE,
                a.TRUST_REMARK,
                a.PAYMENT_TYPE,
                a.UPPER_LIMIT,
                a.LOWER_LIMIT,
                a.PENSION_START,
                a.MEDICAL_START,
                a.UNEMPLOY_START,
                a.WORK_INJURY_START,
                a.BIRTH_START,
                a.BIGAILMENT_START,
                a.PENSION_HANDLE,
                a.MEDICAL_HANDLE,
                a.UNEMPLOY_HANDLE,
                a.WORK_INJURY_HANDLE,
                a.BIRTH_HANDLE,
                a.BIGAILMENT_HANDLE,
                a.UNIT_PERSION_MONEY,
                a.UNIT_MEDICAL_MONEY,
                a.UNIT_UNEMPLOYMENT_MONEY,
                a.UNIT_INJURY_MONEY,
                a.UNIT_BIRTH_MONEY,
                a.UNIT_BIGAILMENT_MONEY,
                a.PERSONAL_PERSION_MONEY,
                a.PERSONAL_MEDICAL_MONEY,
                a.PERSONAL_UNEMPLOYMENT_MONEY,
                a.PERSONAL_BIGAILMENT_MONEY,
                a.UNIT_PROVIDENG_CARDINAL,
                a.PERSONAL_PROVIDENT_CARDINAL,
                a.SOCIAL_START_DATE,
                a.UNIT_PROVIDENT_PER,
                a.PERSONAL_PROVIDENT_PER,
                a.PROVIDENT_START,
                a.FIRST_BUY_MOTH_FUND,
                a.UPPER_LIMIT_FUND,
                a.LOWER_LIMIT_FUND,
                a.FUND_PAY_POINT,
                a.CAN_OVERPAY_FUND,
                a.OVERPAY_NUMBER_FUND,
                a.PAY_POLICY_FUND,
                a.TRUST_REMARK_FUND,
                a.HAVE_THIS_MONTH_FUND,
                a.LATEST_CARDINALITY_FUND,
				a.FUND_REDUCE_DATE,
				a.PERSONAL_FUND_SUM,
				a.UNIT_FUND_SUM,
				a.UNIT_SOCIAL_SUM,
				a.PERSONAL_SOCIAL_SUM,
				a.UNIT_INTEREST_FEE,
				a.PERSONAL_INTEREST_FEE,
				a.SOCIAL_STATUS,
				a.FUND_STATUS,
				a.DISPATCH_ID,a.UNIT_SOCIAL_SUM,a.PERSONAL_SOCIAL_SUM
	</sql>
	<sql id="tSocialFundInfo_where">
		<if test="tSocialFundInfo != null">
			<if test="tSocialFundInfo.idList != null">
				AND a.ID in
				<foreach item="idStr" index="index" collection="tSocialFundInfo.idList" open="(" separator="," close=")">
					#{idStr}
				</foreach>
			</if>
			<if test="tSocialFundInfo.id != null and tSocialFundInfo.id.trim() != ''">
				AND a.ID = #{tSocialFundInfo.id}
			</if>
			<if test="tSocialFundInfo.empId != null and tSocialFundInfo.empId.trim() != ''">
				AND a.EMP_ID = #{tSocialFundInfo.empId}
			</if>
			<if test="tSocialFundInfo.empNo != null and tSocialFundInfo.empNo.trim() != ''">
				AND a.EMP_NO = #{tSocialFundInfo.empNo}
			</if>
			<if test="tSocialFundInfo.empName != null and tSocialFundInfo.empName.trim() != ''">
				AND a.EMP_NAME = #{tSocialFundInfo.empName}
			</if>
			<if test="tSocialFundInfo.empIdcard != null and tSocialFundInfo.empIdcard.trim() != ''">
				AND a.EMP_IDCARD = #{tSocialFundInfo.empIdcard}
			</if>
			<if test="tSocialFundInfo.empType != null and tSocialFundInfo.empType.trim() != ''">
				AND a.EMP_TYPE = #{tSocialFundInfo.empType}
			</if>
			<if test="tSocialFundInfo.settleDomain != null and tSocialFundInfo.settleDomain.trim() != ''">
				AND a.SETTLE_DOMAIN = #{tSocialFundInfo.settleDomain}
			</if>
			<if test="tSocialFundInfo.settleDomainName != null and tSocialFundInfo.settleDomainName.trim() != ''">
				AND (a.SETTLE_DOMAIN_NAME like concat('%',#{tSocialFundInfo.settleDomainName},'%') or a.SETTLE_DOMAIN_NAME_FUND like concat('%',#{tSocialFundInfo.settleDomainName},'%'))
			</if>
			<if test="tSocialFundInfo.unitName != null and tSocialFundInfo.unitName.trim() != ''">
				AND (a.UNIT_NAME like concat('%',#{tSocialFundInfo.unitName},'%') or a.UNIT_NAME_FUND like concat('%',#{tSocialFundInfo.unitName},'%'))
			</if>
			<if test="tSocialFundInfo.unitId != null and tSocialFundInfo.unitId.trim() != ''">
				AND a.UNIT_ID = #{tSocialFundInfo.unitId}
			</if>
			<if test="tSocialFundInfo.socialHousehold != null and tSocialFundInfo.socialHousehold.trim() != ''">
				AND a.SOCIAL_HOUSEHOLD = #{tSocialFundInfo.socialHousehold}
			</if>
			<if test="tSocialFundInfo.socialHouseholdName != null and tSocialFundInfo.socialHouseholdName.trim() != ''">
				AND a.SOCIAL_HOUSEHOLD_NAME like concat('%',#{tSocialFundInfo.socialHouseholdName},'%')
			</if>
			<if test="tSocialFundInfo.socialProvince != null and tSocialFundInfo.socialProvince.trim() != ''">
				AND a.SOCIAL_PROVINCE = #{tSocialFundInfo.socialProvince}
			</if>
			<if test="tSocialFundInfo.socialCity != null and tSocialFundInfo.socialCity.trim() != ''">
				AND a.SOCIAL_CITY = #{tSocialFundInfo.socialCity}
			</if>
			<if test="tSocialFundInfo.socialTown != null and tSocialFundInfo.socialTown.trim() != ''">
				AND a.SOCIAL_TOWN = #{tSocialFundInfo.socialTown}
			</if>
			<if test="tSocialFundInfo.providentHousehold != null and tSocialFundInfo.providentHousehold.trim() != ''">
				AND a.PROVIDENT_HOUSEHOLD = #{tSocialFundInfo.providentHousehold}
			</if>
			<if test="tSocialFundInfo.providentHouseholdName != null and tSocialFundInfo.providentHouseholdName.trim() != ''">
				AND a.PROVIDENT_HOUSEHOLD_NAME like concat('%',#{tSocialFundInfo.providentHouseholdName},'%')
			</if>
			<if test="tSocialFundInfo.fundProvince != null and tSocialFundInfo.fundProvince.trim() != ''">
				AND a.FUND_PROVINCE = #{tSocialFundInfo.fundProvince}
			</if>
			<if test="tSocialFundInfo.fundCity != null and tSocialFundInfo.fundCity.trim() != ''">
				AND a.FUND_CITY = #{tSocialFundInfo.fundCity}
			</if>
			<if test="tSocialFundInfo.fundTown != null and tSocialFundInfo.fundTown.trim() != ''">
				AND a.FUND_TOWN = #{tSocialFundInfo.fundTown}
			</if>
			<if test="tSocialFundInfo.socialAddStatus != null and tSocialFundInfo.socialAddStatus.trim() != ''">
				AND a.SOCIAL_ADD_STATUS = #{tSocialFundInfo.socialAddStatus}
			</if>
			<if test="tSocialFundInfo.fundAddStatus != null and tSocialFundInfo.fundAddStatus.trim() != ''">
				AND a.FUND_ADD_STATUS = #{tSocialFundInfo.fundAddStatus}
			</if>
			<if test="tSocialFundInfo.socialReduceStatus != null and tSocialFundInfo.socialReduceStatus.trim() != ''">
				AND a.SOCIAL_REDUCE_STATUS = #{tSocialFundInfo.socialReduceStatus}
			</if>
			<if test="tSocialFundInfo.fundReduceStatus != null and tSocialFundInfo.fundReduceStatus.trim() != ''">
				AND a.FUND_REDUCE_STATUS = #{tSocialFundInfo.fundReduceStatus}
			</if>
			<if test="tSocialFundInfo.socialId != null and tSocialFundInfo.socialId.trim() != ''">
				AND a.SOCIAL_ID = #{tSocialFundInfo.socialId}
			</if>
			<if test="tSocialFundInfo.fundId != null and tSocialFundInfo.fundId.trim() != ''">
				AND a.FUND_ID = #{tSocialFundInfo.fundId}
			</if>
			<if test="tSocialFundInfo.createBy != null and tSocialFundInfo.createBy.trim() != ''">
				AND a.CREATE_BY = #{tSocialFundInfo.createBy}
			</if>
			<if test="tSocialFundInfo.updateBy != null and tSocialFundInfo.updateBy.trim() != ''">
				AND a.UPDATE_BY = #{tSocialFundInfo.updateBy}
			</if>
			<if test="tSocialFundInfo.createName != null and tSocialFundInfo.createName.trim() != ''">
				AND a.CREATE_NAME = #{tSocialFundInfo.createName}
			</if>
			<if test="tSocialFundInfo.updateTime != null">
				AND a.UPDATE_TIME = #{tSocialFundInfo.updateTime}
			</if>
			<if test="tSocialFundInfo.firstBuyMonthSocial != null">
				AND a.FIRST_BUY_MONTH_SOCIAL = #{tSocialFundInfo.firstBuyMonthSocial}
			</if>
			<if test="tSocialFundInfo.unitPensionCardinal != null">
				AND a.UNIT_PENSION_CARDINAL = #{tSocialFundInfo.unitPensionCardinal}
			</if>
			<if test="tSocialFundInfo.unitMedicalCardinal != null">
				AND a.UNIT_MEDICAL_CARDINAL = #{tSocialFundInfo.unitMedicalCardinal}
			</if>
			<if test="tSocialFundInfo.unitUnemploymentCardinal != null">
				AND a.UNIT_UNEMPLOYMENT_CARDINAL = #{tSocialFundInfo.unitUnemploymentCardinal}
			</if>
			<if test="tSocialFundInfo.unitBigailmentCardinal != null">
				AND a.UNIT_BIGAILMENT_CARDINAL = #{tSocialFundInfo.unitBigailmentCardinal}
			</if>
			<if test="tSocialFundInfo.unitWorkInjuryCardinal != null">
				AND a.UNIT_WORK_INJURY_CARDINAL = #{tSocialFundInfo.unitWorkInjuryCardinal}
			</if>
			<if test="tSocialFundInfo.unitBirthCardinal != null">
				AND a.UNIT_BIRTH_CARDINAL = #{tSocialFundInfo.unitBirthCardinal}
			</if>
			<if test="tSocialFundInfo.personalPensionCardinal != null">
				AND a.PERSONAL_PENSION_CARDINAL = #{tSocialFundInfo.personalPensionCardinal}
			</if>
			<if test="tSocialFundInfo.personalMedicalCardinal != null">
				AND a.PERSONAL_MEDICAL_CARDINAL = #{tSocialFundInfo.personalMedicalCardinal}
			</if>
			<if test="tSocialFundInfo.personalBigailmentCardinal != null">
				AND a.PERSONAL_BIGAILMENT_CARDINAL = #{tSocialFundInfo.personalBigailmentCardinal}
			</if>
			<if test="tSocialFundInfo.personalUnemploymentCardinal != null">
				AND a.PERSONAL_UNEMPLOYMENT_CARDINAL = #{tSocialFundInfo.personalUnemploymentCardinal}
			</if>
			<if test="tSocialFundInfo.unitPensionPer != null">
				AND a.UNIT_PENSION_PER = #{tSocialFundInfo.unitPensionPer}
			</if>
			<if test="tSocialFundInfo.unitMedicalPer != null">
				AND a.UNIT_MEDICAL_PER = #{tSocialFundInfo.unitMedicalPer}
			</if>
			<if test="tSocialFundInfo.unitUnemploymentPer != null">
				AND a.UNIT_UNEMPLOYMENT_PER = #{tSocialFundInfo.unitUnemploymentPer}
			</if>
			<if test="tSocialFundInfo.unitWorkUnjuryPer != null">
				AND a.UNIT_WORK_UNJURY_PER = #{tSocialFundInfo.unitWorkUnjuryPer}
			</if>
			<if test="tSocialFundInfo.unitBirthPer != null">
				AND a.UNIT_BIRTH_PER = #{tSocialFundInfo.unitBirthPer}
			</if>
			<if test="tSocialFundInfo.personalPensionPer != null">
				AND a.PERSONAL_PENSION_PER = #{tSocialFundInfo.personalPensionPer}
			</if>
			<if test="tSocialFundInfo.personalMedicalPer != null">
				AND a.PERSONAL_MEDICAL_PER = #{tSocialFundInfo.personalMedicalPer}
			</if>
			<if test="tSocialFundInfo.personalUnemploymentPer != null">
				AND a.PERSONAL_UNEMPLOYMENT_PER = #{tSocialFundInfo.personalUnemploymentPer}
			</if>
			<if test="tSocialFundInfo.handleStatus != null and tSocialFundInfo.handleStatus.trim() != ''">
				AND a.HANDLE_STATUS = #{tSocialFundInfo.handleStatus}
			</if>
			<if test="tSocialFundInfo.personalBigailmentPer != null">
				AND a.PERSONAL_BIGAILMENT_PER = #{tSocialFundInfo.personalBigailmentPer}
			</if>
			<if test="tSocialFundInfo.unitBigailmentPer != null">
				AND a.UNIT_BIGAILMENT_PER = #{tSocialFundInfo.unitBigailmentPer}
			</if>
			<if test="tSocialFundInfo.socialReduceDate != null">
				AND a.SOCIAL_REDUCE_DATE = #{tSocialFundInfo.socialReduceDate}
			</if>
			<if test="tSocialFundInfo.canOverpay != null and tSocialFundInfo.canOverpay.trim() != ''">
				AND a.CAN_OVERPAY = #{tSocialFundInfo.canOverpay}
			</if>
			<if test="tSocialFundInfo.payPolicy != null and tSocialFundInfo.payPolicy.trim() != ''">
				AND a.PAY_POLICY = #{tSocialFundInfo.payPolicy}
			</if>
			<if test="tSocialFundInfo.overpayNumber != null">
				AND a.OVERPAY_NUMBER = #{tSocialFundInfo.overpayNumber}
			</if>
			<if test="tSocialFundInfo.haveThisMonth != null and tSocialFundInfo.haveThisMonth.trim() != ''">
				AND a.HAVE_THIS_MONTH = #{tSocialFundInfo.haveThisMonth}
			</if>
			<if test="tSocialFundInfo.insurancePension != null and tSocialFundInfo.insurancePension.trim() != ''">
				AND a.INSURANCE_PENSION = #{tSocialFundInfo.insurancePension}
			</if>
			<if test="tSocialFundInfo.insuranceMedical != null and tSocialFundInfo.insuranceMedical.trim() != ''">
				AND a.INSURANCE_MEDICAL = #{tSocialFundInfo.insuranceMedical}
			</if>
			<if test="tSocialFundInfo.insuranceUnemployment != null and tSocialFundInfo.insuranceUnemployment.trim() != ''">
				AND a.INSURANCE_UNEMPLOYMENT = #{tSocialFundInfo.insuranceUnemployment}
			</if>
			<if test="tSocialFundInfo.insuranceInjury != null and tSocialFundInfo.insuranceInjury.trim() != ''">
				AND a.INSURANCE_INJURY = #{tSocialFundInfo.insuranceInjury}
			</if>
			<if test="tSocialFundInfo.insuranceBirth != null and tSocialFundInfo.insuranceBirth.trim() != ''">
				AND a.INSURANCE_BIRTH = #{tSocialFundInfo.insuranceBirth}
			</if>
			<if test="tSocialFundInfo.insuranceBigailment != null and tSocialFundInfo.insuranceBigailment.trim() != ''">
				AND a.INSURANCE_BIGAILMENT = #{tSocialFundInfo.insuranceBigailment}
			</if>
			<if test="tSocialFundInfo.latestCardinality != null and tSocialFundInfo.latestCardinality.trim() != ''">
				AND a.LATEST_CARDINALITY = #{tSocialFundInfo.latestCardinality}
			</if>
			<if test="tSocialFundInfo.isIllness != null and tSocialFundInfo.isIllness.trim() != ''">
				AND a.IS_ILLNESS = #{tSocialFundInfo.isIllness}
			</if>
			<if test="tSocialFundInfo.collectType != null and tSocialFundInfo.collectType.trim() != ''">
				AND a.COLLECT_TYPE = #{tSocialFundInfo.collectType}
			</if>
			<if test="tSocialFundInfo.valueType != null and tSocialFundInfo.valueType.trim() != ''">
				AND a.VALUE_TYPE = #{tSocialFundInfo.valueType}
			</if>
			<if test="tSocialFundInfo.collectMoth != null">
				AND a.COLLECT_MOTH = #{tSocialFundInfo.collectMoth}
			</if>
			<if test="tSocialFundInfo.isChargePersonal != null and tSocialFundInfo.isChargePersonal.trim() != ''">
				AND a.IS_CHARGE_PERSONAL = #{tSocialFundInfo.isChargePersonal}
			</if>
			<if test="tSocialFundInfo.recordBase != null and tSocialFundInfo.recordBase.trim() != ''">
				AND a.RECORD_BASE = #{tSocialFundInfo.recordBase}
			</if>
			<if test="tSocialFundInfo.trustRemark != null and tSocialFundInfo.trustRemark.trim() != ''">
				AND a.TRUST_REMARK = #{tSocialFundInfo.trustRemark}
			</if>
			<if test="tSocialFundInfo.paymentType != null and tSocialFundInfo.paymentType.trim() != ''">
				AND a.PAYMENT_TYPE = #{tSocialFundInfo.paymentType}
			</if>
			<if test="tSocialFundInfo.upperLimit != null">
				AND a.UPPER_LIMIT = #{tSocialFundInfo.upperLimit}
			</if>
			<if test="tSocialFundInfo.lowerLimit != null">
				AND a.LOWER_LIMIT = #{tSocialFundInfo.lowerLimit}
			</if>
			<if test="tSocialFundInfo.pensionStart != null">
				AND a.PENSION_START = #{tSocialFundInfo.pensionStart}
			</if>
			<if test="tSocialFundInfo.medicalStart != null">
				AND a.MEDICAL_START = #{tSocialFundInfo.medicalStart}
			</if>
			<if test="tSocialFundInfo.unemployStart != null">
				AND a.UNEMPLOY_START = #{tSocialFundInfo.unemployStart}
			</if>
			<if test="tSocialFundInfo.workInjuryStart != null">
				AND a.WORK_INJURY_START = #{tSocialFundInfo.workInjuryStart}
			</if>
			<if test="tSocialFundInfo.birthStart != null">
				AND a.BIRTH_START = #{tSocialFundInfo.birthStart}
			</if>
			<if test="tSocialFundInfo.bigailmentStart != null">
				AND a.BIGAILMENT_START = #{tSocialFundInfo.bigailmentStart}
			</if>
			<if test="tSocialFundInfo.pensionHandle != null and tSocialFundInfo.pensionHandle.trim() != ''">
				AND a.PENSION_HANDLE = #{tSocialFundInfo.pensionHandle}
			</if>
			<if test="tSocialFundInfo.medicalHandle != null and tSocialFundInfo.medicalHandle.trim() != ''">
				AND a.MEDICAL_HANDLE = #{tSocialFundInfo.medicalHandle}
			</if>
			<if test="tSocialFundInfo.unemployHandle != null and tSocialFundInfo.unemployHandle.trim() != ''">
				AND a.UNEMPLOY_HANDLE = #{tSocialFundInfo.unemployHandle}
			</if>
			<if test="tSocialFundInfo.workInjuryHandle != null and tSocialFundInfo.workInjuryHandle.trim() != ''">
				AND a.WORK_INJURY_HANDLE = #{tSocialFundInfo.workInjuryHandle}
			</if>
			<if test="tSocialFundInfo.birthHandle != null and tSocialFundInfo.birthHandle.trim() != ''">
				AND a.BIRTH_HANDLE = #{tSocialFundInfo.birthHandle}
			</if>
			<if test="tSocialFundInfo.bigailmentHandle != null and tSocialFundInfo.bigailmentHandle.trim() != ''">
				AND a.BIGAILMENT_HANDLE = #{tSocialFundInfo.bigailmentHandle}
			</if>
			<if test="tSocialFundInfo.unitPersionMoney != null">
				AND a.UNIT_PERSION_MONEY = #{tSocialFundInfo.unitPersionMoney}
			</if>
			<if test="tSocialFundInfo.unitMedicalMoney != null">
				AND a.UNIT_MEDICAL_MONEY = #{tSocialFundInfo.unitMedicalMoney}
			</if>
			<if test="tSocialFundInfo.unitUnemploymentMoney != null">
				AND a.UNIT_UNEMPLOYMENT_MONEY = #{tSocialFundInfo.unitUnemploymentMoney}
			</if>
			<if test="tSocialFundInfo.unitInjuryMoney != null">
				AND a.UNIT_INJURY_MONEY = #{tSocialFundInfo.unitInjuryMoney}
			</if>
			<if test="tSocialFundInfo.unitBirthMoney != null">
				AND a.UNIT_BIRTH_MONEY = #{tSocialFundInfo.unitBirthMoney}
			</if>
			<if test="tSocialFundInfo.unitBigailmentMoney != null">
				AND a.UNIT_BIGAILMENT_MONEY = #{tSocialFundInfo.unitBigailmentMoney}
			</if>
			<if test="tSocialFundInfo.personalPersionMoney != null">
				AND a.PERSONAL_PERSION_MONEY = #{tSocialFundInfo.personalPersionMoney}
			</if>
			<if test="tSocialFundInfo.personalMedicalMoney != null">
				AND a.PERSONAL_MEDICAL_MONEY = #{tSocialFundInfo.personalMedicalMoney}
			</if>
			<if test="tSocialFundInfo.personalUnemploymentMoney != null">
				AND a.PERSONAL_UNEMPLOYMENT_MONEY = #{tSocialFundInfo.personalUnemploymentMoney}
			</if>
			<if test="tSocialFundInfo.personalBigailmentMoney != null">
				AND a.PERSONAL_BIGAILMENT_MONEY = #{tSocialFundInfo.personalBigailmentMoney}
			</if>
			<if test="tSocialFundInfo.unitProvidengCardinal != null">
				AND a.UNIT_PROVIDENG_CARDINAL = #{tSocialFundInfo.unitProvidengCardinal}
			</if>
			<if test="tSocialFundInfo.personalProvidentCardinal != null">
				AND a.PERSONAL_PROVIDENT_CARDINAL = #{tSocialFundInfo.personalProvidentCardinal}
			</if>
			<if test="tSocialFundInfo.socialStartDate != null">
				AND a.SOCIAL_START_DATE = #{tSocialFundInfo.socialStartDate}
			</if>
			<if test="tSocialFundInfo.unitProvidentPer != null">
				AND a.UNIT_PROVIDENT_PER = #{tSocialFundInfo.unitProvidentPer}
			</if>
			<if test="tSocialFundInfo.personalProvidentPer != null">
				AND a.PERSONAL_PROVIDENT_PER = #{tSocialFundInfo.personalProvidentPer}
			</if>
			<if test="tSocialFundInfo.providentStart != null">
				AND a.PROVIDENT_START = #{tSocialFundInfo.providentStart}
			</if>
			<if test="tSocialFundInfo.firstBuyMothFund != null">
				AND a.FIRST_BUY_MOTH_FUND = #{tSocialFundInfo.firstBuyMothFund}
			</if>
			<if test="tSocialFundInfo.upperLimitFund != null">
				AND a.UPPER_LIMIT_FUND = #{tSocialFundInfo.upperLimitFund}
			</if>
			<if test="tSocialFundInfo.lowerLimitFund != null">
				AND a.LOWER_LIMIT_FUND = #{tSocialFundInfo.lowerLimitFund}
			</if>
			<if test="tSocialFundInfo.fundPayPoint != null and tSocialFundInfo.fundPayPoint.trim() != ''">
				AND a.FUND_PAY_POINT = #{tSocialFundInfo.fundPayPoint}
			</if>
			<if test="tSocialFundInfo.canOverpayFund != null and tSocialFundInfo.canOverpayFund.trim() != ''">
				AND a.CAN_OVERPAY_FUND = #{tSocialFundInfo.canOverpayFund}
			</if>
			<if test="tSocialFundInfo.overpayNumberFund != null">
				AND a.OVERPAY_NUMBER_FUND = #{tSocialFundInfo.overpayNumberFund}
			</if>
			<if test="tSocialFundInfo.payPolicyFund != null and tSocialFundInfo.payPolicyFund.trim() != ''">
				AND a.PAY_POLICY_FUND = #{tSocialFundInfo.payPolicyFund}
			</if>
			<if test="tSocialFundInfo.trustRemarkFund != null and tSocialFundInfo.trustRemarkFund.trim() != ''">
				AND a.TRUST_REMARK_FUND = #{tSocialFundInfo.trustRemarkFund}
			</if>
			<if test="tSocialFundInfo.haveThisMonthFund != null and tSocialFundInfo.haveThisMonthFund.trim() != ''">
				AND a.HAVE_THIS_MONTH_FUND = #{tSocialFundInfo.haveThisMonthFund}
			</if>
			<if test="tSocialFundInfo.latestCardinalityFund != null and tSocialFundInfo.latestCardinalityFund.trim() != ''">
				AND a.LATEST_CARDINALITY_FUND = #{tSocialFundInfo.latestCardinalityFund}
			</if>
			<if test="tSocialFundInfo.socialStatus != null and tSocialFundInfo.socialStatus.trim() != ''">
				AND a.SOCIAL_STATUS = #{tSocialFundInfo.socialStatus}
			</if>
			<if test="tSocialFundInfo.fundStatus != null and tSocialFundInfo.fundStatus.trim() != ''">
				AND a.FUND_STATUS = #{tSocialFundInfo.fundStatus}
			</if>
		</if>
	</sql>
	<!--tSocialFundInfo简单分页查询-->
	<select id="getTSocialFundInfoPage" resultMap="tSocialFundInfoMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_social_fund_info a
		<where>
			1=1
			<include refid="tSocialFundInfo_where"/>
		</where>
		order by a.CREATE_TIME desc
	</select>

	<!--获取在用社保 #a.SOCIAL_ADD_STATUS != '4' and a.SOCIAL_REDUCE_STATUS != '2' -->
	<select id="getSocialList" resultMap="tSocialFundInfoMap">
		SELECT
		<include refid="Other_Base_Column_List"/>
		FROM t_social_fund_info a
		<where>
			a.SOCIAL_ID is not null
			<if test="empIdCard != null">
				and a.EMP_IDCARD = #{empIdCard}
			</if>
			<if test="settleDomainIds != null">
				AND a.SETTLE_DOMAIN in
				<foreach item="item" index="index" collection="settleDomainIds" open="(" separator="," close=")">
					#{item}
				</foreach>
			</if>
		</where>
	</select>
	<!--获取在用公积金 a.FUND_ADD_STATUS != '4' and a.FUND_REDUCE_STATUS != '2' -->
	<select id="getFundList" resultMap="tSocialFundInfoMap">
		SELECT
		<include refid="Other_Base_Column_List"/>
		FROM t_social_fund_info a
		<where>
			a.FUND_ID is not null
			<if test="empIdCard != null">
				and a.EMP_IDCARD = #{empIdCard}
			</if>
			<if test="settleDomainIds != null">
				AND a.SETTLE_DOMAIN in
				<foreach item="item" index="index" collection="settleDomainIds" open="(" separator="," close=")">
					#{item}
				</foreach>
			</if>
		</where>
	</select>

	<!--导出-->
	<select id="exportList" resultMap="exportMap">
		select
			a.ID,
			a.EMP_NAME,
			a.EMP_IDCARD,
			a.EMP_TYPE,
			d.EMP_MOBILE,
		if(a.SETTLE_DOMAIN_CODE = a.SETTLE_DOMAIN_CODE_FUND,a.SETTLE_DOMAIN_CODE,concat(ifnull(a.SETTLE_DOMAIN_CODE,""),if(a.SETTLE_DOMAIN_CODE is null or a.SETTLE_DOMAIN_CODE_FUND is null,"",","),ifnull(a.SETTLE_DOMAIN_CODE_FUND,""))) SETTLE_DOMAIN_CODE,
		if(a.SETTLE_DOMAIN_NAME = a.SETTLE_DOMAIN_NAME_FUND,a.SETTLE_DOMAIN_NAME,concat(ifnull(a.SETTLE_DOMAIN_NAME,""),if(a.SETTLE_DOMAIN_NAME is null or a.SETTLE_DOMAIN_NAME_FUND is null,"",","),ifnull(a.SETTLE_DOMAIN_NAME_FUND,""))) SETTLE_DOMAIN_NAME,
		if(a.UNIT_NAME = a.UNIT_NAME_FUND,a.UNIT_NAME,concat(ifnull(a.UNIT_NAME,""),if(a.UNIT_NAME is null or a.UNIT_NAME_FUND is null,"",","),ifnull(a.UNIT_NAME_FUND,""))) UNIT_NAME,
			d.ID_CARD_PROVINCE,
			d.ID_CARD_CITY,
			d.ID_CARD_TOWN,
			d.ID_CARD_ADDRESS,
			d.FILE_PROVINCE,
			d.FILE_CITY,
			d.FILE_TOWN,
			d.POST,
			d.TRY_PERIOD,
			d.WORKING_HOURS,
			d.CONTRACT_NAME,
			d.CONTRACT_SUB_NAME,
			a.SOCIAL_HOUSEHOLD_NAME CONTRACT_PARTY,
			d.CONTRACT_TYPE,
			d.CONTRACT_START,
			d.CONTRACT_END,
			d.CONTRACT_TERM,
			d.EDUCATION_NAME,
			a.RECORD_BASE,
			a.SOCIAL_STATUS,
			a.FUND_STATUS,
			a.SOCIAL_START_DATE,
			a.PROVIDENT_START,
			a.SOCIAL_REDUCE_DATE,
			a.FUND_REDUCE_DATE,
			a.UNIT_SOCIAL_SUM,
			a.PERSONAL_SOCIAL_SUM,
			a.UNIT_FUND_SUM,
			a.PERSONAL_FUND_SUM,
			ifnull(a.UNIT_SOCIAL_SUM,0) + ifnull(a.PERSONAL_SOCIAL_SUM,0) + ifnull(a.UNIT_FUND_SUM,0) + ifnull(a.PERSONAL_FUND_SUM,0) ALL_SUM,
			a.SOCIAL_HOUSEHOLD_NAME,
			a.SOCIAL_PROVINCE,
			a.SOCIAL_CITY,
			a.SOCIAL_TOWN,
			a.PENSION_START,
			a.MEDICAL_START,
			a.UNEMPLOY_START,
			a.WORK_INJURY_START,
			a.BIRTH_START,
			a.BIGAILMENT_START,
			a.PAYMENT_TYPE,

			a.UNIT_PENSION_CARDINAL,
			a.UNIT_PENSION_PER,
			a.PERSONAL_PENSION_PER,
			a.UNIT_PERSION_MONEY,
			a.PERSONAL_PERSION_MONEY,
			ifnull(a.UNIT_PERSION_MONEY,0) + ifnull(a.PERSONAL_PERSION_MONEY,0) PERSION_MONEY,

			a.UNIT_MEDICAL_CARDINAL,
			a.UNIT_MEDICAL_PER,
			a.PERSONAL_MEDICAL_PER,
			a.UNIT_MEDICAL_MONEY,
			a.PERSONAL_MEDICAL_MONEY,
			ifnull(a.UNIT_MEDICAL_MONEY,0) + ifnull(a.PERSONAL_MEDICAL_MONEY,0) MEDICAL_MONEY,

			a.UNIT_UNEMPLOYMENT_CARDINAL,
			a.UNIT_UNEMPLOYMENT_PER,
			a.PERSONAL_UNEMPLOYMENT_PER,
			a.UNIT_UNEMPLOYMENT_MONEY,
			a.PERSONAL_UNEMPLOYMENT_MONEY,
			ifnull(a.UNIT_UNEMPLOYMENT_MONEY,0) + ifnull(a.PERSONAL_UNEMPLOYMENT_MONEY,0) UNEMPLOYMENT_MONEY,

			a.UNIT_WORK_INJURY_CARDINAL,
			a.UNIT_WORK_UNJURY_PER,
			a.UNIT_INJURY_MONEY,

			a.UNIT_BIRTH_CARDINAL,
			a.UNIT_BIRTH_PER,
			a.UNIT_BIRTH_MONEY,

			a.UNIT_BIGAILMENT_CARDINAL,
			a.UNIT_BIGAILMENT_PER,
			a.PERSONAL_BIGAILMENT_PER,
			a.UNIT_BIGAILMENT_MONEY,
			a.PERSONAL_BIGAILMENT_MONEY,
			ifnull(a.UNIT_BIGAILMENT_MONEY,0) + ifnull(a.PERSONAL_BIGAILMENT_MONEY,0) BIGAILMENT_MONEY,

			a.PROVIDENT_HOUSEHOLD_NAME,
			d.FUND_PROVINCE,
			d.FUND_CITY,
			d.FUND_TOWN,
			a.UNIT_PROVIDENG_CARDINAL,
			a.UNIT_PROVIDENT_PER,
			a.PERSONAL_PROVIDENT_PER,
			a.UNIT_FUND_SUM UNIT_FUND_SUM2,
			a.PERSONAL_FUND_SUM PERSONAL_FUND_SUM2,
			ifnull(a.UNIT_FUND_SUM,0) + ifnull(a.PERSONAL_FUND_SUM,0) FUND_SUM,
			a.TRUST_REMARK,
			a.PENSION_HANDLE,
			a.MEDICAL_HANDLE,
			a.UNEMPLOY_HANDLE,
			a.WORK_INJURY_HANDLE,
			a.BIRTH_HANDLE,
			a.BIGAILMENT_HANDLE
		from t_social_fund_info a
		left join t_dispatch_info d on a.DISPATCH_ID=d.ID
		<where>
			1=1
			<include refid="tSocialFundInfo_where"/>
		</where>
		order by a.CREATE_TIME desc
		<if test="tSocialFundInfo.limitStart != null">
			limit #{tSocialFundInfo.limitStart},#{tSocialFundInfo.limitEnd}
		</if>
	</select>
	<update id="updateSocialAndFoundInfo">
		update t_social_fund_info
		set UNIT_ID            = #{infoVo.unitId},
			UNIT_NAME          = #{infoVo.unitName},
			SETTLE_DOMAIN_NAME = #{infoVo.settleDomainName},
			SETTLE_DOMAIN_CODE = #{infoVo.settleDomainCode},
			SETTLE_DOMAIN   = #{infoVo.settleDomainId}
		where EMP_IDCARD = #{infoVo.empIdcard}
	</update>
	<update id="updateSocialAndFoundInfoF">
		update t_social_fund_info
		set UNIT_ID_FUND            = #{infoVo.unitId},
			UNIT_NAME_FUND          = #{infoVo.unitName},
			SETTLE_DOMAIN_NAME_FUND = #{infoVo.settleDomainName},
			SETTLE_DOMAIN_CODE_FUND = #{infoVo.settleDomainCode},
			SETTLE_DOMAIN_FUND   = #{infoVo.settleDomainId}
		where EMP_IDCARD = #{infoVo.empIdcard}
	</update>

</mapper>
