SysBaseSetInfoMapper.xml 18.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
<?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.SysBaseSetInfoMapper">

	<resultMap id="sysBaseSetInfoMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo">
		<id property="id" column="ID"/>
		<result property="province" column="PROVINCE"/>
		<result property="city" column="CITY"/>
		<result property="town" column="TOWN"/>
		<result property="applyStartDate" column="APPLY_START_DATE"/>
		<result property="applyEndDate" column="APPLY_END_DATE"/>
		<result property="upperLimit" column="UPPER_LIMIT"/>
		<result property="lowerLimit" column="LOWER_LIMIT"/>
		<result property="payPolicy" column="PAY_POLICY"/>
		<result property="baseType" column="BASE_TYPE"/>
		<result property="unitPersionPro" column="UNIT_PERSION_PRO"/>
		<result property="unitMedicalPro" column="UNIT_MEDICAL_PRO"/>
		<result property="unitUnemploymentPro" column="UNIT_UNEMPLOYMENT_PRO"/>
		<result property="unitInjuryPro" column="UNIT_INJURY_PRO"/>
		<result property="unitBirthPro" column="UNIT_BIRTH_PRO"/>
		<result property="unitProSum" column="UNIT_PRO_SUM"/>
		<result property="personalPersionPro" column="PERSONAL_PERSION_PRO"/>
		<result property="personalMedicalPro" column="PERSONAL_MEDICAL_PRO"/>
		<result property="personalUnemploymentPro" column="PERSONAL_UNEMPLOYMENT_PRO"/>
		<result property="personalProSum" column="PERSONAL_PRO_SUM"/>
		<result property="isIllness" column="IS_ILLNESS"/>
		<result property="isChargePersonal" column="IS_CHARGE_PERSONAL"/>
		<result property="chargeCompany" column="CHARGE_COMPANY"/>
		<result property="chargePersonal" column="CHARGE_PERSONAL"/>
		<result property="collectType" column="COLLECT_TYPE"/>
		<result property="payCompany" column="PAY_COMPANY"/>
		<result property="payCompanyPro" column="PAY_COMPANY_PRO"/>
		<result property="payPersonal" column="PAY_PERSONAL"/>
		<result property="payPersonalPro" column="PAY_PERSONAL_PRO"/>
		<result property="collectMoth" column="COLLECT_MOTH"/>
		<result property="fundPayLowerLimit" column="FUND_PAY_LOWER_LIMIT"/>
		<result property="fundPayUpperLimit" column="FUND_PAY_UPPER_LIMIT"/>
		<result property="fundPayPoint" column="FUND_PAY_POINT"/>
		<result property="fundPayType" column="FUND_PAY_TYPE"/>
		<result property="housingFundCompamyPro" column="HOUSING_FUND_COMPAMY_PRO"/>
		<result property="housingFundPersonalPro" column="HOUSING_FUND_PERSONAL_PRO"/>
		<result property="departId" column="DEPART_ID"/>
		<result property="status" column="STATUS"/>
		<result property="valueType" column="VALUE_TYPE"/>
		<result property="canOverpay" column="CAN_OVERPAY"/>
		<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="insuranceIsLatestCardinality" column="INSURANCE_IS_LATEST_CARDINALITY"/>
		<result property="deleteFlag" column="DELETE_FLAG"/>
		<result property="departName" column="DEPART_NAME"/>
hongguangwu's avatar
hongguangwu committed
78
		<result property="doMonth" column="DO_MONTH"/>
79 80 81 82 83
		<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"/>
huyuchen's avatar
huyuchen committed
84 85 86 87 88 89 90 91 92 93 94 95
		<result property="upPersion" column="UP_PERSION"/>
		<result property="upMedical" column="UP_MEDICAL"/>
		<result property="upUnemployment" column="UP_UNEMPLOYMENT"/>
		<result property="upInjury" column="UP_INJURY"/>
		<result property="upBirth" column="UP_BIRTH"/>
		<result property="upBig" column="UP_BIG"/>
		<result property="lowerPersion" column="LOWER_PERSION"/>
		<result property="lowerMedical" column="LOWER_MEDICAL"/>
		<result property="lowerUnemployment" column="LOWER_UNEMPLOYMENT"/>
		<result property="lowerInjury" column="LOWER_INJURY"/>
		<result property="lowerBirth" column="LOWER_BIRTH"/>
		<result property="lowerBig" column="LOWER_BIG"/>
