TSocialFundInfoMapper.xml 54.7 KB
Newer Older
fangxinjiang's avatar
fangxinjiang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<?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">

fangxinjiang's avatar
fangxinjiang committed
24
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper">
fangxinjiang's avatar
fangxinjiang committed
25

26 27 28 29 30 31 32 33 34 35 36 37
	<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"/>
fangxinjiang's avatar
fangxinjiang committed
38

39 40 41 42 43
		<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"/>
fangxinjiang's avatar
fangxinjiang committed
44

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
		<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"/>
64
		<result property="createTime" column="CREATE_TIME"/>
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
		<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"/>
fangxinjiang's avatar
fangxinjiang committed
116 117 118 119 120 121 122 123

		<result property="pensionReduceStart" column="PENSION_REDUCE_START"/>
		<result property="medicalReduceStart" column="MEDICAL_REDUCE_START"/>
		<result property="unemployReduceStart" column="UNEMPLOY_REDUCE_START"/>
		<result property="workInjuryReduceStart" column="WORK_INJURY_REDUCE_START"/>
		<result property="birthReduceStart" column="BIRTH_REDUCE_START"/>
		<result property="bigailmentReduceStart" column="BIGAILMENT_REDUCE_START"/>

124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
		<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"/>
157

158 159 160 161 162 163 164 165 166
		<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"/>
fangxinjiang's avatar
fangxinjiang committed
167

168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
	</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"/>
fangxinjiang's avatar
fangxinjiang committed
185 186
		<result property="fileCity" column="FILE_CITY"/>
		<result property="fileTown" column="FILE_TOWN"/>
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
		<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"/>
267 268 269
		<result property="empNational" column="EMP_NATIONAL"/>
		<result property="empRegisType" column="EMP_REGIS_TYPE"/>

270 271
	</resultMap>
	<sql id="Base_Column_List">
272
				a.ID,
fangxinjiang's avatar
fangxinjiang committed
273 274 275 276 277 278
                a.EMP_ID,
                a.EMP_NO,
                a.EMP_NAME,
                a.EMP_IDCARD,
                a.EMP_TYPE,
                a.SETTLE_DOMAIN,
fangxinjiang's avatar
fangxinjiang committed
279 280 281
                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 not null and a.SETTLE_DOMAIN_CODE !='') and (a.SETTLE_DOMAIN_CODE_FUND is not null and a.SETTLE_DOMAIN_CODE_FUND !=''),",",""),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 not null and a.SETTLE_DOMAIN_NAME !='') and (a.SETTLE_DOMAIN_NAME_FUND is not null and a.SETTLE_DOMAIN_NAME_FUND !=''),",",""),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 not null and a.UNIT_NAME !='') and (a.UNIT_NAME_FUND is not null and a.UNIT_NAME_FUND !=''),",",""),ifnull(a.UNIT_NAME_FUND,""))) UNIT_NAME,
fangxinjiang's avatar
fangxinjiang committed
282
                a.UNIT_ID,
fangxinjiang's avatar
fangxinjiang committed
283 284 285 286 287
 				a.SETTLE_DOMAIN_FUND,
				a.SETTLE_DOMAIN_CODE_FUND,
                a.SETTLE_DOMAIN_NAME_FUND,
                a.UNIT_NAME_FUND,
                a.UNIT_ID_FUND,
fangxinjiang's avatar
fangxinjiang committed
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
                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,
308
                a.CREATE_TIME,
fangxinjiang's avatar
fangxinjiang committed
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
                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,
390
                a.LATEST_CARDINALITY_FUND,
391 392 393 394 395 396
				a.FUND_REDUCE_DATE,
				a.PERSONAL_FUND_SUM,
				a.UNIT_FUND_SUM,
				a.UNIT_SOCIAL_SUM,
				a.PERSONAL_SOCIAL_SUM,
				a.UNIT_INTEREST_FEE,
397 398 399
				a.PERSONAL_INTEREST_FEE,
				a.SOCIAL_STATUS,
				a.FUND_STATUS,
huyuchen's avatar
huyuchen committed
400
				a.DISPATCH_ID
