<?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.jeeplus.human.depart.handover.mapper.HandoverProjectMapper">

    <insert id="saveProject">
        INSERT INTO human_resources_depart_handover_project (
        project_number,
        project_name,
        report_code,
        node_location,
        type,
        handover_id,
        create_project_user_id
        )
        VALUES
        <foreach collection="handoverProject" item="project" separator=",">
            (#{project.projectNumber},
             #{project.projectName},
             #{project.reportCode},
             #{project.nodeLocation},
             #{project.type},
             #{project.handoverId},
            #{project.createProjectUserId})
        </foreach>
    </insert>

    <select id="findProjectList" resultType="com.jeeplus.human.depart.handover.domain.HandoverProject">
        select
            a.id,
            a.create_time as createTime,
            a.create_by_id as createById,
            a.project_id as projectId,
            a.project_number as projectNumber,
            a.project_name as projectName,
            a.report_code as reportCode,
            a.node_location as nodeLocation,
            a.type,
            a.handover_id as handoverId,
            b.name as createName
            FROM human_resources_depart_handover_project a
            LEFT JOIN sys_user b on a.create_project_user_id = b.id
                ${ew.customSqlSegment}
    </select>
</mapper>