<?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.gtiit.shr.mapper.PersonMapper">

    <!-- 插入单条数据的SQL语句 -->
    <insert id="insert">
        INSERT INTO CT_SHR_PERSONINFO (
            id, PERSON_NUMBER, LAST_NAME, MIDDLE_NAMES, FIRST_NAME,
            LOCAL_NAME, DISPLAY_NAME, USER_PERSON_TYPE, FULL_PART_TIME,
            HIRE_DATE, PROBATION_PERIOD, PROBATION_UNIT, DATE_PROBATION_END,
            WORK_PHONE, CELL_PHONE, EMAIL_ADDRESS, S_EMAIL_ADDRESS,
            CITIZENSHIP, GENDER, DATE_OF_BIRTH, ETHNICITY, HUKOU_TYPE,
            POLITICAL_STATUS, TER_DATE, REASON, PROFESSIONAL_TITLE,
            JOB_LEVEL, USER_NAME, CONTRACT_START_DATE, CONTRACT_END_DATE,
            ERP_CREATION_DATE, ERP_LAST_UPDATE_DATE
        ) VALUES (
                     #{id}, #{personNumber}, #{lastName}, #{middleNames}, #{firstName},
                     #{localName}, #{displayName}, #{userPersonType}, #{fullPartTime},
                     #{hireDate, jdbcType=DATE}, #{probationPeriod}, #{probationUnit}, #{dateProbationEnd, jdbcType=DATE},
                     #{workPhone}, #{cellPhone}, #{emailAddress}, #{sEmailAddress},
                     #{citizenShip}, #{gender}, #{dateOfBirth, jdbcType=DATE}, #{ethnicity}, #{hukouType},
                     #{politicalStatus}, #{terDate, jdbcType=DATE}, #{reason}, #{professionalTitle},
                     #{jobLevel}, #{userName}, #{contractStartDate, jdbcType=DATE}, #{contractEndDate, jdbcType=DATE},
                     #{erpCreationDate, jdbcType=TIMESTAMP}, #{erpLastUpdateDate, jdbcType=TIMESTAMP}
                 )
    </insert>

    <!-- 批量插入的SQL语句 -->
    <insert id="insertBatch">
        INSERT INTO CT_SHR_PERSONINFO (
        id, PERSON_NUMBER, LAST_NAME, MIDDLE_NAMES, FIRST_NAME,
        LOCAL_NAME, DISPLAY_NAME, USER_PERSON_TYPE, FULL_PART_TIME,
        HIRE_DATE, PROBATION_PERIOD, PROBATION_UNIT, DATE_PROBATION_END,
        WORK_PHONE, CELL_PHONE, EMAIL_ADDRESS, S_EMAIL_ADDRESS,
        CITIZENSHIP, GENDER, DATE_OF_BIRTH, ETHNICITY, HUKOU_TYPE,
        POLITICAL_STATUS, TER_DATE, REASON, PROFESSIONAL_TITLE,
        JOB_LEVEL, USER_NAME, CONTRACT_START_DATE, CONTRACT_END_DATE,
        ERP_CREATION_DATE, ERP_LAST_UPDATE_DATE
        ) VALUES
        <foreach collection="list" item="item" separator=",">
            (
            #{item.id}, #{item.personNumber}, #{item.lastName}, #{item.middleNames}, #{item.firstName},
            #{item.localName}, #{item.displayName}, #{item.userPersonType}, #{item.fullPartTime},
            #{item.hireDate, jdbcType=DATE}, #{item.probationPeriod}, #{item.probationUnit}, #{item.dateProbationEnd, jdbcType=DATE},
            #{item.workPhone}, #{item.cellPhone}, #{item.emailAddress}, #{item.sEmailAddress},
            #{item.citizenShip}, #{item.gender}, #{item.dateOfBirth, jdbcType=DATE}, #{item.ethnicity}, #{item.hukouType},
            #{item.politicalStatus}, #{item.terDate, jdbcType=DATE}, #{item.reason}, #{item.professionalTitle},
            #{item.jobLevel}, #{item.userName}, #{item.contractStartDate, jdbcType=DATE}, #{item.contractEndDate, jdbcType=DATE},
            #{item.erpCreationDate, jdbcType=TIMESTAMP}, #{item.erpLastUpdateDate, jdbcType=TIMESTAMP}
            )
        </foreach>
    </insert>

</mapper>