TEmployeeProjectMapper.xml 27.6 KB
Newer Older
1 2 3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

fangxinjiang's avatar
fangxinjiang committed
4
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper">
5

fangxinjiang's avatar
fangxinjiang committed
6
  <resultMap id="tEmployeeProjectMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject">
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
    <id property="id" column="ID"/>
    <result property="empId" column="EMP_ID"/>
    <result property="empCode" column="EMP_CODE"/>
    <result property="empNatrue" column="EMP_NATRUE"/>
    <result property="empName" column="EMP_NAME"/>
    <result property="empIdcard" column="EMP_IDCARD"/>
    <result property="bankName" column="BANK_NAME"/>
    <result property="bankSubName" column="BANK_SUB_NAME"/>
    <result property="bankNo" column="BANK_NO"/>
    <result property="leaveUser" column="LEAVE_USER"/>
    <result property="leaveTime" column="LEAVE_TIME"/>
    <result property="leaveReason" column="LEAVE_REASON"/>
    <result property="leaveRemark" column="LEAVE_REMARK"/>
    <result property="isLeaveEmployee" column="IS_LEAVE_EMPLOYEE"/>
    <result property="empNo" column="EMP_NO"/>
    <result property="unitId" column="UNIT_ID"/>
    <result property="unitName" column="UNIT_NAME"/>
    <result property="unitNo" column="UNIT_NO"/>
    <result property="deptId" column="DEPT_ID"/>
    <result property="deptName" column="DEPT_NAME"/>
    <result property="deptNo" column="DEPT_NO"/>
    <result property="businessPrimaryType" column="BUSINESS_PRIMARY_TYPE"/>
    <result property="businessSecondType" column="BUSINESS_SECOND_TYPE"/>
    <result property="businessThirdType" column="BUSINESS_THIRD_TYPE"/>
    <result property="contractType" column="CONTRACT_TYPE"/>
    <result property="workingHours" column="WORKING_HOURS"/>
    <result property="post" column="POST"/>
    <result property="enjoinDate" column="ENJOIN_DATE"/>
    <result property="tryPeriod" column="TRY_PERIOD"/>
    <result property="projectSource" column="PROJECT_SOURCE"/>
    <result property="taxMonth" column="TAX_MONTH"/>
    <result property="status" column="STATUS"/>
    <result property="projectStatus" column="PROJECT_STATUS"/>
    <result property="deleteFlag" column="DELETE_FLAG"/>
    <result property="createBy" column="CREATE_BY"/>
    <result property="createName" column="CREATE_NAME"/>
    <result property="createTime" column="CREATE_TIME"/>
    <result property="updateBy" column="UPDATE_BY"/>
    <result property="updateTime" column="UPDATE_TIME"/>
    <result property="remark" column="REMARK"/>
47 48 49 50 51 52 53 54
    <result property="fileProvince" column="FILE_PROVINCE"/>
    <result property="fileCity" column="FILE_CITY"/>
    <result property="fileTown" column="FILE_TOWN"/>
    <result property="empPhone" column="EMP_PHONE"/>
    <result property="salaryStatus" column="SALARY_STATUS"/>
    <result property="insuranceStatus" column="INSURANCE_STATUS"/>
    <result property="socialStatus" column="SOCIAL_STATUS"/>
    <result property="fundStatus" column="FUND_STATUS"/>
55
    <result property="contractStatus" column="CONTRACT_STATUS"/>
56
  </resultMap>
57