huyuchen's avatar
huyuchen committed
96
		<result property="isSameBase" column="IS_SAME_BASE"/>
97
		<collection property="fundProList" ofType="com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion"
fangxinjiang's avatar
fangxinjiang committed
98
					select="com.yifu.cloud.plus.v1.yifu.social.mapper.SysPayProportionMapper.selectByPrimaryId" column="id">
99
		</collection>
100 101
	</resultMap>
	<sql id="Base_Column_List">
hongguangwu's avatar
hongguangwu committed
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 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 157
		a.ID,
		a.PROVINCE,
		a.CITY,
		a.TOWN,
		a.APPLY_START_DATE,
		a.APPLY_END_DATE,
		a.UPPER_LIMIT,
		a.LOWER_LIMIT,
		a.PAY_POLICY,
		a.BASE_TYPE,
		a.UNIT_PERSION_PRO,
		a.UNIT_MEDICAL_PRO,
		a.UNIT_UNEMPLOYMENT_PRO,
		a.UNIT_INJURY_PRO,
		a.UNIT_BIRTH_PRO,
		a.UNIT_PRO_SUM,
		a.PERSONAL_PERSION_PRO,
		a.PERSONAL_MEDICAL_PRO,
		a.PERSONAL_UNEMPLOYMENT_PRO,
		a.PERSONAL_PRO_SUM,
		a.IS_ILLNESS,
		a.IS_CHARGE_PERSONAL,
		a.CHARGE_COMPANY,
		a.CHARGE_PERSONAL,
		a.COLLECT_TYPE,
		a.PAY_COMPANY,
		a.PAY_COMPANY_PRO,
		a.PAY_PERSONAL,
		a.PAY_PERSONAL_PRO,
		a.COLLECT_MOTH,
		a.FUND_PAY_LOWER_LIMIT,
		a.FUND_PAY_UPPER_LIMIT,
		a.FUND_PAY_POINT,
		a.FUND_PAY_TYPE,
		a.HOUSING_FUND_COMPAMY_PRO,
		a.HOUSING_FUND_PERSONAL_PRO,
		a.DEPART_ID,
		a.STATUS,
		a.VALUE_TYPE,
		a.CAN_OVERPAY,
		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.INSURANCE_IS_LATEST_CARDINALITY,
		a.DELETE_FLAG,
		a.DEPART_NAME,
		a.DO_MONTH,
		a.CREATE_BY,
		a.UPDATE_BY,
		a.CREATE_NAME,
		a.CREATE_TIME,
huyuchen's avatar
huyuchen committed
158 159 160 161 162 163 164 165 166 167 168 169
		a.UPDATE_TIME,
		UP_PERSION,
		UP_MEDICAL,
		UP_UNEMPLOYMENT,
		UP_INJURY,
		UP_BIRTH,
		UP_BIG,
		LOWER_PERSION,
		LOWER_MEDICAL,
		LOWER_UNEMPLOYMENT,
		LOWER_INJURY,
		LOWER_BIRTH,
huyuchen's avatar
huyuchen committed
170
		IS_SAME_BASE,
huyuchen's avatar
huyuchen committed
171
		LOWER_BIG
172 173 174 175 176 177 178 179 180 181
	</sql>
	<sql id="sysBaseSetInfo_where">
		<if test="sysBaseSetInfo != null">
			<if test="sysBaseSetInfo.id != null and sysBaseSetInfo.id.trim() != ''">
				AND a.ID = #{sysBaseSetInfo.id}
			</if>
			<if test="sysBaseSetInfo.province != null">
				AND a.PROVINCE = #{sysBaseSetInfo.province}
			</if>
			<if test="sysBaseSetInfo.city != null">
182 183 184 185 186 187
				<if test="sysBaseSetInfo.city != -1">
					AND a.CITY = #{sysBaseSetInfo.city}
				</if>
				<if test="sysBaseSetInfo.city == -1">
					AND a.CITY is null
				</if>
