TEmployeeContractInfoMapper.xml 22.3 KB
Newer Older
hongguangwu's avatar
hongguangwu committed
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
<?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.archives.mapper.TEmployeeContractInfoMapper">

	<resultMap id="tEmployeeContrctInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo">
		<id property="id" column="ID"/>
		<result property="empNo" column="EMP_NO"/>
		<result property="empId" column="EMP_ID"/>
		<result property="empName" column="EMP_NAME"/>
		<result property="empIdcard" column="EMP_IDCARD"/>
		<result property="contractName" column="CONTRACT_NAME"/>
		<result property="contractType" column="CONTRACT_TYPE"/>
		<result property="contractEnd" column="CONTRACT_END"/>
		<result property="subjectDepart" column="SUBJECT_DEPART"/>
		<result property="subjectUnit" column="SUBJECT_UNIT"/>
		<result property="situation" column="SITUATION"/>
		<result property="contractTerm" column="CONTRACT_TERM"/>
		<result property="contractNo" column="CONTRACT_NO"/>
		<result property="remark" column="REMARK"/>
		<result property="isObsolete" column="IS_OBSOLETE"/>
		<result property="isFile" column="IS_FILE"/>
		<result property="oldId" column="OLD_ID"/>
		<result property="enjoinDate" column="ENJOIN_DATE"/>
		<result property="post" column="POST"/>
		<result property="workingHours" column="WORKING_HOURS"/>
		<result property="fileCabinetNo" column="FILE_CABINET_NO"/>
		<result property="settleDomain" column="SETTLE_DOMAIN"/>
		<result property="inUse" column="IN_USE"/>
		<result property="obsoleteReason" column="OBSOLETE_REASON"/>
		<result property="customerId" column="CUSTOMER_ID"/>
		<result property="fileProvince" column="FILE_PROVINCE"/>
		<result property="fileCity" column="FILE_CITY"/>
		<result property="fileTown" column="FILE_TOWN"/>
		<result property="workingStatusSub" column="WORKING_STATUS_SUB"/>
		<result property="workFlag" column="WORK_FLAG"/>
		<result property="periodStart" column="PERIOD_START"/>
		<result property="periodEnd" column="PERIOD_END"/>
		<result property="periodSalaryPerMonth" column="PERIOD_SALARY_PER_MONTH"/>
		<result property="salaryType" column="SALARY_TYPE"/>
		<result property="salaryStandardPerHour" column="SALARY_STANDARD_PER_HOUR"/>
		<result property="salaryStandardPerPiece" column="SALARY_STANDARD_PER_PIECE"/>
		<result property="dispatchFlag" column="DISPATCH_FLAG"/>
		<result property="warnEmailUserId" column="WARN_EMAIL_USER_ID"/>
		<result property="fddFlag" column="FDD_FLAG"/>
		<result property="isSign" column="IS_SIGN"/>
		<result property="createName" column="CREATE_NAME"/>
huyuchen's avatar
huyuchen committed
68
		<result property="createBy" column="CREATE_BY"/>
hongguangwu's avatar
hongguangwu committed
69 70 71
		<result property="createTime" column="CREATE_TIME"/>
		<result property="updateBy" column="UPDATE_BY"/>
		<result property="updateTime" column="UPDATE_TIME"/>
hongguangwu's avatar
hongguangwu committed
72 73 74 75
		<result property="unitNo" column="UNIT_NO"/>
		<result property="deptNo" column="DEPT_NO"/>
		<result property="applyNo" column="APPLY_NO"/>
		<result property="auditStatus" column="AUDIT_STATUS"/>
hongguangwu's avatar
hongguangwu committed
76
		<result property="deleteFlag" column="DELETE_FLAG"/>
hongguangwu's avatar
hongguangwu committed
77 78 79
		<result property="empNatrue" column="EMP_NATRUE"/>
		<result property="contractParty" column="CONTRACT_PARTY"/>
		<result property="contractSubName" column="CONTRACT_SUB_NAME"/>
hongguangwu's avatar
hongguangwu committed
80
		<result property="reason" column="REASON"/>
