TElecEmployeeInfoMapper.xml 4.92 KB
<?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.TElecEmployeeInfoMapper">

  <resultMap id="tElecEmployeeInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo">
    <id property="id" column="ID"/>
    <result property="empName" column="EMP_NAME"/>
    <result property="empIdcard" column="EMP_IDCARD"/>
    <result property="empNo" column="EMP_NO"/>
    <result property="unitName" column="UNIT_NAME"/>
    <result property="deptName" column="DEPT_NAME"/>
    <result property="deptNo" column="DEPT_NO"/>
    <result property="dataType" column="DATA_TYPE"/>
    <result property="attaInfo" column="ATTA_INFO"/>
    <result property="fileId" column="FILE_ID"/>
    <result property="deleteFlag" column="DELETE_FLAG"/>
    <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"/>
  </resultMap>

	<sql id="Base_Column_List">
		a.ID,
		b.EMP_NAME,
		a.EMP_IDCARD,
		b.EMP_NO,
		b.UNIT_NAME,
		b.deptNo,
		b.DEPT_NAME,
		a.DATA_TYPE,
		a.ATTA_INFO,
		a.FILE_ID,
		a.DELETE_FLAG,
		a.UPDATE_BY,
		a.CREATE_BY,
		a.CREATE_NAME,
		a.CREATE_TIME,
		a.UPDATE_TIME
	</sql>

	<sql id="tElecEmployeeInfo_where">
	<if test="tElecEmployeeInfo != null">
		<if test="tElecEmployeeInfo.id != null and tElecEmployeeInfo.id.trim() != ''">
			AND a.ID = #{tElecEmployeeInfo.id}
		</if>
		<if test="tElecEmployeeInfo.empName != null and tElecEmployeeInfo.empName.trim() != ''">
			AND b.EMP_NAME = #{tElecEmployeeInfo.empName}
		</if>
		<if test="tElecEmployeeInfo.empIdcard != null and tElecEmployeeInfo.empIdcard.trim() != ''">
			AND a.EMP_IDCARD = #{tElecEmployeeInfo.empIdcard}
		</if>
		<if test="tElecEmployeeInfo.empCode != null and tElecEmployeeInfo.empCode.trim() != ''">
			AND b.EMP_CODE = #{tElecEmployeeInfo.empCode}
		</if>
		<if test="tElecEmployeeInfo.unitName != null and tElecEmployeeInfo.unitName.trim() != ''">
			AND b.UNIT_NAME like concat('%',#{tElecEmployeeInfo.unitName},'%')
		</if>
		<if test="tElecEmployeeInfo.deptName != null and tElecEmployeeInfo.deptName.trim() != ''">
			AND b.DEPT_NAME like concat('%',#{tElecEmployeeInfo.deptName},'%')
		</if>
		<if test="tElecEmployeeInfo.deptNo != null and tElecEmployeeInfo.deptNo.trim() != ''">
			AND b.DEPT_NO like concat('%',#{tElecEmployeeInfo.deptNo},'%')
		</if>
		<if test="tElecEmployeeInfo.dataType != null and tElecEmployeeInfo.dataType.trim() != ''">
			AND a.DATA_TYPE = #{tElecEmployeeInfo.dataType}
		</if>
		<if test="tElecEmployeeInfo.attaInfo != null and tElecEmployeeInfo.attaInfo.trim() != ''">
			AND a.ATTA_INFO = #{tElecEmployeeInfo.attaInfo}
		</if>
		<if test="tElecEmployeeInfo.fileId != null and tElecEmployeeInfo.fileId.trim() != ''">
			AND a.FILE_ID = #{tElecEmployeeInfo.fileId}
		</if>
		<if test="tElecEmployeeInfo.createBy != null and tElecEmployeeInfo.createBy.trim() != ''">
			AND a.CREATE_BY = #{tElecEmployeeInfo.createBy}
		</if>
		<if test="tElecEmployeeInfo.createName != null and tElecEmployeeInfo.createName.trim() != ''">
			AND a.CREATE_NAME = #{tElecEmployeeInfo.createName}
		</if>
		<if test="tElecEmployeeInfo.createTime != null">
			AND a.CREATE_TIME = #{tElecEmployeeInfo.createTime}
		</if>
		<if test="tElecEmployeeInfo.updateBy != null and tElecEmployeeInfo.updateBy.trim() != ''">
			AND a.UPDATE_BY = #{tElecEmployeeInfo.updateBy}
		</if>
		<if test="tElecEmployeeInfo.updateTime != null">
			AND a.UPDATE_TIME = #{tElecEmployeeInfo.updateTime}
		</if>
	</if>
	</sql>

	<!--tElecEmployeeInfo简单分页查询-->
	<select id="getTElecEmployeeInfoPage" resultMap="tElecEmployeeInfoMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_elec_employee_info a
		left join t_employee_project b on a.EMP_IDCARD = b.EMP_IDCARD
		<where>
			1=1  AND a.DELETE_FLAG = '0' AND b.DELETE_FLAG = '0'
			<include refid="tElecEmployeeInfo_where"/>
		</where>
	</select>
</mapper>