188 189
			</if>
			<if test="sysBaseSetInfo.town != null">
190 191 192 193 194 195
				<if test="sysBaseSetInfo.town != -1">
					AND a.TOWN = #{sysBaseSetInfo.town}
				</if>
				<if test="sysBaseSetInfo.town == -1">
					AND a.TOWN is null
				</if>
196
			</if>
hongguangwu's avatar
hongguangwu committed
197 198 199 200
			<if test="sysBaseSetInfo.applyStartDate != null">
				AND a.APPLY_START_DATE <![CDATA[ <= ]]> #{sysBaseSetInfo.applyStartDate}
				AND (a.APPLY_END_DATE is null or a.APPLY_END_DATE <![CDATA[ >= ]]> #{sysBaseSetInfo.applyStartDate})
			</if>
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 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 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
			<if test="sysBaseSetInfo.applyEndDate != null">
				AND a.APPLY_END_DATE = #{sysBaseSetInfo.applyEndDate}
			</if>
			<if test="sysBaseSetInfo.upperLimit != null">
				AND a.UPPER_LIMIT = #{sysBaseSetInfo.upperLimit}
			</if>
			<if test="sysBaseSetInfo.lowerLimit != null">
				AND a.LOWER_LIMIT = #{sysBaseSetInfo.lowerLimit}
			</if>
			<if test="sysBaseSetInfo.payPolicy != null and sysBaseSetInfo.payPolicy.trim() != ''">
				AND a.PAY_POLICY = #{sysBaseSetInfo.payPolicy}
			</if>
			<if test="sysBaseSetInfo.baseType != null and sysBaseSetInfo.baseType.trim() != ''">
				AND a.BASE_TYPE = #{sysBaseSetInfo.baseType}
			</if>
			<if test="sysBaseSetInfo.unitPersionPro != null">
				AND a.UNIT_PERSION_PRO = #{sysBaseSetInfo.unitPersionPro}
			</if>
			<if test="sysBaseSetInfo.unitMedicalPro != null">
				AND a.UNIT_MEDICAL_PRO = #{sysBaseSetInfo.unitMedicalPro}
			</if>
			<if test="sysBaseSetInfo.unitUnemploymentPro != null">
				AND a.UNIT_UNEMPLOYMENT_PRO = #{sysBaseSetInfo.unitUnemploymentPro}
			</if>
			<if test="sysBaseSetInfo.unitInjuryPro != null">
				AND a.UNIT_INJURY_PRO = #{sysBaseSetInfo.unitInjuryPro}
			</if>
			<if test="sysBaseSetInfo.unitBirthPro != null">
				AND a.UNIT_BIRTH_PRO = #{sysBaseSetInfo.unitBirthPro}
			</if>
			<if test="sysBaseSetInfo.unitProSum != null">
				AND a.UNIT_PRO_SUM = #{sysBaseSetInfo.unitProSum}
			</if>
			<if test="sysBaseSetInfo.personalPersionPro != null">
				AND a.PERSONAL_PERSION_PRO = #{sysBaseSetInfo.personalPersionPro}
			</if>
			<if test="sysBaseSetInfo.personalMedicalPro != null">
				AND a.PERSONAL_MEDICAL_PRO = #{sysBaseSetInfo.personalMedicalPro}
			</if>
			<if test="sysBaseSetInfo.personalUnemploymentPro != null">
				AND a.PERSONAL_UNEMPLOYMENT_PRO = #{sysBaseSetInfo.personalUnemploymentPro}
			</if>
			<if test="sysBaseSetInfo.personalProSum != null">
				AND a.PERSONAL_PRO_SUM = #{sysBaseSetInfo.personalProSum}
			</if>
			<if test="sysBaseSetInfo.isIllness != null and sysBaseSetInfo.isIllness.trim() != ''">
				AND a.IS_ILLNESS = #{sysBaseSetInfo.isIllness}
			</if>
			<if test="sysBaseSetInfo.isChargePersonal != null and sysBaseSetInfo.isChargePersonal.trim() != ''">
				AND a.IS_CHARGE_PERSONAL = #{sysBaseSetInfo.isChargePersonal}
			</if>
			<if test="sysBaseSetInfo.chargeCompany != null">
				AND a.CHARGE_COMPANY = #{sysBaseSetInfo.chargeCompany}
			</if>
			<if test="sysBaseSetInfo.chargePersonal != null">
				AND a.CHARGE_PERSONAL = #{sysBaseSetInfo.chargePersonal}
			</if>
			<if test="sysBaseSetInfo.collectType != null and sysBaseSetInfo.collectType.trim() != ''">
				AND a.COLLECT_TYPE = #{sysBaseSetInfo.collectType}
			</if>
			<if test="sysBaseSetInfo.payCompany != null">
				AND a.PAY_COMPANY = #{sysBaseSetInfo.payCompany}
			</if>
			<if test="sysBaseSetInfo.payCompanyPro != null">
				AND a.PAY_COMPANY_PRO = #{sysBaseSetInfo.payCompanyPro}
			</if>
			<if test="sysBaseSetInfo.payPersonal != null">
				AND a.PAY_PERSONAL = #{sysBaseSetInfo.payPersonal}
			</if>
			<if test="sysBaseSetInfo.payPersonalPro != null">
				AND a.PAY_PERSONAL_PRO = #{sysBaseSetInfo.payPersonalPro}
			</if>
			<if test="sysBaseSetInfo.collectMoth != null">
				AND a.COLLECT_MOTH = #{sysBaseSetInfo.collectMoth}
			</if>
			<if test="sysBaseSetInfo.fundPayLowerLimit != null">
				AND a.FUND_PAY_LOWER_LIMIT = #{sysBaseSetInfo.fundPayLowerLimit}
			</if>
			<if test="sysBaseSetInfo.fundPayUpperLimit != null">
				AND a.FUND_PAY_UPPER_LIMIT = #{sysBaseSetInfo.fundPayUpperLimit}
			</if>
			<if test="sysBaseSetInfo.fundPayPoint != null">
				AND a.FUND_PAY_POINT = #{sysBaseSetInfo.fundPayPoint}
			</if>
			<if test="sysBaseSetInfo.fundPayType != null">
				AND a.FUND_PAY_TYPE = #{sysBaseSetInfo.fundPayType}
			</if>
			<if test="sysBaseSetInfo.housingFundCompamyPro != null">
				AND a.HOUSING_FUND_COMPAMY_PRO = #{sysBaseSetInfo.housingFundCompamyPro}
			</if>
			<if test="sysBaseSetInfo.housingFundPersonalPro != null">
				AND a.HOUSING_FUND_PERSONAL_PRO = #{sysBaseSetInfo.housingFundPersonalPro}
			</if>
			<if test="sysBaseSetInfo.departId != null and sysBaseSetInfo.departId.trim() != ''">
				AND a.DEPART_ID = #{sysBaseSetInfo.departId}
			</if>
			<if test="sysBaseSetInfo.status != null">
				AND a.STATUS = #{sysBaseSetInfo.status}
			</if>
			<if test="sysBaseSetInfo.valueType != null and sysBaseSetInfo.valueType.trim() != ''">
				AND a.VALUE_TYPE = #{sysBaseSetInfo.valueType}
			</if>
			<if test="sysBaseSetInfo.canOverpay != null and sysBaseSetInfo.canOverpay.trim() != ''">
				AND a.CAN_OVERPAY = #{sysBaseSetInfo.canOverpay}
			</if>
			<if test="sysBaseSetInfo.overpayNumber != null">
				AND a.OVERPAY_NUMBER = #{sysBaseSetInfo.overpayNumber}
			</if>
			<if test="sysBaseSetInfo.haveThisMonth != null and sysBaseSetInfo.haveThisMonth.trim() != ''">
				AND a.HAVE_THIS_MONTH = #{sysBaseSetInfo.haveThisMonth}
			</if>
			<if test="sysBaseSetInfo.insurancePension != null and sysBaseSetInfo.insurancePension.trim() != ''">
				AND a.INSURANCE_PENSION = #{sysBaseSetInfo.insurancePension}
			</if>
			<if test="sysBaseSetInfo.insuranceMedical != null and sysBaseSetInfo.insuranceMedical.trim() != ''">
				AND a.INSURANCE_MEDICAL = #{sysBaseSetInfo.insuranceMedical}
			</if>
			<if test="sysBaseSetInfo.insuranceUnemployment != null and sysBaseSetInfo.insuranceUnemployment.trim() != ''">
				AND a.INSURANCE_UNEMPLOYMENT = #{sysBaseSetInfo.insuranceUnemployment}
			</if>
			<if test="sysBaseSetInfo.insuranceInjury != null and sysBaseSetInfo.insuranceInjury.trim() != ''">
				AND a.INSURANCE_INJURY = #{sysBaseSetInfo.insuranceInjury}
			</if>
			<if test="sysBaseSetInfo.insuranceBirth != null and sysBaseSetInfo.insuranceBirth.trim() != ''">
				AND a.INSURANCE_BIRTH = #{sysBaseSetInfo.insuranceBirth}
			</if>
			<if test="sysBaseSetInfo.insuranceBigailment != null and sysBaseSetInfo.insuranceBigailment.trim() != ''">
				AND a.INSURANCE_BIGAILMENT = #{sysBaseSetInfo.insuranceBigailment}
			</if>
			<if test="sysBaseSetInfo.insuranceIsLatestCardinality != null and sysBaseSetInfo.insuranceIsLatestCardinality.trim() != ''">
				AND a.INSURANCE_IS_LATEST_CARDINALITY = #{sysBaseSetInfo.insuranceIsLatestCardinality}
			</if>
			<if test="sysBaseSetInfo.deleteFlag != null and sysBaseSetInfo.deleteFlag.trim() != ''">
				AND a.DELETE_FLAG = #{sysBaseSetInfo.deleteFlag}
			</if>
			<if test="sysBaseSetInfo.departName != null and sysBaseSetInfo.departName.trim() != ''">
hongguangwu's avatar
hongguangwu committed
337 338 339 340 341 342 343
				AND a.DEPART_NAME like concat('%',#{sysBaseSetInfo.departName},'%')
			</if>
			<if test="sysBaseSetInfo.applyDate != null and sysBaseSetInfo.applyDate.trim() != ''">
				AND (
					a.APPLY_START_DATE <![CDATA[ <= ]]> #{sysBaseSetInfo.applyDate}
					and (a.APPLY_END_DATE is null or a.APPLY_END_DATE >= #{sysBaseSetInfo.applyDate})
				)
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
			</if>
			<if test="sysBaseSetInfo.createBy != null and sysBaseSetInfo.createBy.trim() != ''">
				AND a.CREATE_BY = #{sysBaseSetInfo.createBy}
			</if>
			<if test="sysBaseSetInfo.updateBy != null and sysBaseSetInfo.updateBy.trim() != ''">
				AND a.UPDATE_BY = #{sysBaseSetInfo.updateBy}
			</if>
			<if test="sysBaseSetInfo.createName != null and sysBaseSetInfo.createName.trim() != ''">
				AND a.CREATE_NAME = #{sysBaseSetInfo.createName}
			</if>
			<if test="sysBaseSetInfo.createTime != null">
				AND a.CREATE_TIME = #{sysBaseSetInfo.createTime}
			</if>
			<if test="sysBaseSetInfo.updateTime != null">
				AND a.UPDATE_TIME = #{sysBaseSetInfo.updateTime}
			</if>
		</if>
	</sql>
	<!--sysBaseSetInfo简单分页查询-->
	<select id="getSysBaseSetInfoPage" resultMap="sysBaseSetInfoMap">
hongguangwu's avatar
hongguangwu committed
364 365
		SELECT
			<include refid="Base_Column_List"/>
366 367 368 369 370 371 372
		FROM sys_base_set_info a
		<where>
			1=1
			<include refid="sysBaseSetInfo_where"/>
		</where>
		order by a.CREATE_TIME desc
	</select>
huyuchen's avatar
huyuchen committed
373 374
	<!--sysBaseSetInfo简单查询-->
	<select id="getAllByEntity" resultMap="sysBaseSetInfoMap">
hongguangwu's avatar
hongguangwu committed
375
		SELECT
hongguangwu's avatar
hongguangwu committed
376
			<include refid="Base_Column_List"/>
huyuchen's avatar
huyuchen committed
377 378 379 380 381 382
		FROM sys_base_set_info a
		<where>
			1=1
			<include refid="sysBaseSetInfo_where"/>
		</where>
	</select>
383 384 385

	<!--获取对应户名称的公积金基数信息-->
	<select id="getFundBaseSet" resultMap="sysBaseSetInfoMap">
hongguangwu's avatar
hongguangwu committed
386
		SELECT
hongguangwu's avatar
hongguangwu committed
387
			<include refid="Base_Column_List"/>
388 389 390
		FROM sys_base_set_info a
		<where>
			1=1
391
			and a.APPLY_START_DATE  <![CDATA[ <= ]]> now()
392
			<if test="fundHolds != null and fundHolds.size > 0">
393
				and a.DEPART_NAME in
394 395 396 397
				<foreach collection="fundHolds" item="item" open="(" close=")" separator="," >
					#{item}
				</foreach>
			</if>
398 399 400 401

			and a.DELETE_FLAG = '0'
			and a.status ='0'
			and a.BASE_TYPE = '1'
402 403
		</where>
	</select>
hongguangwu's avatar
hongguangwu committed
404 405 406

	<!--sysBaseSetInfo不分页查询-->
	<select id="getSysBaseSetInfoNoPage" resultMap="sysBaseSetInfoMap">
hongguangwu's avatar
hongguangwu committed
407
		SELECT
hongguangwu's avatar
hongguangwu committed
408
			<include refid="Base_Column_List"/>
hongguangwu's avatar
hongguangwu committed
409 410 411 412 413 414 415
		FROM sys_base_set_info a
		<where>
			1=1
			<include refid="sysBaseSetInfo_where"/>
		</where>
		ORDER BY a.apply_start_date desc
	</select>
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

	<!-- 获取条数-->
	<select id="getCountByEdit" resultType="java.lang.Integer">
		SELECT
			count(1)
		FROM sys_base_set_info a
		<where>
			a.STATUS = 0 and a.ID != #{sysBaseSetInfo.id}
			<if test="sysBaseSetInfo.baseType != null and sysBaseSetInfo.baseType.trim() != ''">
				AND a.BASE_TYPE = #{sysBaseSetInfo.baseType}
			</if>
			<if test="sysBaseSetInfo.departId != null and sysBaseSetInfo.departId.trim() != ''">
				AND a.DEPART_ID = #{sysBaseSetInfo.departId}
			</if>
			<if test="sysBaseSetInfo.province != null">
				AND a.PROVINCE = #{sysBaseSetInfo.province}
			</if>
			<if test="sysBaseSetInfo.city != null">
				AND a.CITY = #{sysBaseSetInfo.city}
			</if>
			<if test="sysBaseSetInfo.city == null">
				AND a.CITY is null
			</if>
			<if test="sysBaseSetInfo.town != null">
				AND a.TOWN = #{sysBaseSetInfo.town}
			</if>
			<if test="sysBaseSetInfo.town == null">
				AND a.TOWN is null
			</if>
			<if test="sysBaseSetInfo.applyEndDate == null">
				AND a.APPLY_END_DATE <![CDATA[ >= ]]> #{sysBaseSetInfo.applyStartDate}
			</if>
			<if test="sysBaseSetInfo.applyEndDate != null">
				AND (
				(apply_end_date is not null and (
				(
				apply_start_date <![CDATA[ <= ]]> #{sysBaseSetInfo.applyEndDate}
				and apply_end_date >= #{sysBaseSetInfo.applyEndDate}
				) or (
				apply_start_date <![CDATA[ <= ]]> #{sysBaseSetInfo.applyStartDate}
				and apply_end_date >= #{sysBaseSetInfo.applyStartDate}
				) or (
				apply_start_date >= #{sysBaseSetInfo.applyStartDate}
				and apply_end_date <![CDATA[ <= ]]> #{sysBaseSetInfo.applyEndDate}
				)
				)) or (apply_end_date is null and apply_start_date <![CDATA[ <= ]]> #{sysBaseSetInfo.applyEndDate})
				)
			</if>
		</where>
		limit 1
	</select>
467
</mapper>