81 82
		<result property="auditTimeLast" column="AUDIT_TIME_LAST"/>

83 84 85 86
		<result property="type" column="TYPE"/>
		<result property="leaveDate" column="LEAVE_DATE"/>
		<result property="reduceReason" column="REDUCE_REASON"/>

hongguangwu's avatar
hongguangwu committed
87
	</resultMap>
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
	<!-- 合同审核导出 -->
	<resultMap id="empContractExportAuditMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportAuditVO">
		<result property="empName" column="EMP_NAME"/>
		<result property="empIdcard" column="EMP_IDCARD"/>
		<result property="contractName" column="CONTRACT_NAME"/>
		<result property="contractType" column="CONTRACT_TYPE"/>
		<result property="contractEnd" column="CONTRACT_END"/>
		<result property="subjectDepart" column="SUBJECT_DEPART"/>
		<result property="subjectUnit" column="SUBJECT_UNIT"/>
		<result property="situation" column="SITUATION"/>
		<result property="workingHours" column="WORKING_HOURS"/>
		<result property="createName" column="CREATE_NAME"/>
		<result property="createTime" column="CREATE_TIME"/>
		<result property="contractSubName" column="CONTRACT_SUB_NAME"/>
		<result property="reason" column="REASON"/>
hongguangwu's avatar
hongguangwu committed
103

104 105 106 107
		<result property="type" column="TYPE"/>
		<result property="leaveDate" column="LEAVE_DATE"/>
		<result property="reduceReason" column="REDUCE_REASON"/>
	</resultMap>
hongguangwu's avatar
hongguangwu committed
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
	<!-- 合同导出 -->
	<resultMap id="tEmployeeContrctInfoExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO">
		<result property="applyNo" column="APPLY_NO"/>
		<result property="empNo" column="EMP_NO"/>
		<result property="empName" column="EMP_NAME"/>
		<result property="empIdcard" column="EMP_IDCARD"/>
		<result property="contractStart" column="CONTRACT_START"/>
		<result property="contractEnd" column="CONTRACT_END"/>
		<result property="fileProvince" column="FILE_PROVINCE"/>
		<result property="fileCity" column="FILE_CITY"/>
		<result property="fileTown" column="FILE_TOWN"/>
		<result property="subjectDepart" column="SUBJECT_DEPART"/>
		<result property="deptNo" column="DEPT_NO"/>
		<result property="empNatrue" column="EMP_NATRUE"/>
		<result property="contractName" column="CONTRACT_NAME"/>
		<result property="contractSubName" column="CONTRACT_SUB_NAME"/>
		<result property="situation" column="SITUATION"/>
		<result property="contractType" column="CONTRACT_TYPE"/>
		<result property="contractParty" column="CONTRACT_PARTY"/>
		<result property="subjectUnit" column="SUBJECT_UNIT"/>
		<result property="auditStatus" column="AUDIT_STATUS"/>
		<result property="inUse" column="IN_USE"/>
		<result property="files" column="FILES"/>
		<result property="isFile" column="IS_FILE"/>
		<result property="createName" column="CREATE_NAME"/>
		<result property="createTime" column="CREATE_TIME"/>
		<result property="createNum" column="CREATE_NUM"/>
		<result property="startDate" column="START_DATE"/>
		<result property="endDate" column="END_DATE"/>
		<result property="history" column="HISTORY"/>
fangxinjiang's avatar
fangxinjiang committed
138
		<result property="type" column="TYPE"/>
hongguangwu's avatar
hongguangwu committed
139 140 141

	</resultMap>