58 59 60 61 62 63 64 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
	<resultMap id="tEmployeeProjectExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO">
		<result property="empCode" column="EMP_CODE"/>
		<result property="proEmpNatrue" column="PROEMP_NATRUE"/>
		<result property="empNatrue" column="EMP_NATRUE"/>
		<result property="empName" column="EMP_NAME"/>
		<result property="empIdcard" column="EMP_IDCARD"/>
		<result property="validityStart" column="VALIDITY_START"/>
		<result property="validityEnd" column="VALIDITY_END"/>
		<result property="empMarriStatus" column="EMP_MARRI_STATUS"/>
		<result property="empNational" column="EMP_NATIONAL"/>
		<result property="politicalStatus" column="POLITICAL_STATUS"/>
		<result property="empEmail" column="EMP_EMAIL"/>
		<result property="idProvince" column="ID_PROVINCE"/>
		<result property="idCity" column="ID_CITY"/>
		<result property="idTown" column="ID_TOWN"/>
		<result property="empRegisType" column="EMP_REGIS_TYPE"/>
		<result property="isCollege" column="IS_COLLEGE"/>
		<result property="hignEducation" column="HIGN_EDUCATION"/>
		<result property="school" column="SCHOOL"/>
		<result property="major" column="MAJOR"/>
		<result property="admissionDate" column="ADMISSION_DATE"/>
		<result property="gradutionDate" column="GRADUTION_DATE"/>
		<result property="remark" column="REMARK"/>
		<result property="fileSource" column="FILE_SOURCE"/>
		<result property="proStatus" column="PROSTATUS"/>
		<result property="fileStatus" column="FILE_STATUS"/>
		<result property="bankName" column="BANK_NAME"/>
		<result property="bankSubName" column="BANK_SUB_NAME"/>
		<result property="bankNo" column="BANK_NO"/>
		<result property="empNo" column="EMP_NO"/>
		<result property="unitName" column="UNIT_NAME"/>
		<result property="unitNo" column="UNIT_NO"/>
		<result property="deptName" column="DEPT_NAME"/>
		<result property="deptNo" column="DEPT_NO"/>
92 93 94
		<result property="businessPrimaryType" column="BUSINESS_PRIMARY_TYPE"/>
		<result property="businessSecondType" column="BUSINESS_SECOND_TYPE"/>
		<result property="businessThirdType" column="BUSINESS_THIRD_TYPE"/>
95 96 97 98 99 100
		<result property="contractType" column="CONTRACT_TYPE"/>
		<result property="workingHours" column="WORKING_HOURS"/>
		<result property="post" column="POST"/>
		<result property="enjoinDate" column="ENJOIN_DATE"/>
		<result property="tryPeriod" column="TRY_PERIOD"/>
		<result property="projectSource" column="PROJECT_SOURCE"/>
101
		<result property="empNatrue" column="EMP_NATRUE"/>
102 103 104 105 106 107 108 109 110 111 112 113 114
		<result property="proCreateName" column="PROCREATE_NAME"/>
		<result property="proCreateTime" column="PROCREATE_TIME"/>
		<result property="status" column="STATUS"/>
		<result property="fileProvince" column="FILE_PROVINCE"/>
		<result property="fileCity" column="FILE_CITY"/>
		<result property="fileTown" column="FILE_TOWN"/>
		<result property="empPhone" column="EMP_PHONE"/>
		<result property="salaryStatus" column="SALARY_STATUS"/>
		<result property="insuranceStatus" column="INSURANCE_STATUS"/>
		<result property="socialStatus" column="SOCIAL_STATUS"/>
		<result property="fundStatus" column="FUND_STATUS"/>
		<result property="createName" column="CREATE_NAME"/>
		<result property="createTime" column="CREATE_TIME"/>
115
		<result property="contractStatus" column="CONTRACT_STATUS"/>
116 117
	</resultMap>

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 158
	<sql id="Base_Column_List">
				  a.ID,
                  a.EMP_ID,
                  a.EMP_CODE,
                  a.EMP_NATRUE,
                  a.EMP_NAME,
                  a.EMP_IDCARD,
                  a.BANK_NAME,
                  a.BANK_SUB_NAME,
                  a.BANK_NO,
                  a.LEAVE_USER,
                  a.LEAVE_TIME,
                  a.LEAVE_REASON,
                  a.LEAVE_REMARK,
                  a.IS_LEAVE_EMPLOYEE,
                  a.EMP_NO,
                  a.UNIT_ID,
                  a.UNIT_NAME,
                  a.UNIT_NO,
                  a.DEPT_ID,
                  a.DEPT_NAME,
                  a.DEPT_NO,
                  a.BUSINESS_PRIMARY_TYPE,
                  a.BUSINESS_SECOND_TYPE,
                  a.BUSINESS_THIRD_TYPE,
                  a.CONTRACT_TYPE,
                  a.WORKING_HOURS,
                  a.POST,
                  a.ENJOIN_DATE,
                  a.TRY_PERIOD,
                  a.PROJECT_SOURCE,
                  a.TAX_MONTH,
                  a.STATUS,
                  a.PROJECT_STATUS,
                  a.DELETE_FLAG,
                  a.CREATE_BY,
                  a.CREATE_NAME,
                  a.CREATE_TIME,
                  a.UPDATE_BY,
                  a.UPDATE_TIME,
                  a.REMARK,
159
                  a.CONTRACT_STATUS,
