package com.engine.htsc.ReimbursementFlow.Dao;

import jxl.read.biff.Record;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.interfaces.htsc.GlobatTools.JAVATools;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TravelUserdepthDaoImpl {

    public List GetdetailInfo(Map<String,String> map){
       RecordSet rs=new RecordSet();
       List list=new ArrayList();
       String tablename= map.get("tablename");
       String detailtablename= map.get("detailtablename");
       String requestid= map.get("requestid");
        String sql="select ccrbmfzr,ccrszbm from "+detailtablename+" where mainid in (select id from  "+tablename+" where requestid='"+requestid+"')";
        JAVATools.SetCmdwritelog("查看明细表"+detailtablename+"的sql",sql);
        rs.execute(sql);

        while (rs.next()) {
            Map<String,String> deptuser=new HashMap<>();
            String ccrbmfzr= Util.null2String(rs.getString("ccrbmfzr"));
            String ccrszbm= Util.null2String(rs.getString("ccrszbm"));
           if(!"".equals(ccrbmfzr)&&!"".equals(ccrszbm)){
               deptuser.put("ccrbmfzr",ccrbmfzr);
               deptuser.put("ccrszbm",ccrszbm);
               list.add(deptuser);
           }
        }
        return list;
    }
}