hongguangwu's avatar
hongguangwu committed
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
	<sql id="Base_Column_List">
		a.ID,
		a.EMP_NO,
		a.EMP_ID,
		a.EMP_NAME,
		a.EMP_IDCARD,
		a.CONTRACT_NAME,
		a.CONTRACT_TYPE,
		a.CONTRACT_START,
		a.CONTRACT_END,
		a.SUBJECT_DEPART,
		a.SUBJECT_UNIT,
		a.SITUATION,
		a.CONTRACT_TERM,
		a.CONTRACT_NO,
		a.REMARK,
		a.IS_OBSOLETE,
		a.IS_FILE,
		a.OLD_ID,
		a.ENJOIN_DATE,
		a.POST,
		a.WORKING_HOURS,
		a.FILE_CABINET_NO,
		a.SETTLE_DOMAIN,
		a.IN_USE,
		a.OBSOLETE_REASON,
		a.CUSTOMER_ID,
		a.FILE_PROVINCE,
		a.FILE_CITY,
		a.FILE_TOWN,
		a.WORKING_STATUS_SUB,
		a.WORK_FLAG,
		a.PERIOD_START,
		a.PERIOD_END,
		a.PERIOD_SALARY_PER_MONTH,
		a.SALARY_TYPE,
		a.SALARY_STANDARD_PER_HOUR,
		a.SALARY_STANDARD_PER_PIECE,
		a.DISPATCH_FLAG,
		a.WARN_EMAIL_USER_ID,
		a.FDD_FLAG,
		a.IS_SIGN,
		a.CREATE_BY,
		a.CREATE_NAME,
		a.CREATE_TIME,
		a.UPDATE_BY,
hongguangwu's avatar
hongguangwu committed
188 189 190 191
		a.UPDATE_TIME,
		a.UNIT_NO,
		a.DEPT_NO,
		a.AUDIT_STATUS,
hongguangwu's avatar
hongguangwu committed
192
		a.APPLY_NO,
hongguangwu's avatar
hongguangwu committed
193 194 195
		a.DELETE_FLAG,
		a.EMP_NATRUE,
		a.CONTRACT_PARTY,
hongguangwu's avatar
hongguangwu committed
196
		a.CONTRACT_SUB_NAME,
197
		a.REASON,
198 199 200
		a.AUDIT_TIME_LAST,
		a.TYPE,
		a.LEAVE_DATE,
fangxinjiang's avatar
fangxinjiang committed
201
		a.REDUCE_REASON,a.type
hongguangwu's avatar
hongguangwu committed
202

hongguangwu's avatar
hongguangwu committed
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
	</sql>

	<!-- 导出 -->
	<sql id="Base_Export_Column_List">
		a.APPLY_NO,
		a.EMP_NO,
		a.EMP_NAME,
		a.EMP_IDCARD,
		a.CONTRACT_START,
		a.CONTRACT_END,
		a.FILE_PROVINCE,
		a.FILE_CITY,
		a.FILE_TOWN,
		a.SUBJECT_DEPART,
		a.DEPT_NO,
		a.EMP_NATRUE,
		a.CONTRACT_NAME,
		a.CONTRACT_SUB_NAME,
		a.SITUATION,
		a.CONTRACT_TYPE,
		a.CONTRACT_PARTY,
		a.SUBJECT_UNIT,
		a.AUDIT_STATUS,
		a.IN_USE,
		if(a.IS_FILE = 0,'有附件','无附件') FILES,
		a.IS_FILE,
		a.CREATE_NAME,
		a.CREATE_TIME

hongguangwu's avatar
hongguangwu committed
232 233 234
	</sql>
	<sql id="tEmployeeContractInfo_where">
		<if test="tEmployeeContractInfo != null">
hongguangwu's avatar
hongguangwu committed
235 236 237 238 239 240
			<if test="tEmployeeContractInfo.idList != null">
				AND a.id in
				<foreach item="idStr" index="index" collection="tEmployeeContractInfo.idList" open="(" separator="," close=")">
					#{idStr}
				</foreach>
			</if>
hongguangwu's avatar
hongguangwu committed
241 242 243
			<if test="tEmployeeContractInfo.id != null and tEmployeeContractInfo.id.trim() != ''">
				AND a.ID = #{tEmployeeContractInfo.id}
			</if>
fangxinjiang's avatar
fangxinjiang committed
244 245 246
			<if test="tEmployeeContractInfo.type != null and tEmployeeContractInfo.type.trim() != ''">
				AND a.type = #{tEmployeeContractInfo.type}
			</if>
