<?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.dsk.cscec.mapper.CbProjectFileMapper">
    <!--获取现场经费菜单-->
    <select id="getSceneExpenseMenuFromFile" resultType="com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo">
        select cpf.id        as fileId,
               cpf.file_name as menuName
        from cb_project_file cpf
        where cpf.project_id = #{projectId}
          and cpf.del_flag = #{deleteFlagExist}
          and cpf.cb_type = #{cbTypeSceneExpense}
          and cpf.file_parse_status = #{projectFileStatusParseSuccess};
    </select>

    <select id="selectAnalysisList" resultType="com.dsk.cscec.domain.CbProjectFile">
        SELECT
        id, project_id, cb_stage, cb_type, file_name, file_oss_id, file_oss_url, file_parse_status, fail_remark,
        del_flag, create_by, create_time, update_by, update_time
        FROM cb_project_file
        WHERE del_flag = 0 and file_parse_status in (1,3) and project_id=#{projectId}
        <if test="cbStage != null">
            and cb_stage =#{cbStage}
        </if>
        and cb_type = #{cbType}
    </select>

    <update id="removeById">
        UPDATE cb_project_file SET del_flag=2 WHERE id=#{id}
    </update>
</mapper>