zhuo
2025-02-28 217e39bec2ae2a861c4619d277ab0bc823cf85d4
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
<?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.ruoyi.personnel.mapper.PersonBasicInfoMapper">
 
    <select id="selectLimsUser" resultType="com.ruoyi.common.core.domain.entity.DepartmentDto">
        SELECT u.id userId, u.name, SUBSTRING_INDEX(SUBSTRING_INDEX(u.depart_lims_id, ',', -2), ',', 1) AS fatherId
        FROM user u
        where u.is_custom = 0
          and u.depart_lims_id is not null
          and u.depart_lims_id != ''
    </select>
 
    <select id="getCNASPersonnelInfo" resultType="com.ruoyi.personnel.dto.PersonBasicInfoDto">
        SELECT *
        FROM user u
                 left join cnas_person_basic_info cpbi on cpbi.user_id = u.id
        where u.id = #{userId}
    </select>
 
    <select id="selectPersonBasecInfoAndUser" resultType="java.util.Map">
        select
            u.id  userId,
            u.`name`  name,
            u.account account,
            DATE_FORMAT(cpbi.group_time, '%Y-%m-%d') groupTime,
            cpbi.native_place nativePlace,
            cpbi.identity_card identityCard,
            cpbi.id_address idAddress,
            u.phone telephone,
            cpbi.graduated_institutions1 graduatedInstitutions1,
            cpbi.major1 major1,
            DATE_FORMAT(cpbi.graduation_time1, '%Y-%m-%d')  graduationTime1,
            cpbi.official_academic_redentials officialAcademicRedentials,
            cpbi.highest_degree highestDegree,
            cpbi.professional_title professionalTitle
        from user u
                 left join cnas_person_basic_info cpbi on cpbi.user_id = u.id
        <where>
            FIND_IN_SET(#{departmentId},u.depart_lims_id)
            <if test="name != null and name != ''">
                and u.name like concat('%',#{name},'%')
            </if>
        </where>
    </select>
 
    <!-- 导出查询人员信息 -->
    <select id="selectexportPersonBasic" resultType="java.util.Map">
        select DATE_FORMAT(cpbi.last_update_time, '%Y年%m月%d日') lastUpdateTimeString,
               u.account,
               u.`name`,
               cpbi.sex,
               cpbi.post_name postName,
               u.age,
               DATE_FORMAT(cpbi.working_time, '%Y年%m月')   workingTimeString,
               cpbi.major1,
               DATE_FORMAT(cpbi.graduation_time1, '%Y年%m月')   graduationTime1string,
               cpbi.official_academic_redentials officialAcademicRedentials,
               cpbi.graduated_institutions1 graduatedInstitutions1,
               cpbi.remarks
        from user u
                 left join cnas_person_basic_info cpbi on cpbi.user_id = u.id
        where u.id = #{userId}
    </select>
</mapper>