hongguangwu's avatar
hongguangwu committed
247 248 249 250 251 252 253
			<if test="tEmployeeContractInfo.empNo != null and tEmployeeContractInfo.empNo.trim() != ''">
				AND a.EMP_NO = #{tEmployeeContractInfo.empNo}
			</if>
			<if test="tEmployeeContractInfo.empId != null and tEmployeeContractInfo.empId.trim() != ''">
				AND a.EMP_ID = #{tEmployeeContractInfo.empId}
			</if>
			<if test="tEmployeeContractInfo.empName != null and tEmployeeContractInfo.empName.trim() != ''">
254
				AND a.EMP_NAME like concat('%',#{tEmployeeContractInfo.empName},'%')
hongguangwu's avatar
hongguangwu committed
255 256
			</if>
			<if test="tEmployeeContractInfo.empIdcard != null and tEmployeeContractInfo.empIdcard.trim() != ''">
257
				AND a.EMP_IDCARD like concat('%',#{tEmployeeContractInfo.empIdcard},'%')
hongguangwu's avatar
hongguangwu committed
258 259 260 261 262 263 264 265 266 267 268 269 270 271
			</if>
			<if test="tEmployeeContractInfo.contractName != null and tEmployeeContractInfo.contractName.trim() != ''">
				AND a.CONTRACT_NAME = #{tEmployeeContractInfo.contractName}
			</if>
			<if test="tEmployeeContractInfo.contractType != null and tEmployeeContractInfo.contractType.trim() != ''">
				AND a.CONTRACT_TYPE = #{tEmployeeContractInfo.contractType}
			</if>
			<if test="tEmployeeContractInfo.contractStart != null">
				AND a.CONTRACT_START = #{tEmployeeContractInfo.contractStart}
			</if>
			<if test="tEmployeeContractInfo.contractEnd != null">
				AND a.CONTRACT_END = #{tEmployeeContractInfo.contractEnd}
			</if>
			<if test="tEmployeeContractInfo.subjectDepart != null and tEmployeeContractInfo.subjectDepart.trim() != ''">
272
				AND a.SUBJECT_DEPART like concat('%',#{tEmployeeContractInfo.subjectDepart},'%')
hongguangwu's avatar
hongguangwu committed
273 274
			</if>
			<if test="tEmployeeContractInfo.subjectUnit != null and tEmployeeContractInfo.subjectUnit.trim() != ''">
275
				AND a.SUBJECT_UNIT like concat('%',#{tEmployeeContractInfo.subjectUnit},'%')
hongguangwu's avatar
hongguangwu committed
276 277
			</if>
			<if test="tEmployeeContractInfo.situation != null and tEmployeeContractInfo.situation.trim() != ''">
278 279 280 281
				AND a.SITUATION = #{tEmployeeContractInfo.situation}
			</if>
			<if test="tEmployeeContractInfo.isFilePage != null">
				AND a.SITUATION != '作废' AND a.SITUATION != '终止'
hongguangwu's avatar
hongguangwu committed
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
			</if>
			<if test="tEmployeeContractInfo.contractTerm != null">
				AND a.CONTRACT_TERM = #{tEmployeeContractInfo.contractTerm}
			</if>
			<if test="tEmployeeContractInfo.contractNo != null and tEmployeeContractInfo.contractNo.trim() != ''">
				AND a.CONTRACT_NO = #{tEmployeeContractInfo.contractNo}
			</if>
			<if test="tEmployeeContractInfo.remark != null and tEmployeeContractInfo.remark.trim() != ''">
				AND a.REMARK = #{tEmployeeContractInfo.remark}
			</if>
			<if test="tEmployeeContractInfo.isObsolete != null and tEmployeeContractInfo.isObsolete.trim() != ''">
				AND a.IS_OBSOLETE = #{tEmployeeContractInfo.isObsolete}
			</if>
			<if test="tEmployeeContractInfo.isFile != null and tEmployeeContractInfo.isFile.trim() != ''">
				AND a.IS_FILE = #{tEmployeeContractInfo.isFile}
			</if>
hongguangwu's avatar
hongguangwu committed
298 299 300
			<if test="tEmployeeContractInfo.isAtta != null and tEmployeeContractInfo.isAtta.trim() != ''">
				AND a.IS_FILE = #{tEmployeeContractInfo.isAtta}
			</if>
hongguangwu's avatar
hongguangwu committed
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 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
			<if test="tEmployeeContractInfo.oldId != null">
				AND a.OLD_ID = #{tEmployeeContractInfo.oldId}
			</if>
			<if test="tEmployeeContractInfo.enjoinDate != null">
				AND a.ENJOIN_DATE = #{tEmployeeContractInfo.enjoinDate}
			</if>
			<if test="tEmployeeContractInfo.post != null and tEmployeeContractInfo.post.trim() != ''">
				AND a.POST = #{tEmployeeContractInfo.post}
			</if>
			<if test="tEmployeeContractInfo.workingHours != null and tEmployeeContractInfo.workingHours.trim() != ''">
				AND a.WORKING_HOURS = #{tEmployeeContractInfo.workingHours}
			</if>
			<if test="tEmployeeContractInfo.fileCabinetNo != null and tEmployeeContractInfo.fileCabinetNo.trim() != ''">
				AND a.FILE_CABINET_NO = #{tEmployeeContractInfo.fileCabinetNo}
			</if>
			<if test="tEmployeeContractInfo.settleDomain != null and tEmployeeContractInfo.settleDomain.trim() != ''">
				AND a.SETTLE_DOMAIN = #{tEmployeeContractInfo.settleDomain}
			</if>
			<if test="tEmployeeContractInfo.inUse != null and tEmployeeContractInfo.inUse.trim() != ''">
				AND a.IN_USE = #{tEmployeeContractInfo.inUse}
			</if>
			<if test="tEmployeeContractInfo.obsoleteReason != null and tEmployeeContractInfo.obsoleteReason.trim() != ''">
				AND a.OBSOLETE_REASON = #{tEmployeeContractInfo.obsoleteReason}
			</if>
			<if test="tEmployeeContractInfo.customerId != null and tEmployeeContractInfo.customerId.trim() != ''">
				AND a.CUSTOMER_ID = #{tEmployeeContractInfo.customerId}
			</if>
			<if test="tEmployeeContractInfo.fileProvince != null">
				AND a.FILE_PROVINCE = #{tEmployeeContractInfo.fileProvince}
			</if>
			<if test="tEmployeeContractInfo.fileCity != null">
				AND a.FILE_CITY = #{tEmployeeContractInfo.fileCity}
			</if>
			<if test="tEmployeeContractInfo.fileTown != null">
				AND a.FILE_TOWN = #{tEmployeeContractInfo.fileTown}
			</if>
			<if test="tEmployeeContractInfo.workingStatusSub != null and tEmployeeContractInfo.workingStatusSub.trim() != ''">
				AND a.WORKING_STATUS_SUB = #{tEmployeeContractInfo.workingStatusSub}
			</if>
			<if test="tEmployeeContractInfo.workFlag != null and tEmployeeContractInfo.workFlag.trim() != ''">
				AND a.WORK_FLAG = #{tEmployeeContractInfo.workFlag}
			</if>
			<if test="tEmployeeContractInfo.periodStart != null">
				AND a.PERIOD_START = #{tEmployeeContractInfo.periodStart}
			</if>
			<if test="tEmployeeContractInfo.periodEnd != null">
				AND a.PERIOD_END = #{tEmployeeContractInfo.periodEnd}
			</if>
			<if test="tEmployeeContractInfo.periodSalaryPerMonth != null">
				AND a.PERIOD_SALARY_PER_MONTH = #{tEmployeeContractInfo.periodSalaryPerMonth}
			</if>
			<if test="tEmployeeContractInfo.salaryType != null and tEmployeeContractInfo.salaryType.trim() != ''">
				AND a.SALARY_TYPE = #{tEmployeeContractInfo.salaryType}
			</if>
			<if test="tEmployeeContractInfo.salaryStandardPerHour != null">
				AND a.SALARY_STANDARD_PER_HOUR = #{tEmployeeContractInfo.salaryStandardPerHour}
			</if>
			<if test="tEmployeeContractInfo.salaryStandardPerPiece != null">
				AND a.SALARY_STANDARD_PER_PIECE = #{tEmployeeContractInfo.salaryStandardPerPiece}
			</if>
			<if test="tEmployeeContractInfo.dispatchFlag != null and tEmployeeContractInfo.dispatchFlag.trim() != ''">
				AND a.DISPATCH_FLAG = #{tEmployeeContractInfo.dispatchFlag}
			</if>
			<if test="tEmployeeContractInfo.warnEmailUserId != null and tEmployeeContractInfo.warnEmailUserId.trim() != ''">
				AND a.WARN_EMAIL_USER_ID = #{tEmployeeContractInfo.warnEmailUserId}
			</if>
			<if test="tEmployeeContractInfo.fddFlag != null and tEmployeeContractInfo.fddFlag.trim() != ''">
				AND a.FDD_FLAG = #{tEmployeeContractInfo.fddFlag}
			</if>
			<if test="tEmployeeContractInfo.isSign != null">
				AND a.IS_SIGN = #{tEmployeeContractInfo.isSign}
			</if>
			<if test="tEmployeeContractInfo.createBy != null and tEmployeeContractInfo.createBy.trim() != ''">
				AND a.CREATE_BY = #{tEmployeeContractInfo.createBy}
			</if>
			<if test="tEmployeeContractInfo.createName != null and tEmployeeContractInfo.createName.trim() != ''">
				AND a.CREATE_NAME = #{tEmployeeContractInfo.createName}
			</if>
			<if test="tEmployeeContractInfo.createTime != null">
				AND a.CREATE_TIME = #{tEmployeeContractInfo.createTime}
			</if>
			<if test="tEmployeeContractInfo.updateBy != null and tEmployeeContractInfo.updateBy.trim() != ''">
				AND a.UPDATE_BY = #{tEmployeeContractInfo.updateBy}
			</if>
			<if test="tEmployeeContractInfo.updateTime != null">
				AND a.UPDATE_TIME = #{tEmployeeContractInfo.updateTime}
			</if>
hongguangwu's avatar
hongguangwu committed
388

389

hongguangwu's avatar
hongguangwu committed
390 391 392
			<if test="tEmployeeContractInfo.unitNo != null and tEmployeeContractInfo.unitNo.trim() != ''">
				AND a.UNIT_NO = #{tEmployeeContractInfo.unitNo}
			</if>
393

hongguangwu's avatar
hongguangwu committed
394 395 396 397 398 399 400 401 402
			<if test="tEmployeeContractInfo.deptNo != null and tEmployeeContractInfo.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tEmployeeContractInfo.deptNo}
			</if>
			<if test="tEmployeeContractInfo.applyNo != null and tEmployeeContractInfo.applyNo.trim() != ''">
				AND a.APPLY_NO = #{tEmployeeContractInfo.applyNo}
			</if>
			<if test="tEmployeeContractInfo.auditStatus != null">
				AND a.AUDIT_STATUS = #{tEmployeeContractInfo.auditStatus}
			</if>
hongguangwu's avatar
hongguangwu committed
403 404 405 406
			<if test="tEmployeeContractInfo.empNatrue != null and tEmployeeContractInfo.empNatrue.trim() != ''">
				AND a.EMP_NATRUE = #{tEmployeeContractInfo.empNatrue}
			</if>
			<if test="tEmployeeContractInfo.contractParty != null and tEmployeeContractInfo.contractParty.trim() != ''">
407
				AND a.CONTRACT_PARTY like concat('%',#{tEmployeeContractInfo.contractParty},'%')
hongguangwu's avatar
hongguangwu committed
408 409 410 411 412
			</if>
			<if test="tEmployeeContractInfo.contractSubName != null and tEmployeeContractInfo.contractSubName.trim() != ''">
				AND a.CONTRACT_SUB_NAME = #{tEmployeeContractInfo.contractSubName}
			</if>

hongguangwu's avatar
hongguangwu committed
413 414 415 416 417 418 419
			<if test="tEmployeeContractInfo.createTimeStart != null and tEmployeeContractInfo.createTimeStart.trim() != ''">
				AND a.CREATE_TIME >= #{tEmployeeContractInfo.createTimeStart}
			</if>
			<if test="tEmployeeContractInfo.createTimeEnd != null and tEmployeeContractInfo.createTimeEnd.trim() != ''">
				AND a.CREATE_TIME <![CDATA[ <= ]]> #{tEmployeeContractInfo.createTimeEnd}
			</if>

hongguangwu's avatar
hongguangwu committed
420 421 422 423 424
		</if>
	</sql>
	<!--tEmployeeContractInfo简单分页查询-->
	<select id="getTEmployeeContractInfoPage" resultMap="tEmployeeContrctInfoMap">
		SELECT
hongguangwu's avatar
hongguangwu committed
425
			<include refid="Base_Column_List"/>
hongguangwu's avatar
hongguangwu committed
426 427
		FROM t_employee_contract_info a
		<where>
hongguangwu's avatar
hongguangwu committed
428
			a.DELETE_FLAG = 0
hongguangwu's avatar
hongguangwu committed
429
			<include refid="tEmployeeContractInfo_where"/>
hongguangwu's avatar
hongguangwu committed
430 431 432
			<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
				${tEmployeeContractInfo.authSql}
			</if>
hongguangwu's avatar
hongguangwu committed
433
		</where>
434
		order by a.APPLY_NO desc
hongguangwu's avatar
hongguangwu committed
435
	</select>
hongguangwu's avatar
hongguangwu committed
436

hongguangwu's avatar
hongguangwu committed
437
	<!--list-->
438 439
	<select id="getTEmployeeContractList" resultMap="tEmployeeContrctInfoMap">
		SELECT
hongguangwu's avatar
hongguangwu committed
440
			<include refid="Base_Column_List"/>
441 442 443 444 445
		FROM t_employee_contract_info a
		<where>
			a.DELETE_FLAG = 0
			<include refid="tEmployeeContractInfo_where"/>
		</where>
446
		order by a.APPLY_NO desc
447 448
	</select>

hongguangwu's avatar
hongguangwu committed
449 450 451
	<!--导出-->
	<select id="getTEmployeeContractExport" resultMap="tEmployeeContrctInfoExportMap">
		SELECT
fangxinjiang's avatar
fangxinjiang committed
452
			<include refid="Base_Export_Column_List"/>,a.type
hongguangwu's avatar
hongguangwu committed
453 454 455 456
		FROM t_employee_contract_info a
		<where>
			a.DELETE_FLAG = 0
			<include refid="tEmployeeContractInfo_where"/>
hongguangwu's avatar
hongguangwu committed
457 458 459
			<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
				${tEmployeeContractInfo.authSql}
			</if>
hongguangwu's avatar
hongguangwu committed
460
		</where>
hongguangwu's avatar
hongguangwu committed
461
		GROUP BY a.id
462
		order by a.APPLY_NO desc
hongguangwu's avatar
hongguangwu committed
463 464 465 466 467
	</select>

	<!--导出历史合并-->
	<select id="getTEmployeeContractExportHistory" resultMap="tEmployeeContrctInfoExportMap">
		SELECT
hongguangwu's avatar
hongguangwu committed
468 469 470 471 472
			<include refid="Base_Export_Column_List"/>
			,count(1) CREATE_NUM,
			min(a.CONTRACT_START) START_DATE,
			max(a.CONTRACT_END) END_DATE,
			GROUP_CONCAT(concat(a.CONTRACT_START,'~',ifnull(a.CONTRACT_END,'')) ORDER BY a.CONTRACT_START asc) HISTORY
hongguangwu's avatar
hongguangwu committed
473 474
		FROM t_employee_contract_info a
		<where>
475
			a.DELETE_FLAG = 0 and a.AUDIT_TIME_LAST is not null and a.SITUATION != '作废' and a.SITUATION != '终止'
hongguangwu's avatar
hongguangwu committed
476
			<include refid="tEmployeeContractInfo_where"/>
hongguangwu's avatar
hongguangwu committed
477 478 479
			<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
				${tEmployeeContractInfo.authSql}
			</if>
hongguangwu's avatar
hongguangwu committed
480
		</where>
hongguangwu's avatar
hongguangwu committed
481
		GROUP BY a.EMP_IDCARD,a.SETTLE_DOMAIN
482
		order by a.APPLY_NO desc
hongguangwu's avatar
hongguangwu committed
483 484
	</select>

hongguangwu's avatar
hongguangwu committed
485 486 487 488 489 490 491 492 493
	<!--tEmployeeContractInfo简单分页查询-->
	<select id="getOneContractByApplyNo" resultMap="tEmployeeContrctInfoMap">
		SELECT
			<include refid="Base_Column_List"/>
		FROM t_employee_contract_info a
		where a.DELETE_FLAG = 0 and a.APPLY_NO = #{applyNo}
		limit 1
	</select>

hongguangwu's avatar
hongguangwu committed
494 495
	<!-- 根据员工ID更新合同在用状态 -->
	<update id="updateInUseStatusById">
hongguangwu's avatar
hongguangwu committed
496 497
		update t_employee_contract_info
		set IN_USE = #{status}
fangxinjiang's avatar
fangxinjiang committed
498
		where EMP_ID = #{empId} and DEPT_NO = #{deptNo} and ID != #{id}
hongguangwu's avatar
hongguangwu committed
499 500
	</update>

hongguangwu's avatar
hongguangwu committed
501 502
	<!-- 获取当日最大的编码 -->
	<select id="getMaxContractCode" resultType="java.lang.String">
hongguangwu's avatar
hongguangwu committed
503
		SELECT ifnull(max(right(e.APPLY_NO,4)),0) APPLY_NO FROM t_employee_contract_info e where e.DELETE_FLAG = 0 and e.CREATE_TIME>DATE_FORMAT(now(),'%Y-%m-%d')
hongguangwu's avatar
hongguangwu committed
504 505
	</select>

hongguangwu's avatar
hongguangwu committed
506 507 508 509 510
	<!-- 根据编码获取数据 -->
	<select id="getContractByApplyNo" resultType="java.lang.String">
		SELECT e.id FROM t_employee_contract_info e where e.APPLY_NO = #{applyNo}
	</select>

511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539

	<!--tEmployeeContractInfo简单分页查询审核导出fxj-2022-11-04-->
	<select id="noPageDiy" resultMap="empContractExportAuditMap">
		SELECT
		a.EMP_NAME,
		a.EMP_IDCARD,
		a.CONTRACT_NAME,
		a.CONTRACT_TYPE,
		a.CONTRACT_START,
		a.CONTRACT_END,
		a.SUBJECT_DEPART,
		a.SUBJECT_UNIT,
		a.SITUATION,
		a.WORKING_HOURS,
		a.CREATE_NAME,
		a.CREATE_TIME,
		a.CONTRACT_SUB_NAME,
		a.REASON,
		a.TYPE,
		a.LEAVE_DATE,
		a.REDUCE_REASON
		FROM t_employee_contract_info a
		<where>
			a.DELETE_FLAG = 0
			<include refid="tEmployeeContractInfo_where"/>
			<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
				${tEmployeeContractInfo.authSql}
			</if>
		</where>
540
		order by a.APPLY_NO desc
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559
		<if test="tEmployeeContractInfo != null">
			<if test="tEmployeeContractInfo.limitStart != null">
				limit #{tEmployeeContractInfo.limitStart},#{tEmployeeContractInfo.limitEnd}
			</if>
		</if>
	</select>
	<!--tEmployeeContractInfo简单分页查询审核导出fxj-2022-11-04-->
	<select id="noPageCountDiy" resultType="java.lang.Integer">
		SELECT
		count(1)
		FROM t_employee_contract_info a
		<where>
			a.DELETE_FLAG = 0
			<include refid="tEmployeeContractInfo_where"/>
			<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
				${tEmployeeContractInfo.authSql}
			</if>
		</where>
	</select>
hongguangwu's avatar
hongguangwu committed
560
</mapper>