160
				  b.EMP_PHONE,
161 162 163
				  a.INSURANCE_STATUS,
				  a.SOCIAL_STATUS,
				  a.FUND_STATUS,
164 165 166
				  b.FILE_PROVINCE,
				  b.FILE_CITY,
				  b.FILE_TOWN,
167
				  a.SALARY_STATUS
168
	</sql>
169 170 171

	<sql id="Base_Export_List">
                  a.EMP_CODE,
172
                  a.EMP_NATRUE,
173 174 175 176 177 178 179 180 181 182
                  a.EMP_NAME,
                  a.EMP_IDCARD,
                  a.BANK_NAME,
                  a.BANK_SUB_NAME,
                  a.BANK_NO,
                  a.EMP_NO,
                  a.UNIT_NAME,
                  a.UNIT_NO,
                  a.DEPT_NAME,
                  a.DEPT_NO,
183 184 185
                  a.BUSINESS_PRIMARY_TYPE,
                  a.BUSINESS_SECOND_TYPE,
                  a.BUSINESS_THIRD_TYPE,
186 187 188 189 190 191
                  a.CONTRACT_TYPE,
                  a.WORKING_HOURS,
                  a.POST,
                  a.ENJOIN_DATE,
                  a.TRY_PERIOD,
                  a.PROJECT_SOURCE,
192
                  a.CONTRACT_STATUS,
193 194 195
                  b.STATUS AS PROSTATUS,
                  b.CREATE_NAME AS PROCREATE_NAME,
                  b.CREATE_TIME AS PROCREATE_TIME,
196
				  b.EMP_PHONE,
197 198 199
				  a.INSURANCE_STATUS,
				  a.SOCIAL_STATUS,
				  a.FUND_STATUS,
200 201 202
				  b.FILE_PROVINCE,
				  b.FILE_CITY,
				  b.FILE_TOWN,
203
				  a.SALARY_STATUS,
204
				  b.VALIDITY_START,
205
				  b.VALIDITY_END,
206 207 208 209 210 211 212 213 214 215 216 217 218 219
				  b.EMP_MARRI_STATUS,
				  b.EMP_NATIONAL,
				  b.POLITICAL_STATUS,
				  b.ID_PROVINCE,
				  b.ID_CITY,
				  b.ID_TOWN,
				  b.EMP_REGIS_TYPE,
				  b.IS_COLLEGE,
				  b.HIGN_EDUCATION,
				  b.SCHOOL,
				  b.MAJOR,
				  b.ADMISSION_DATE,
				  b.GRADUTION_DATE,
				  b.REMARK,
220 221 222 223
				  a.STATUS,
				  a.CREATE_NAME,
				  a.CREATE_TIME,
				  b.EMP_NATRUE AS PROEMP_NATRUE
224 225
	</sql>

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
	<sql id="tEmployeeProject_where">
		<if test="tEmployeeProject != null">
			<if test="tEmployeeProject.id != null and tEmployeeProject.id.trim() != ''">
				AND a.ID = #{tEmployeeProject.id}
			</if>
			<if test="tEmployeeProject.empId != null and tEmployeeProject.empId.trim() != ''">
				AND a.EMP_ID = #{tEmployeeProject.empId}
			</if>
			<if test="tEmployeeProject.empCode != null and tEmployeeProject.empCode.trim() != ''">
				AND a.EMP_CODE = #{tEmployeeProject.empCode}
			</if>
			<if test="tEmployeeProject.empNatrue != null and tEmployeeProject.empNatrue.trim() != ''">
				AND a.EMP_NATRUE = #{tEmployeeProject.empNatrue}
			</if>
			<if test="tEmployeeProject.empName != null and tEmployeeProject.empName.trim() != ''">
				AND a.EMP_NAME = #{tEmployeeProject.empName}
			</if>
			<if test="tEmployeeProject.empIdcard != null and tEmployeeProject.empIdcard.trim() != ''">
				AND a.EMP_IDCARD = #{tEmployeeProject.empIdcard}
			</if>
			<if test="tEmployeeProject.bankName != null and tEmployeeProject.bankName.trim() != ''">
				AND a.BANK_NAME = #{tEmployeeProject.bankName}
			</if>
			<if test="tEmployeeProject.bankSubName != null and tEmployeeProject.bankSubName.trim() != ''">
				AND a.BANK_SUB_NAME = #{tEmployeeProject.bankSubName}
			</if>
			<if test="tEmployeeProject.bankNo != null and tEmployeeProject.bankNo.trim() != ''">
				AND a.BANK_NO = #{tEmployeeProject.bankNo}
			</if>
			<if test="tEmployeeProject.leaveUser != null and tEmployeeProject.leaveUser.trim() != ''">
				AND a.LEAVE_USER = #{tEmployeeProject.leaveUser}
			</if>
			<if test="tEmployeeProject.leaveTime != null">
				AND a.LEAVE_TIME = #{tEmployeeProject.leaveTime}
			</if>
			<if test="tEmployeeProject.leaveReason != null and tEmployeeProject.leaveReason.trim() != ''">
				AND a.LEAVE_REASON = #{tEmployeeProject.leaveReason}
			</if>
			<if test="tEmployeeProject.leaveRemark != null and tEmployeeProject.leaveRemark.trim() != ''">
				AND a.LEAVE_REMARK = #{tEmployeeProject.leaveRemark}
			</if>
			<if test="tEmployeeProject.isLeaveEmployee != null">
				AND a.IS_LEAVE_EMPLOYEE = #{tEmployeeProject.isLeaveEmployee}
			</if>
			<if test="tEmployeeProject.empNo != null and tEmployeeProject.empNo.trim() != ''">
				AND a.EMP_NO = #{tEmployeeProject.empNo}
			</if>
			<if test="tEmployeeProject.unitId != null and tEmployeeProject.unitId.trim() != ''">
				AND a.UNIT_ID = #{tEmployeeProject.unitId}
			</if>
			<if test="tEmployeeProject.unitName != null and tEmployeeProject.unitName.trim() != ''">