401
	</sql>
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534

	<!-- 其他地方查询,不需要拼接项目名称 -->
	<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>
535 536 537
	<sql id="tSocialFundInfo_where">
		<if test="tSocialFundInfo != null">
			<if test="tSocialFundInfo.idList != null">
538
				AND a.ID in
539 540 541 542
				<foreach item="idStr" index="index" collection="tSocialFundInfo.idList" open="(" separator="," close=")">
					#{idStr}
				</foreach>
			</if>
543
			<if test="tSocialFundInfo.empTypeList != null and tSocialFundInfo.empTypeList.length>0">
544 545 546 547 548
				AND a.EMP_TYPE IN
				<foreach collection="tSocialFundInfo.empTypeList" item="item" index="index" open="(" separator="," close=")">
					#{item}
				</foreach>
			</if>
549 550 551
			<if test="tSocialFundInfo.id != null and tSocialFundInfo.id.trim() != ''">
				AND a.ID = #{tSocialFundInfo.id}
			</if>
fangxinjiang's avatar
fangxinjiang committed
552 553 554 555
			<if test="tSocialFundInfo.settleDomainCode != null and tSocialFundInfo.settleDomainCode.trim() != ''">
				AND a.SETTLE_DOMAIN_CODE = #{tSocialFundInfo.settleDomainCode}
			</if>

556 557 558 559 560 561 562
			<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() != ''">
