<?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.centrecareful.approvalInfo.mapper.ZsReimbursementFileSupplementMapper">
    <select id="getByReimId" resultType="com.jeeplus.centrecareful.approvalInfo.domain.ZsReimbursementFileSupplement">
        select
            crsf.id,
            crsf.create_by_id,
            crsf.status,
            crsf.proc_ins_id,
            crsf.process_definition_id,
            fsact.ID_ as taskIdFile
        from zs_reimbursement_file_supplement crsf
        LEFT JOIN act_ru_task fsact ON crsf.proc_ins_id = fsact.PROC_INST_ID_
        where crsf.reimbursement_id = #{id}
        order by crsf.create_time DESC limit 1
    </select>

    <update id="updateFileStatusById">
        update zs_reimbursement_file_supplement set status = #{fileStatus} where id = #{fileSuppleId}
    </update>

    <select id="getReimbursementCreateUserIdByProcessInstanceId" resultType="java.lang.String">
        select create_by_id from zs_reimbursement_info where del_flag = 0 and proc_ins_id = #{id} limit 1
    </select>


</mapper>