<?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.HandoverDraftMapper">
    <sql id="Base_Column_List">
        a.id,
        a.create_by_id,
        a.create_time,
        a.update_by_id,
        a.update_time,
        a.del_flag,
        a.type,
        a.proc_ins_id,
        a.process_definition_id,
        a.handover_id
    </sql>
    <update id="updateStatusById">
        UPDATE human_resources_depart_handover_draft SET type = #{type}
		WHERE id = #{id}
    </update>

    <select id="getById" resultType="com.jeeplus.human.depart.handover.domain.HandoverDraft">
        select
        <include refid="Base_Column_List"></include>,
        b.create_by_id as assigneeId,
        b.draft_administrator as draftAdministrator,
        su.name as name,
        su.office_id as department,
        su.id as userId
        from human_resources_depart_handover_draft a
        left join human_resources_depart_handover b on a.handover_id = b.id
        left join sys_user su on b.create_by_id = su.id
        where a.id = #{id} and a.del_flag = '0'
    </select>
</mapper>