563
				AND a.EMP_NAME like concat('%',#{tSocialFundInfo.empName},'%')
564 565
			</if>
			<if test="tSocialFundInfo.empIdcard != null and tSocialFundInfo.empIdcard.trim() != ''">
566
				AND a.EMP_IDCARD like concat('%',#{tSocialFundInfo.empIdcard},'%')
567 568 569 570 571 572 573 574
			</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() != ''">
hongguangwu's avatar
hongguangwu committed
575
				AND (a.SETTLE_DOMAIN_NAME like concat('%',#{tSocialFundInfo.settleDomainName},'%') or a.SETTLE_DOMAIN_NAME_FUND like concat('%',#{tSocialFundInfo.settleDomainName},'%'))
576 577
			</if>
			<if test="tSocialFundInfo.unitName != null and tSocialFundInfo.unitName.trim() != ''">
hongguangwu's avatar
hongguangwu committed
578
				AND (a.UNIT_NAME like concat('%',#{tSocialFundInfo.unitName},'%') or a.UNIT_NAME_FUND like concat('%',#{tSocialFundInfo.unitName},'%'))
579 580 581 582 583 584 585 586
			</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() != ''">
hongguangwu's avatar
hongguangwu committed
587
				AND a.SOCIAL_HOUSEHOLD_NAME like concat('%',#{tSocialFundInfo.socialHouseholdName},'%')
588 589 590 591 592 593 594 595 596 597 598 599 600 601
			</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() != ''">
hongguangwu's avatar
hongguangwu committed
602
				AND a.PROVIDENT_HOUSEHOLD_NAME like concat('%',#{tSocialFundInfo.providentHouseholdName},'%')
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888
			</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>
hongguangwu's avatar
hongguangwu committed
889 890 891 892 893 894
			<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>
huyuchen's avatar
huyuchen committed
895 896 897
			<if test="tSocialFundInfo.authSql != null and tSocialFundInfo.authSql.trim() != ''">
				${tSocialFundInfo.authSql}
			</if>
898 899 900 901 902 903 904 905 906 907 908
		</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>
fangxinjiang's avatar
fangxinjiang committed
909
		<!--group by a.id-->
910
		order by a.CREATE_TIME desc
911
	</select>
hongguangwu's avatar
hongguangwu committed
912

913
	<!--获取在用社保 #a.SOCIAL_ADD_STATUS != '4' and a.SOCIAL_REDUCE_STATUS != '2' -->
914 915
	<select id="getSocialList" resultMap="tSocialFundInfoMap">
		SELECT
916
		<include refid="Other_Base_Column_List"/>
917 918
		FROM t_social_fund_info a
		<where>
hongguangwu's avatar
hongguangwu committed
919
			a.SOCIAL_ID is not null
hongguangwu's avatar
hongguangwu committed
920 921 922 923 924 925 926 927 928
			<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>
929 930
		</where>
	</select>
931
	<!--获取在用公积金 a.FUND_ADD_STATUS != '4' and a.FUND_REDUCE_STATUS != '2' -->
932 933
	<select id="getFundList" resultMap="tSocialFundInfoMap">
		SELECT
934
		<include refid="Other_Base_Column_List"/>
935 936
		FROM t_social_fund_info a
		<where>
hongguangwu's avatar
hongguangwu committed
937
			a.FUND_ID is not null
hongguangwu's avatar
hongguangwu committed
938 939 940 941 942 943 944 945 946
			<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>
947 948 949
		</where>
	</select>

huyuchen's avatar
huyuchen committed
950 951 952 953 954 955 956 957 958 959 960
	<!--导出-->
	<select id="exportListCount" resultType="java.lang.Integer">
		select
		count(1)
		from t_social_fund_info a
		<where>
			1=1
			<include refid="tSocialFundInfo_where"/>
		</where>
	</select>

961 962 963
	<!--导出-->
	<select id="exportList" resultMap="exportMap">
		select
964 965 966
		a.ID,
		a.EMP_NAME,
		a.EMP_IDCARD,
fangxinjiang's avatar
fangxinjiang committed
967 968 969 970
		case when a.EMP_TYPE = 0 then "外包"
		when a.EMP_TYPE = 1 then "派遣"
		when a.EMP_TYPE = 2 then "代理"
		when a.EMP_TYPE = 3 then "内部员工"
971 972
		else null  end  as  "EMP_TYPE" ,
		d.EMP_MOBILE,
hongguangwu's avatar
hongguangwu committed
973 974 975
		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,
976 977 978 979 980 981 982 983 984
		a1.AREA_NAME as "ID_CARD_PROVINCE",
		a2.AREA_NAME as "ID_CARD_CITY",
		a3.AREA_NAME as "ID_CARD_TOWN",
		d.ID_CARD_ADDRESS,
		d1.AREA_NAME as "FILE_PROVINCE",
		d2.AREA_NAME as "FILE_CITY",
		d3.AREA_NAME as "FILE_TOWN",
		d.POST,
		d.TRY_PERIOD,
fangxinjiang's avatar
fangxinjiang committed
985 986 987 988
		case when d.WORKING_HOURS = 1 then "标准工时"
		when d.WORKING_HOURS = 2 then "综合工时"
		when d.WORKING_HOURS = 3 then "不定时工时制"
		else null  end  as  "WORKING_HOURS" ,
989 990 991 992 993 994 995 996 997
		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,
fangxinjiang's avatar
fangxinjiang committed
998
		<!--"社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败 10 审核不通过)、派减(6待审核 7待办理 8办理成功 9 办理失败  11 派减办理中 12 派减部分办理失败)" ) -->
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009
		case when a.SOCIAL_STATUS = 0 then "派增待审核"
		when a.SOCIAL_STATUS = 1 then "派增待办理"
		when a.SOCIAL_STATUS = 2 then "派增办理中"
		when a.SOCIAL_STATUS = 3 then "派增办理成功"
		when a.SOCIAL_STATUS = 4 then "派增部分办理失败"
		when a.SOCIAL_STATUS = 5 then "派增办理失败"
		when a.SOCIAL_STATUS = 6 then "派减待审核"
		when a.SOCIAL_STATUS = 7 then "派减待办理"
		when a.SOCIAL_STATUS = 8 then "派减办理成功"
		when a.SOCIAL_STATUS = 9 then "派减办理失败"
		when a.SOCIAL_STATUS = 10 then "派增审核不通过"
fangxinjiang's avatar
fangxinjiang committed
1010 1011
		WHEN a.SOCIAL_STATUS = 11 THEN "派减办理中"
		WHEN a.SOCIAL_STATUS = 12 THEN "派减部分办理失败"
1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045
		else null  end  as  "SOCIAL_STATUS" ,
		case when a.FUND_STATUS = 0 then "派增待审核"
		when a.FUND_STATUS = 1 then "派增待办理"
		when a.FUND_STATUS = 3 then "派增办理成功"
		when a.FUND_STATUS = 4 then "派增办理失败"
		when a.FUND_STATUS = 5 then "派减待审核"
		when a.FUND_STATUS = 6 then "派减待办理"
		when a.FUND_STATUS = 7 then "派减办理成功"
		when a.FUND_STATUS = 8 then "派减办理失败"
		when a.FUND_STATUS = 9 then "派增审核不通过"
		else null  end  as  "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,
		s1.AREA_NAME as "SOCIAL_PROVINCE",
		s2.AREA_NAME as "SOCIAL_CITY",
		s3.AREA_NAME as "SOCIAL_TOWN",
		a.PENSION_START,
		a.MEDICAL_START,
		a.UNEMPLOY_START,
		a.WORK_INJURY_START,
		a.BIRTH_START,
		a.BIGAILMENT_START,
		case when a.PAYMENT_TYPE = 0 then "最低"
		when a.PAYMENT_TYPE = 1 then "自定义"
		when a.PAYMENT_TYPE = 2 then "最高"
		else null  end  as  "PAYMENT_TYPE" ,
1046

1047 1048 1049 1050 1051 1052
		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,
1053

1054 1055 1056 1057 1058 1059
		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,
1060

1061 1062 1063 1064 1065 1066
		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,
1067

1068 1069 1070
		a.UNIT_WORK_INJURY_CARDINAL,
		a.UNIT_WORK_UNJURY_PER,
		a.UNIT_INJURY_MONEY,
1071

1072 1073 1074
		a.UNIT_BIRTH_CARDINAL,
		a.UNIT_BIRTH_PER,
		a.UNIT_BIRTH_MONEY,
1075

1076 1077 1078 1079 1080 1081
		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,
1082

1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
		a.PROVIDENT_HOUSEHOLD_NAME,
		f1.AREA_NAME as "FUND_PROVINCE",
		f2.AREA_NAME as "FUND_CITY",
		f3.AREA_NAME as "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,
		case when a.PENSION_HANDLE = 0 then "待办理"
		when a.PENSION_HANDLE = 1 then "办理成功"
		when a.PENSION_HANDLE = 2 then "办理失败"
		when a.PENSION_HANDLE = 3 then "已派减"
		else null  end  as  "PENSION_HANDLE" ,
		case when a.MEDICAL_HANDLE = 0 then "待办理"
		when a.MEDICAL_HANDLE = 1 then "办理成功"
		when a.MEDICAL_HANDLE = 2 then "办理失败"
		when a.MEDICAL_HANDLE = 3 then "已派减"
		else null  end  as  "MEDICAL_HANDLE" ,
		case when a.UNEMPLOY_HANDLE = 0 then "待办理"
		when a.UNEMPLOY_HANDLE = 1 then "办理成功"
		when a.UNEMPLOY_HANDLE = 2 then "办理失败"
		when a.UNEMPLOY_HANDLE = 3 then "已派减"
		else null  end  as  "UNEMPLOY_HANDLE" ,
		case when a.WORK_INJURY_HANDLE = 0 then "待办理"
		when a.WORK_INJURY_HANDLE = 1 then "办理成功"
		when a.WORK_INJURY_HANDLE = 2 then "办理失败"
		when a.WORK_INJURY_HANDLE = 3 then "已派减"
		else null  end  as  "WORK_INJURY_HANDLE" ,
		case when a.BIRTH_HANDLE = 0 then "待办理"
		when a.BIRTH_HANDLE = 1 then "办理成功"
		when a.BIRTH_HANDLE = 2 then "办理失败"
		when a.BIRTH_HANDLE = 3 then "已派减"
		else null  end  as  "BIRTH_HANDLE" ,
		case when a.BIGAILMENT_HANDLE = 0 then "待办理"
		when a.BIGAILMENT_HANDLE = 1 then "办理成功"
		when a.BIGAILMENT_HANDLE = 2 then "办理失败"
		when a.BIGAILMENT_HANDLE = 3 then "已派减"
		else null  end  as  "BIGAILMENT_HANDLE" ,
		d.EMP_NATIONAL,
		d.EMP_REGIS_TYPE
1126 1127
		from t_social_fund_info a
		left join t_dispatch_info d on a.DISPATCH_ID=d.ID
1128 1129 1130 1131 1132 1133
		LEFT JOIN sys_area a1 on d.ID_CARD_PROVINCE=a1.id
		LEFT JOIN sys_area a2 on d.ID_CARD_CITY=a2.id
		LEFT JOIN sys_area a3 on d.ID_CARD_TOWN=a3.id
		LEFT JOIN sys_area s1 on a.SOCIAL_PROVINCE=s1.id
		LEFT JOIN sys_area s2 on a.SOCIAL_CITY=s2.id
		LEFT JOIN sys_area s3 on a.SOCIAL_TOWN=s3.id
huyuchen's avatar
huyuchen committed
1134 1135 1136
		LEFT JOIN sys_area f1 on a.FUND_PROVINCE=f1.id
		LEFT JOIN sys_area f2 on a.FUND_CITY=f2.id
		LEFT JOIN sys_area f3 on a.FUND_TOWN=f3.id
1137 1138 1139 1140
		LEFT JOIN sys_area d1 on d.FILE_PROVINCE=d1.id
		LEFT JOIN sys_area d2 on d.FILE_CITY=d2.id
		LEFT JOIN sys_area d3 on d.FILE_TOWN=d3.id

1141 1142 1143 1144 1145 1146 1147 1148 1149
		<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>
huyuchen's avatar
huyuchen committed
1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168
	<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>

hongguangwu's avatar
hongguangwu committed
1169 1170
	<update id="updateSocialInfo">
		update t_social_info
huyuchen's avatar
huyuchen committed
1171 1172
		set SETTLE_DOMAIN   = #{infoVo.settleDomainId},
			SETTLE_DOMAIN_CODE = #{infoVo.settleDomainCode}
hongguangwu's avatar
hongguangwu committed
1173 1174 1175 1176
		where EMP_IDCARD = #{infoVo.empIdcard} and SETTLE_DOMAIN   = #{infoVo.oldDeptId}
	</update>
	<update id="updateFundInfo">
		update t_provident_fund
huyuchen's avatar
huyuchen committed
1177 1178
		set SETTLE_DOMAIN   = #{infoVo.settleDomainId},
			SETTLE_DOMAIN_CODE = #{infoVo.settleDomainCode}
hongguangwu's avatar
hongguangwu committed
1179 1180 1181
		where EMP_IDCARD = #{infoVo.empIdcard} and SETTLE_DOMAIN   = #{infoVo.oldDeptId}
	</update>

1182
	<!--获取count,合同使用-->
hongguangwu's avatar
hongguangwu committed
1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
	<select id="selectSocialByContract" resultType="java.lang.String">
		SELECT
			HANDLE_STATUS
		FROM t_social_info a
		where a.EMP_IDCARD = #{tSocialFundInfo.empIdcard} and a.SETTLE_DOMAIN = #{tSocialFundInfo.settleDomain} ORDER BY a.CREATE_TIME desc limit 1
	</select>

	<!--获取count,合同使用-->
	<select id="selectFundByContract" resultType="java.lang.String">
		SELECT
			HANDLE_STATUS
		FROM t_provident_fund a
		where a.EMP_IDCARD = #{tSocialFundInfo.empIdcard} and a.SETTLE_DOMAIN = #{tSocialFundInfo.settleDomain} ORDER BY a.CREATE_TIME desc limit 1
1196 1197
	</select>

1198 1199 1200 1201 1202
	<!-- 获取在保的全量数据,定时任务处理不购买商险 -->
	<select id="getSocialWorkInjuryList" resultType="java.lang.String">
		SELECT EMP_IDCARD FROM t_social_fund_info s where s.WORK_INJURY_HANDLE in ('0','1','4','5')
	</select>

fangxinjiang's avatar
fangxinjiang committed
1203
</mapper>