277
				AND a.UNIT_NAME like concat('%',#{tEmployeeProject.unitName},'%')
278 279 280 281 282 283 284 285
			</if>
			<if test="tEmployeeProject.unitNo != null and tEmployeeProject.unitNo.trim() != ''">
				AND a.UNIT_NO = #{tEmployeeProject.unitNo}
			</if>
			<if test="tEmployeeProject.deptId != null and tEmployeeProject.deptId.trim() != ''">
				AND a.DEPT_ID = #{tEmployeeProject.deptId}
			</if>
			<if test="tEmployeeProject.deptName != null and tEmployeeProject.deptName.trim() != ''">
286
				AND a.DEPT_NAME like concat('%',#{tEmployeeProject.deptName},'%')
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 337 338 339 340 341 342 343 344
			</if>
			<if test="tEmployeeProject.deptNo != null and tEmployeeProject.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tEmployeeProject.deptNo}
			</if>
			<if test="tEmployeeProject.businessPrimaryType != null and tEmployeeProject.businessPrimaryType.trim() != ''">
				AND a.BUSINESS_PRIMARY_TYPE = #{tEmployeeProject.businessPrimaryType}
			</if>
			<if test="tEmployeeProject.businessSecondType != null and tEmployeeProject.businessSecondType.trim() != ''">
				AND a.BUSINESS_SECOND_TYPE = #{tEmployeeProject.businessSecondType}
			</if>
			<if test="tEmployeeProject.businessThirdType != null and tEmployeeProject.businessThirdType.trim() != ''">
				AND a.BUSINESS_THIRD_TYPE = #{tEmployeeProject.businessThirdType}
			</if>
			<if test="tEmployeeProject.contractType != null and tEmployeeProject.contractType.trim() != ''">
				AND a.CONTRACT_TYPE = #{tEmployeeProject.contractType}
			</if>
			<if test="tEmployeeProject.workingHours != null and tEmployeeProject.workingHours.trim() != ''">
				AND a.WORKING_HOURS = #{tEmployeeProject.workingHours}
			</if>
			<if test="tEmployeeProject.post != null and tEmployeeProject.post.trim() != ''">
				AND a.POST = #{tEmployeeProject.post}
			</if>
			<if test="tEmployeeProject.enjoinDate != null">
				AND a.ENJOIN_DATE = #{tEmployeeProject.enjoinDate}
			</if>
			<if test="tEmployeeProject.tryPeriod != null and tEmployeeProject.tryPeriod.trim() != ''">
				AND a.TRY_PERIOD = #{tEmployeeProject.tryPeriod}
			</if>
			<if test="tEmployeeProject.projectSource != null and tEmployeeProject.projectSource.trim() != ''">
				AND a.PROJECT_SOURCE = #{tEmployeeProject.projectSource}
			</if>
			<if test="tEmployeeProject.taxMonth != null and tEmployeeProject.taxMonth.trim() != ''">
				AND a.TAX_MONTH = #{tEmployeeProject.taxMonth}
			</if>
			<if test="tEmployeeProject.status != null">
				AND a.STATUS = #{tEmployeeProject.status}
			</if>
			<if test="tEmployeeProject.projectStatus != null">
				AND a.PROJECT_STATUS = #{tEmployeeProject.projectStatus}
			</if>
			<if test="tEmployeeProject.createBy != null and tEmployeeProject.createBy.trim() != ''">
				AND a.CREATE_BY = #{tEmployeeProject.createBy}
			</if>
			<if test="tEmployeeProject.createName != null and tEmployeeProject.createName.trim() != ''">
				AND a.CREATE_NAME = #{tEmployeeProject.createName}
			</if>
			<if test="tEmployeeProject.createTime != null">
				AND a.CREATE_TIME = #{tEmployeeProject.createTime}
			</if>
			<if test="tEmployeeProject.updateBy != null and tEmployeeProject.updateBy.trim() != ''">
				AND a.UPDATE_BY = #{tEmployeeProject.updateBy}
			</if>
			<if test="tEmployeeProject.updateTime != null">
				AND a.UPDATE_TIME = #{tEmployeeProject.updateTime}
			</if>
			<if test="tEmployeeProject.remark != null and tEmployeeProject.remark.trim() != ''">
				AND a.REMARK = #{tEmployeeProject.remark}
			</if>
345 346 347
			<if test="tEmployeeProject.contractStatus != null">
				AND a.CONTRACT_STATUS = #{tEmployeeProject.contractStatus}
			</if>
348 349 350 351
			<if test="tEmployeeProject.empPhone != null and tEmployeeProject.empPhone.trim() != ''">
				AND b.EMP_PHONE = #{tEmployeeProject.empPhone}
			</if>
			<if test="tEmployeeProject.insuranceStatus != null">
352
				AND a.INSURANCE_STATUS = #{tEmployeeProject.insuranceStatus}
353 354
			</if>
			<if test="tEmployeeProject.socialStatus != null">
355
			    AND a.SOCIAL_STATUS = #{tEmployeeProject.socialStatus}
356 357
		    </if>
			<if test="tEmployeeProject.fundStatus != null">
358
				AND a.FUND_STATUS = #{tEmployeeProject.fundStatus}
359 360
		    </if>
			<if test="tEmployeeProject.salaryStatus != null">
361
				AND a.SALARY_STATUS = #{tEmployeeProject.salaryStatus}
362 363 364 365 366 367 368 369 370 371 372 373 374
			</if>
			<if test="tEmployeeProject.fileProvince != null">
				AND b.FILE_PROVINCE = #{tEmployeeProject.fileProvince}
			</if>
			<if test="tEmployeeProject.fileCity != null">
				AND b.FILE_CITY = #{tEmployeeProject.fileCity}
			</if>
			<if test="tEmployeeProject.fileTown != null">
				AND b.FILE_TOWN = #{tEmployeeProject.fileTown}
			</if>
		</if>
	</sql>

375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 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
	<sql id="exportTEmployeeProject_where">
		<if test="tEmployeeProject != null">
			<if test="tEmployeeProject.empCode != null and tEmployeeProject.empCode.trim() != ''">
				AND a.EMP_CODE = #{tEmployeeProject.empCode}
			</if>
			<if test="tEmployeeProject.empNatrue != null and tEmployeeProject.empNatrue.trim() != ''">
				AND a.EMP_NATRUE = #{tEmployeeProject.empNatrue}
			</if>
			<if test="tEmployeeProject.empName != null and tEmployeeProject.empName.trim() != ''">
				AND a.EMP_NAME = #{tEmployeeProject.empName}
			</if>
			<if test="tEmployeeProject.empIdcard != null and tEmployeeProject.empIdcard.trim() != ''">
				AND a.EMP_IDCARD = #{tEmployeeProject.empIdcard}
			</if>
			<if test="tEmployeeProject.bankName != null and tEmployeeProject.bankName.trim() != ''">
				AND a.BANK_NAME = #{tEmployeeProject.bankName}
			</if>
			<if test="tEmployeeProject.bankSubName != null and tEmployeeProject.bankSubName.trim() != ''">
				AND a.BANK_SUB_NAME = #{tEmployeeProject.bankSubName}
			</if>
			<if test="tEmployeeProject.bankNo != null and tEmployeeProject.bankNo.trim() != ''">
				AND a.BANK_NO = #{tEmployeeProject.bankNo}
			</if>
			<if test="tEmployeeProject.empNo != null and tEmployeeProject.empNo.trim() != ''">
				AND a.EMP_NO = #{tEmployeeProject.empNo}
			</if>
			<if test="tEmployeeProject.unitName != null and tEmployeeProject.unitName.trim() != ''">
				AND a.UNIT_NAME like concat('%',#{tEmployeeProject.unitName},'%')
			</if>
			<if test="tEmployeeProject.unitNo != null and tEmployeeProject.unitNo.trim() != ''">
				AND a.UNIT_NO = #{tEmployeeProject.unitNo}
			</if>
			<if test="tEmployeeProject.deptName != null and tEmployeeProject.deptName.trim() != ''">
				AND a.DEPT_NAME like concat('%',#{tEmployeeProject.deptName},'%')
			</if>
			<if test="tEmployeeProject.deptNo != null and tEmployeeProject.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tEmployeeProject.deptNo}
			</if>
			<if test="tEmployeeProject.businessPrimaryType != null and tEmployeeProject.businessPrimaryType.trim() != ''">
				AND a.BUSINESS_PRIMARY_TYPE = #{tEmployeeProject.businessPrimaryType}
			</if>
			<if test="tEmployeeProject.businessSecondType != null and tEmployeeProject.businessSecondType.trim() != ''">
				AND a.BUSINESS_SECOND_TYPE = #{tEmployeeProject.businessSecondType}
			</if>
			<if test="tEmployeeProject.businessThirdType != null and tEmployeeProject.businessThirdType.trim() != ''">
				AND a.BUSINESS_THIRD_TYPE = #{tEmployeeProject.businessThirdType}
			</if>
			<if test="tEmployeeProject.contractType != null and tEmployeeProject.contractType.trim() != ''">
				AND a.CONTRACT_TYPE = #{tEmployeeProject.contractType}
			</if>
			<if test="tEmployeeProject.workingHours != null and tEmployeeProject.workingHours.trim() != ''">
				AND a.WORKING_HOURS = #{tEmployeeProject.workingHours}
			</if>
			<if test="tEmployeeProject.post != null and tEmployeeProject.post.trim() != ''">
				AND a.POST = #{tEmployeeProject.post}
			</if>
			<if test="tEmployeeProject.enjoinDate != null">
				AND a.ENJOIN_DATE = #{tEmployeeProject.enjoinDate}
			</if>
			<if test="tEmployeeProject.tryPeriod != null and tEmployeeProject.tryPeriod.trim() != ''">
				AND a.TRY_PERIOD = #{tEmployeeProject.tryPeriod}
			</if>
			<if test="tEmployeeProject.projectSource != null and tEmployeeProject.projectSource.trim() != ''">
				AND a.PROJECT_SOURCE = #{tEmployeeProject.projectSource}
			</if>
			<if test="tEmployeeProject.proStatus != null">
				AND a.STATUS = #{tEmployeeProject.proStatus}
			</if>
			<if test="tEmployeeProject.createName != null and tEmployeeProject.createName.trim() != ''">
				AND a.CREATE_NAME = #{tEmployeeProject.createName}
			</if>
			<if test="tEmployeeProject.createTime != null">
				AND a.CREATE_TIME = #{tEmployeeProject.createTime}
			</if>
			<if test="tEmployeeProject.remark != null and tEmployeeProject.remark.trim() != ''">
				AND a.REMARK = #{tEmployeeProject.remark}
			</if>
452 453 454
			<if test="tEmployeeProject.contractStatus != null">
				AND a.CONTRACT_STATUS = #{tEmployeeProject.contractStatus}
			</if>
455 456 457 458
			<if test="tEmployeeProject.empPhone != null and tEmployeeProject.empPhone.trim() != ''">
				AND b.EMP_PHONE = #{tEmployeeProject.empPhone}
			</if>
			<if test="tEmployeeProject.insuranceStatus != null">
459
				AND a.INSURANCE_STATUS = #{tEmployeeProject.insuranceStatus}
460 461
			</if>
			<if test="tEmployeeProject.socialStatus != null">
462
				AND a.SOCIAL_STATUS = #{tEmployeeProject.socialStatus}
463 464
			</if>
			<if test="tEmployeeProject.fundStatus != null">
465
				AND a.FUND_STATUS = #{tEmployeeProject.fundStatus}
466 467
			</if>
			<if test="tEmployeeProject.salaryStatus != null">
468
				AND a.SALARY_STATUS = #{tEmployeeProject.salaryStatus}
469 470 471 472 473 474 475 476 477 478
			</if>
			<if test="tEmployeeProject.fileProvince != null">
				AND b.FILE_PROVINCE = #{tEmployeeProject.fileProvince}
			</if>
			<if test="tEmployeeProject.fileCity != null">
				AND b.FILE_CITY = #{tEmployeeProject.fileCity}
			</if>
			<if test="tEmployeeProject.fileTown != null">
				AND b.FILE_TOWN = #{tEmployeeProject.fileTown}
			</if>
479
			<if test="tEmployeeProject.idList != null">
480
				AND a.id in
481
				<foreach item="idStr" index="index" collection="tEmployeeProject.idList" open="(" separator="," close=")">
482 483 484
					#{idStr}
				</foreach>
			</if>
485 486 487
		</if>
	</sql>

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 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599
	<update id="updateExcelEmpProject" parameterType="java.util.List">
		update t_employee_project
		<trim prefix="set" suffixOverrides=",">
			<trim prefix="EMP_NATRUE =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.empNatrue!=null">
						when ID=#{i.id} then #{i.empNatrue}
					</if>
				</foreach>
			</trim>
			<trim prefix="EMP_NAME =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.empName!=null">
						when ID=#{i.id} then #{i.empName}
					</if>
				</foreach>
			</trim>
			<trim prefix="EMP_IDCARD =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.empIdcard!=null">
						when ID=#{i.id} then #{i.empIdcard}
					</if>
				</foreach>
			</trim>
			<trim prefix="PROJECT_STATUS =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					when ID=#{i.id} then 0
				</foreach>
			</trim>
			<trim prefix="UPDATE_TIME =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					when ID=#{i.id} then now()
				</foreach>
			</trim>
			<trim prefix="UPDATE_BY =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.updateBy!=null">
						when ID=#{i.id} then #{i.updateBy}
					</if>
				</foreach>
			</trim>
			<trim prefix="DEPT_NO =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.deptNo!=null">
						when ID=#{i.id} then #{i.deptNo}
					</if>
				</foreach>
			</trim>
			<trim prefix="CONTRACT_TYPE =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.contractType!=null">
						when ID=#{i.id} then #{i.contractType}
					</if>
				</foreach>
			</trim>
			<trim prefix="WORKING_HOURS =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.workingHours!=null">
						when ID=#{i.id} then #{i.workingHours}
					</if>
				</foreach>
			</trim>
			<trim prefix="POST =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.post!=null">
						when ID=#{i.id} then #{i.post}
					</if>
				</foreach>
			</trim>
			<trim prefix="TRY_PERIOD =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.tryPeriod!=null">
						when ID=#{i.id} then #{i.tryPeriod}
					</if>
				</foreach>
			</trim>
			<trim prefix="ENJOIN_DATE =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.enjoinDate!=null">
						when ID=#{i.id} then #{i.enjoinDate}
					</if>
				</foreach>
			</trim>
			<trim prefix="BANK_NAME =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.bankName!=null">
						when ID=#{i.id} then #{i.bankName}
					</if>
				</foreach>
			</trim>
			<trim prefix="BANK_NO =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.bankNo!=null">
						when ID=#{i.id} then #{i.bankNo}
					</if>
				</foreach>
			</trim>
			<trim prefix="BANK_SUB_NAME =case" suffix="end,">
				<foreach collection="list" item="i" index="index">
					<if test="i.bankSubName!=null">
						when ID=#{i.id} then #{i.bankSubName}
					</if>
				</foreach>
			</trim>
		</trim>
		where
		<foreach collection="list" separator="or" item="i" index="index" >
			ID=#{i.id}
		</foreach>
	</update>
	<insert id="insertExcelEmpProject" parameterType="java.util.List">
		insert into t_employee_project
600 601 602
		(ID,EMP_ID,EMP_NATRUE,EMP_NAME,EMP_IDCARD,STATUS,PROJECT_STATUS,EMP_CODE,DEPT_NO,CONTRACT_TYPE,POST,
		DEPT_ID,DEPT_NAME,UNIT_ID,UNIT_NAME,UNIT_NO,EMP_NO,TRY_PERIOD,ENJOIN_DATE,BANK_NAME,BANK_NO,BANK_SUB_NAME,
		DELETE_FLAG,CREATE_BY,CREATE_NAME,CREATE_TIME,INSURANCE_STATUS,SOCIAL_STATUS,FUND_STATUS)
603 604 605 606 607 608 609 610 611 612 613 614 615 616
		VALUES
		<foreach collection="list" item="item" index="index" separator=",">
			(
			#{item.id,jdbcType=VARCHAR},
			#{item.empId,jdbcType=VARCHAR},
			#{item.empNatrue,jdbcType=VARCHAR},
			#{item.empName,jdbcType=VARCHAR},
			#{item.empIdcard,jdbcType=VARCHAR},
			#{item.status,jdbcType=VARCHAR},
			0,
			#{item.empCode,jdbcType=VARCHAR},
			#{item.deptNo,jdbcType=VARCHAR},
			#{item.contractType,jdbcType=VARCHAR},
			#{item.post,jdbcType=VARCHAR},
617 618 619 620 621
			#{item.deptId,jdbcType=VARCHAR},
			#{item.deptName,jdbcType=VARCHAR},
			#{item.unitId,jdbcType=VARCHAR},
			#{item.unitName,jdbcType=VARCHAR},
			#{item.unitNo,jdbcType=VARCHAR},
622 623 624 625 626 627 628 629 630
			#{item.empNo,jdbcType=VARCHAR},
			#{item.tryPeriod,jdbcType=VARCHAR},
			#{item.enjoinDate,jdbcType=DATE},
			#{item.bankName,jdbcType=VARCHAR},
			#{item.bankNo,jdbcType=VARCHAR},
			#{item.bankSubName,jdbcType=VARCHAR},
			#{item.deleteFlag,jdbcType=VARCHAR},
			#{item.createBy,jdbcType=VARCHAR},
			#{item.createName,jdbcType=VARCHAR},
631 632 633 634
			now(),
			0,
			0,
			0
635 636 637 638 639
			)
		</foreach>
	</insert>

	<!--查询部门编码和最大员工数-->
640
	<select id="findEmployeeMaxOnlyNoByDepId" resultType="java.lang.String">
641 642 643 644 645 646 647
		SELECT
			(
				SELECT
					MAX(EMP_NO)
				FROM
					t_employee_project
				WHERE
648
					DELETE_FLAG = '0'
649 650 651 652 653 654 655 656 657
					and id not like '%abc'
					and
					EMP_NO LIKE CONCAT(
						(
							SELECT
								DEPART_NO
							FROM
								t_settle_domain
							WHERE
658
								DEPART_NO = #{deptNo}
659 660 661 662 663 664 665 666 667 668
						),
						'%'
					)
			) AS 'empNo'
		FROM
			DUAL
	</select>

	<update id="updateEmpIdById" parameterType="java.util.List">
		update t_employee_project
669 670 671 672 673 674 675 676 677
		<trim prefix="set" suffixOverrides=",">
		<trim prefix="EMP_ID =case" suffix="end,">
			<foreach collection="list" item="i" index="index">
				<if test="i.id!=null">
					when EMP_IDCARD=#{i.empIdcard} then #{i.id}
				</if>
			</foreach>
		</trim>
		</trim>
678 679
		where
		<foreach collection="list" separator="or" item="i" index="index" >
680
			EMP_IDCARD=#{i.empIdcard}
681 682
		</foreach>
	</update>
683 684 685 686

	<!--tEmployeeInfo简单分页查询-->
	<select id="getTEmployeeProjectInfoPage" resultMap="tEmployeeProjectMap">
	SELECT
687
		<include refid="Base_Column_List"/>
688 689 690
		FROM t_employee_project a
		left join t_employee_info b on a.EMP_ID = b.id
		<where>
691
			a.DELETE_FLAG = '0'
692 693
		<include refid="tEmployeeProject_where"/>
		</where>
694
		order by a.CREATE_TIME desc
695
	</select>
696 697 698 699 700 701 702
	<!--tEmployeeInfo导出查询-->
	<select id="getTEmployeeProjectExportPage" resultMap="tEmployeeProjectExportMap">
		SELECT
		<include refid="Base_Export_List"/>
		FROM t_employee_project a
		left join t_employee_info b on a.EMP_ID = b.id
		<where>
703
			a.DELETE_FLAG = '0'
704
			<include refid="exportTEmployeeProject_where"/>
705 706
		</where>
	</select>
707
</mapper>