package com.engine.htsc.ReimbursementFlow.Esb.Dao;

import weaver.conn.RecordSet;
import weaver.interfaces.htsc.GlobatTools.JAVATools;

import java.text.MessageFormat;
import java.util.List;

public class UfzbbxesblocalDao {

    public int gettravelcodesum(String travelcodes){
        int tcsum=0;
        if("".equals(travelcodes)){
            return tcsum;
        }
        String sql="select count(*) as tcsum from uf_zbbxesblocal where travelcode in ( {0} )";
        sql=MessageFormat.format(sql,travelcodes);
        RecordSet rs=new RecordSet();
        rs.execute(sql);
        if(rs.getCounts()>0){
            rs.next();
            tcsum= rs.getInt("tcsum");
        }
        return tcsum;
    }


    public List gettravelcodelist(String travelcodes){

        if("".equals(travelcodes)){
            return null;
        }
        String sql="select *  from uf_zbbxesblocal where travelcode in ( {0} )";
        sql=MessageFormat.format(sql,travelcodes);
       return JAVATools.GetTableToListMap(sql,null);
    }


}
