package com.engine.htsc.doc.util;

import weaver.conn.RecordSet;
import weaver.general.Util;

public class FileUtil {
    /**
     * @param requestid
     */
    public static String getDocid(String requestid){
        RecordSet rs = new RecordSet();
        rs.execute("select zwpdf from uf_gwky where LCID = '"+requestid+"'");
        rs.next();
        return Util.null2String(rs.getString("zwpdf"));
    }

    /**
     * @param docid
     */
    public static String getFjid(String docid){
        RecordSet rs = new RecordSet();
        rs.execute("select IMAGEFILEID from docimagefile where DOCID = '"+docid+"'");
        rs.next();
        return Util.null2String(rs.getString("IMAGEFILEID"));
    }

    /**
     * @param fjid
     */
    public static String getFileid(String fjid){
        RecordSet rs = new RecordSet();
        rs.execute("select  FILEID from imagefile where  IMAGEFILEID = '"+fjid+"'");
        rs.next();
        return Util.null2String(rs.getString("FILEID"));
    }

    /**
     *
     * @param imagefileid
     * @return
     */
    public static String getImageFileName(String imagefileid) {
        RecordSet rs = new RecordSet();
        rs.executeQuery("select imagefilename from imagefile where imagefileid = ?",imagefileid);
        rs.next();
        return Util.null2String(rs.getString("imagefilename"));
    }

}
