heheng
2025-11-26 5011ebf747ddfa41840b352c9e39cf369a8f047c
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
<?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">
<mapper namespace="com.gkhy.exam.system.mapper.EmployeeRecordMapper">
 
 
 
    <select id="selectEmployeeRecordList" parameterType="com.gkhy.exam.system.domain.req.EmployeeRecordReq"
            resultType="com.gkhy.exam.system.domain.vo.EmployeeRecordVO">
 
        select
            a.name, a.sex, a.age, a.person_type personType , a.phone, a.dept_id deptId, a.post,a.duty,
            aa.employee_id employeeId, aa.company_id companyId,
            b.dept_name deptName,aa.user_id userId,aa.duties,aa.seniority,aa.qualification_requirements qualificationRequirements,
            aa.qualification,aa.id_card idCard,aa.positional,aa.entry_time entryTime,aa.resign_time resignTime,aa.certificate,
            aa.version,aa.create_time createTime,aa.update_time updateTime,aa.create_by createBy,aa.update_by updateBy
        from employee_record aa
            inner join sys_user a on a.id = aa.user_id and a.company_id = aa.company_id
        inner join  sys_dept b on a.dept_id = b.dept_id
        where a.del_flag = 0 and aa.del_flag = 0
        <if test="companyId != null">
            and aa.company_id = #{companyId}
        </if>
        <if test="name != null and name != ''">
            and a.name like concat('%',#{name},'%')
        </if>
        <if test="phone != null and phone != ''">
            and a.phone like concat('%',#{phone},'%')
        </if>
        <if test="qualification != null">
            and aa.qualification = #{qualification}
        </if>
        <if test="positional != null">
            and aa.positional = #{positional}
        </if>
        <if test="startTime != '' and startTime != null" >
            and aa.create_time &gt;= #{startTime}
        </if>
        <if test="endTime != '' and endTime != null" >
            and aa.create_time &lt;= #{endTime}
        </if>
        order by aa.create_time desc
    </select>
 
    <select id="getEmployeeRecordList" parameterType="long"
            resultType="com.gkhy.exam.system.domain.vo.EmployeeRecordVO">
        select
        a.name,
        aa.employee_id employeeId, aa.user_id userId
        from employee_record aa
        inner join sys_user a on a.id = aa.user_id and a.company_id = aa.company_id
        where a.del_flag = 0 and aa.del_flag = 0
        <if test="companyId != null">
            and aa.company_id = #{companyId}
        </if>
    </select>
 
 
</mapper>