zss
2024-12-23 0d930cdcf56bb92e67afabf45ec860689baf0282
cnas-personnel/src/main/resources/mapper/PersonBasicInfoMapper.xml
@@ -1,36 +1,35 @@
<?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.yuanchu.mom.mapper.PersonBasicInfoMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.PersonBasicInfo">
        <id column="id" property="id" />
        <result column="current_state" property="currentState" />
        <result column="entry_time" property="entryTime" />
        <result column="post" property="post" />
        <result column="professional_title" property="professionalTitle" />
        <result column="sex" property="sex" />
        <result column="personnel_classification" property="personnelClassification" />
        <result column="date_birth" property="dateBirth" />
        <result column="identity_card" property="identityCard" />
        <result column="nation" property="nation" />
        <result column="political_status" property="politicalStatus" />
        <result column="official_academic_redentials" property="officialAcademicRedentials" />
        <result column="graduation_time1" property="graduationTime1" />
        <result column="graduated_institutions1" property="graduatedInstitutions1" />
        <result column="major1" property="major1" />
        <result column="graduation_time2" property="graduationTime2" />
        <result column="graduated_institutions2" property="graduatedInstitutions2" />
        <result column="major2" property="major2" />
        <result column="telephone" property="telephone" />
        <result column="end_planned_internship" property="endPlannedInternship" />
        <result column="end_practical_practice" property="endPracticalPractice" />
        <result column="date_departure" property="dateDeparture" />
        <result column="desktop_picture" property="desktopPicture" />
        <result column="attachment_information" property="attachmentInformation" />
        <result column="remarks" property="remarks" />
        <result column="user_id" property="userId" />
        <result column="current_position" property="currentPosition" />
        <id column="id" property="id"/>
        <result column="current_state" property="currentState"/>
        <result column="entry_time" property="entryTime"/>
        <result column="post" property="post"/>
        <result column="professional_title" property="professionalTitle"/>
        <result column="sex" property="sex"/>
        <result column="personnel_classification" property="personnelClassification"/>
        <result column="date_birth" property="dateBirth"/>
        <result column="identity_card" property="identityCard"/>
        <result column="nation" property="nation"/>
        <result column="political_status" property="politicalStatus"/>
        <result column="official_academic_redentials" property="officialAcademicRedentials"/>
        <result column="graduation_time1" property="graduationTime1"/>
        <result column="graduated_institutions1" property="graduatedInstitutions1"/>
        <result column="major1" property="major1"/>
        <result column="graduation_time2" property="graduationTime2"/>
        <result column="graduated_institutions2" property="graduatedInstitutions2"/>
        <result column="major2" property="major2"/>
        <result column="telephone" property="telephone"/>
        <result column="end_planned_internship" property="endPlannedInternship"/>
        <result column="end_practical_practice" property="endPracticalPractice"/>
        <result column="date_departure" property="dateDeparture"/>
        <result column="desktop_picture" property="desktopPicture"/>
        <result column="attachment_information" property="attachmentInformation"/>
        <result column="remarks" property="remarks"/>
        <result column="user_id" property="userId"/>
        <result column="current_position" property="currentPosition"/>
    </resultMap>
    <select id="selectLimsUser" resultType="com.yuanchu.mom.dto.DepartmentDto">
@@ -49,48 +48,49 @@
    </select>
    <select id="basicInformationOfPersonnelSelectPage" resultType="java.util.Map">
        select
            u.id,
            u.name,
            u.account,
            cpbi.sex,
            cpbi.date_birth,
            u.age,
            cpbi.entry_time,
            cpbi.personnel_classification,
            cpbi.official_academic_redentials,
            cpbi.current_position,
            u.phone,
            cpbi.date_departure,
            cpbi.current_state,
            u1.name createUser
        select u.id,
               u.name,
               u.account,
               cpbi.sex,
               cpbi.date_birth,
               u.age,
               cpbi.entry_time,
               cpbi.personnel_classification,
               cpbi.official_academic_redentials,
               cpbi.current_position,
               u.phone,
               cpbi.date_departure,
               cpbi.current_state,
               u1.name createUser
        from user u
                 left join cnas_person_basic_info cpbi on cpbi.user_id = u.id
                 left join user u1 on u1.id = u.create_user
        where FIND_IN_SET(#{departmentId},u.depart_lims_id)
        where FIND_IN_SET(#{departmentId}, u.depart_lims_id)
    </select>
    <select id="selectPersonBasecInfoAndUser" resultType="java.util.Map">
        select
            u.id  userId,
            u.`name`  name,
            u.account account,
            DATE_FORMAT(cpbi.entry_time, '%Y-%m-%d') groupTime,
            DATE_FORMAT(cpbi.end_practical_practice, '%Y-%m-%d')  endPracticalPracticeStr,
            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,
            cpbi.emergency_contact emergencyContact,
            cpbi.emergency_contact_phone emergencyContactPhone
        u.id userId,
        u.`name` name,
        u.account account,
        DATE_FORMAT(cpbi.group_time, '%Y-%m-%d') groupTime,
        DATE_FORMAT(cpbi.end_practical_practice, '%Y-%m-%d') endPracticalPracticeStr,
        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,
        cpbi.emergency_contact emergencyContact,
        cpbi.emergency_contact_phone emergencyContactPhone,
        group_concat( DISTINCT technical_post SEPARATOR ',') technicalPost
        from user u
                 left join cnas_person_basic_info cpbi on cpbi.user_id = u.id
                 left join user u1 on u1.id = u.create_user
        left join cnas_person_basic_info cpbi on cpbi.user_id = u.id
        left join cnas_person_personnel_capacity cppc on u.id = cppc.user_id
        left join user u1 on u1.id = u.create_user
        <where>
            FIND_IN_SET(#{departmentId},u.depart_lims_id)
            <if test="name != null and name != ''">