<?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.practice.reimburseRegister.mapper.ReimburseRegisterDetailMapper">

    <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.work_log_id,
        a.register_id,
        a.reimbursement_amount
    </sql>
    <update id="deleteDetailInfo">
        update human_resources_practice_reimburse_register_detail set del_flag = '1' where register_id = #{id}
    </update>

    <select id="getChildList"
            resultType="com.jeeplus.human.practice.reimburseRegister.domain.ReimburseRegisterDetail">
        select
        <include refid="Base_Column_List"></include>,
        b.work_name as workName,
        b.internship_days as internshipDays,
        su.name as createName
        from human_resources_practice_reimburse_register_detail a
        left join human_resources_practice_registration_work_log b on a.work_log_id = b.id
        left join sys_user su on b.create_by_id = su.id
        where a.del_flag = '0' and a.register_id = #{id}
    </select>
</mapper>