package com.chenyang.nse.bussiness.engine.infa.powercenter961.isomerdata;

import com.chenyang.nse.bussiness.engine.infa.InfoProperty;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.CONFIG;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.FOLDER;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPING;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPLET;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.POWERMART;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.REPOSITORY;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.SOURCE;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.TARGET;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.WORKFLOW;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Configutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Folderutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.ParamBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Powermartutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Repositoryutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.CommonBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.MappingBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.MappingPramaBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.MappletMakeDatabean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.SourceBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.TargetBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.WorkflowBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubtool.InfoExecUtil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubtool.ToObjutil;
import com.chenyang.nse.bussiness.tools.io.FileTool;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

public class MakeIsomerUtil {
   public static void isomerMasking(ParamBean par_bean, InfoProperty tengine, SourceBean sou_bean, TargetBean tar_bean, List<MappletMakeDatabean> mapplet, List<MappingPramaBean> paramList, String... maskingType) throws Exception {
      if (null != maskingType && maskingType.length > 0 && maskingType[0].equals("false")) {
         tar_bean.setTranctype("NO");
      } else {
         tar_bean.setTranctype("YES");
      }

      new POWERMART();
      POWERMART powermart = Powermartutil.getPowermart(par_bean);
      new REPOSITORY();
      REPOSITORY repository = Repositoryutil.getREPOSITORY(par_bean, tengine);
      new FOLDER();
      FOLDER folder = Folderutil.getFolder(par_bean);
      new SOURCE();
      SOURCE source = SourceUtil.getSource(sou_bean);
      folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(source);
      new TARGET();
      TARGET target = TargetUtil.getTatget(tar_bean);
      folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(target);
      FileTool.createFolder(tengine.getXmldir() + File.separator + "mapplet");
      if (tar_bean.getCb().getJudgelist() != null && tar_bean.getCb().getJudgelist().size() > 0 && tar_bean.getCb().getJudgelist().contains("NO")) {
         try {
            InfoExecUtil.exeobjectexportmapplet(tengine.getPmrepexepath(), "cs_mapplet", "mapplet_judge", tengine.getXmldir() + File.separator + "cs_mapplet" + File.separator + "mapplet_judge");
            InputStream is = new FileInputStream(tengine.getXmldir() + File.separator + "cs_mapplet" + File.separator + "mapplet_judge.xml");
            ToObjutil to = new ToObjutil();
            BufferedReader tBufferedReader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
            int k = 0;
            StringBuffer tStringBuffer = new StringBuffer();
            new String("");

            String map_typeList;
            while((map_typeList = tBufferedReader.readLine()) != null) {
               ++k;
               if (k == 2) {
                  tStringBuffer.append("");
               } else {
                  tStringBuffer.append(map_typeList);
               }
            }

            Object obj = ToObjutil.unmarshalmo("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean", tStringBuffer.toString());
            POWERMART power = (POWERMART)obj;
            List<REPOSITORY> repositorListWf = power.getREPOSITORY();
            new MAPPLET();

            for(int l = 0; l < repositorListWf.size(); ++l) {
               REPOSITORY repositor = (REPOSITORY)repositorListWf.get(l);
               List<FOLDER> folderList = repositor.getFOLDER();

               for(int j = 0; j < folderList.size(); ++j) {
                  FOLDER folder1 = (FOLDER)folderList.get(j);

                  for(Object object1 : folder1.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO()) {
                     if (object1.getClass().getName().equals("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPLET")) {
                        MAPPLET mu = (MAPPLET)object1;
                        folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(mu);
                     }
                  }
               }
            }
         } catch (Exception e) {
            e.printStackTrace();
         }
      }

      List<String> maplist = new ArrayList();
      List<MappletMakeDatabean> map = new ArrayList();
      if (mapplet != null && mapplet.size() > 0) {
         for(int i = 0; i < mapplet.size(); ++i) {
            if (i == 0) {
               map.add(mapplet.get(i));
               maplist.add(((MappletMakeDatabean)mapplet.get(i)).getMappletname());
            } else if (!maplist.contains(((MappletMakeDatabean)mapplet.get(i)).getMappletname())) {
               map.add(mapplet.get(i));
            }
         }
      }

      if (map != null && map.size() > 0) {
         for(int i = 0; i < map.size(); ++i) {
            try {
               InfoExecUtil.exeobjectexportmapplet(tengine.getPmrepexepath(), "cs_mapplet", ((MappletMakeDatabean)map.get(i)).getMappletname(), tengine.getXmldir() + File.separator + "cs_mapplet" + File.separator + ((MappletMakeDatabean)map.get(i)).getMappletname());
               InputStream is = new FileInputStream(tengine.getXmldir() + File.separator + "cs_mapplet" + File.separator + ((MappletMakeDatabean)map.get(i)).getMappletname() + ".xml");
               ToObjutil to = new ToObjutil();
               BufferedReader tBufferedReader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
               int k = 0;
               StringBuffer tStringBuffer = new StringBuffer();
               new String("");

               String var50;
               while((var50 = tBufferedReader.readLine()) != null) {
                  ++k;
                  if (k == 2) {
                     tStringBuffer.append("");
                  } else {
                     tStringBuffer.append(var50);
                  }
               }

               Object obj = ToObjutil.unmarshalmo("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean", tStringBuffer.toString());
               POWERMART power = (POWERMART)obj;
               List<REPOSITORY> repositorListWf = power.getREPOSITORY();
               new MAPPLET();

               for(int l = 0; l < repositorListWf.size(); ++l) {
                  REPOSITORY repositor = (REPOSITORY)repositorListWf.get(l);
                  List<FOLDER> folderList = repositor.getFOLDER();

                  for(int j = 0; j < folderList.size(); ++j) {
                     FOLDER folder1 = (FOLDER)folderList.get(j);

                     for(Object object1 : folder1.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO()) {
                        if (object1.getClass().getName().equals("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPLET")) {
                           MAPPLET var69 = (MAPPLET)object1;
                           folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var69);
                        }
                     }
                  }
               }
            } catch (Exception e) {
               e.printStackTrace();
            }
         }
      }

      MappingBean map_bean = new MappingBean();
      map_bean.setSou_bean(sou_bean);
      map_bean.setTar_bean(tar_bean);
      map_bean.setMapping_name("mp_" + sou_bean.getSo_name());
      map_bean.setSq_name("SQ_" + sou_bean.getSo_name());
      map_bean.setMappingsql(par_bean.getMappingsql());
      map_bean.setSource_name(sou_bean.getSo_name());
      map_bean.setTarget_name(tar_bean.getTar_name());
      map_bean.setSourcedbname(sou_bean.getDbdname());
      map_bean.setMappletbean(mapplet);
      map_bean.setParamList(paramList);
      if ("Flat File".equalsIgnoreCase(sou_bean.getDatabasetype())) {
         map_bean.setSourcedbtype("Flat File");
      }

      CommonBean mapping_cd = new CommonBean();
      CommonBean cblist = sou_bean.getCb();
      List<String> map_typeList = new ArrayList();
      List<String> map_precisionList = new ArrayList();
      List<String> map_scaleList = new ArrayList();
      if ("DB2".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("INTEGER".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("BIGINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("BLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("CHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("CHARACTER".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("CLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("DATE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("DBCLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("DECIMAL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("DOUBLE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("GRAPHIC".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("LONG VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("LONG VARGRAPHIC".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("REAL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("SMALLINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("TIME".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("TIMESTAMP".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("VARGRAPHIC".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("XML".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("104857600");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("DECFLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("AS400".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("character".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("double".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("100");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("100");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("numeric".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("200");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("clob".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("blob".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("DECFLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("ORACLE".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("TIMESTAMP(6)".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("TIMESTAMP(6) WITH LOCAL TIME ZONE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("TIMESTAMP(7)".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("TIMESTAMP(6) WITH TIME ZONE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("number(p,s)".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("38");
               map_scaleList.add("0");
            } else if ("NUMBER".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("15");
            } else if ("DATE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("long raw".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("BFILE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("BINARY_DOUBLE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("15");
            } else if ("CHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("BINARY_FLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("15");
            } else if ("DBURITYPE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("BLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("HTTPURITYPE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("CLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("INTERVAL DAY(2) TO SECOND(6)".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("NCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("NCLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("FLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("INTERVAL YEAR(2) TO MONTH".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("SDO_GEOMETRY".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("INTEGER".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("MLSLABEL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("SDO_GEORASTER".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("VARCHAR2".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("URITYPE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("XDBURITYPE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("NVARCHAR2".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("LONG".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("104857600");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ORDAUDIO".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ORDDOC".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ORDIMAGE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ORDIMAGESIGNATURE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ORDVIDEO".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("RAW".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ROWID".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ANYDATA".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ANYDATASET".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ANYTYPE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("XMLTYPE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("Flat File".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("number".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("double".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("bigint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add("19");
               map_scaleList.add("0");
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("INFORMIX".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("blob".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("boolean".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("byte".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("29");
               map_scaleList.add("0");
            } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("clob".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("float".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("0");
            } else if ("int8".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add("19");
               map_scaleList.add("0");
            } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add("10");
               map_scaleList.add("0");
            } else if ("lvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("16");
               map_scaleList.add("2");
            } else if ("nchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("nvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("serial".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add("10");
               map_scaleList.add("0");
            } else if ("serial8".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add("19");
               map_scaleList.add("0");
            } else if ("smallfloat".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("real");
               map_precisionList.add("7");
               map_scaleList.add("0");
            } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if ("MSSQLSERVER".equals(sou_bean.getDatabasetype())) {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add("10");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("bigint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add("19");
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("varbinary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("binary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("bit".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("1");
               map_scaleList.add("0");
            } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetime2".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetimeoffset".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("34");
               map_scaleList.add("0");
            } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("float".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("0");
            } else if ("geography".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("geometry".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("image".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("19");
               map_scaleList.add("4");
            } else if ("nvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("nchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("ntext".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("numeric".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("real".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("real");
               map_precisionList.add("7");
               map_scaleList.add("0");
            } else if ("smalldatetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("smallmoney".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add("10");
               map_scaleList.add("4");
            } else if ("sql_variant".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("sysname".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("128");
               map_scaleList.add("4");
            } else if ("text".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("text");
               map_precisionList.add("4000");
               map_scaleList.add("0");
            } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("8");
               map_scaleList.add("0");
            } else if ("tinyint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("uniqueidentifier".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("38");
               map_scaleList.add("0");
            } else if ("xml".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      } else if (!"MYSQL".equals(sou_bean.getDatabasetype()) && !"MARIADB".equals(sou_bean.getDatabasetype())) {
         if ("SYBASE".equals(sou_bean.getDatabasetype())) {
            for(int i = 0; i < cblist.getTypeList().size(); ++i) {
               if ("bigint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("bigint");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("binary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("bit".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("decimal");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("float".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("image".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("binary");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("integer");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("longsysname".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add("255");
                  map_scaleList.add("0");
               } else if ("nchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("nstring");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("nvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("nstring");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("decimal");
                  map_precisionList.add("19");
                  map_scaleList.add("4");
               } else if ("real".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("real");
                  map_precisionList.add("7");
                  map_scaleList.add("0");
               } else if ("smalldatetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("smallmoney".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("decimal");
                  map_precisionList.add("10");
                  map_scaleList.add("4");
               } else if ("sysname".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add("100");
                  map_scaleList.add("0");
               } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("binary");
                  map_precisionList.add("8");
                  map_scaleList.add("0");
               } else if ("text".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("text");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("varbinary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("tinyint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("unichar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("200");
                  map_scaleList.add("0");
               } else if ("unitext".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("4000");
                  map_scaleList.add("9");
               } else if ("univarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("200");
                  map_scaleList.add("0");
               } else if ("unsigned bigint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("bigint");
                  map_precisionList.add("19");
                  map_scaleList.add("0");
               } else if ("unsigned int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("integer");
                  map_precisionList.add("10");
                  map_scaleList.add("0");
               } else if ("unsigned smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else {
                  map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add(cblist.getScalelist().get(i));
               }
            }
         } else if ("SYBASE_IQ".equals(sou_bean.getDatabasetype())) {
            for(int i = 0; i < cblist.getTypeList().size(); ++i) {
               if ("bigint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("bigint");
                  map_precisionList.add("19");
                  map_scaleList.add("0");
               } else if ("binary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("bit".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("decimal");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("double".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("double");
                  map_precisionList.add("15");
                  map_scaleList.add("0");
               } else if ("float".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("real");
                  map_precisionList.add("7");
                  map_scaleList.add("0");
               } else if (!"integer".equalsIgnoreCase((String)cblist.getTypeList().get(i)) && !"int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("decimal");
                     map_precisionList.add(cblist.getPrecisionList().get(i));
                     map_scaleList.add(cblist.getScalelist().get(i));
                  } else if ("numeric".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("decimal");
                     map_precisionList.add(cblist.getPrecisionList().get(i));
                     map_scaleList.add(cblist.getScalelist().get(i));
                  } else if ("oldbit".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("small integer");
                     map_precisionList.add("5");
                     map_scaleList.add("0");
                  } else if ("smalldatetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("date/time");
                     map_precisionList.add("29");
                     map_scaleList.add("9");
                  } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("small integer");
                     map_precisionList.add("5");
                     map_scaleList.add("0");
                  } else if ("smallmoney".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("decimal");
                     map_precisionList.add(cblist.getPrecisionList().get(i));
                     map_scaleList.add(cblist.getScalelist().get(i));
                  } else if ("sysname".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("string");
                     map_precisionList.add(cblist.getPrecisionList().get(i));
                     map_scaleList.add("0");
                  } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("date/time");
                     map_precisionList.add("29");
                     map_scaleList.add("9");
                  } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("date/time");
                     map_precisionList.add("29");
                     map_scaleList.add("9");
                  } else if ("tinyint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("small integer");
                     map_precisionList.add("5");
                     map_scaleList.add("0");
                  } else if ("uniqueidentifier".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("binary");
                     map_precisionList.add(cblist.getPrecisionList().get(i));
                     map_scaleList.add("0");
                  } else if ("uniqueidentifierstr".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("string");
                     map_precisionList.add(cblist.getPrecisionList().get(i));
                     map_scaleList.add("0");
                  } else if ("unsigned bigint".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("bigint");
                     map_precisionList.add("19");
                     map_scaleList.add("0");
                  } else if ("unsigned int".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("integer");
                     map_precisionList.add("10");
                     map_scaleList.add("0");
                  } else if ("varbinary".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("binary");
                     map_precisionList.add(cblist.getPrecisionList().get(i));
                     map_scaleList.add("0");
                  } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                     map_typeList.add("string");
                     map_precisionList.add(cblist.getPrecisionList().get(i));
                     map_scaleList.add("0");
                  } else {
                     map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
                     map_precisionList.add(cblist.getPrecisionList().get(i));
                     map_scaleList.add(cblist.getScalelist().get(i));
                  }
               } else {
                  map_typeList.add("integer");
                  map_precisionList.add("10");
                  map_scaleList.add("0");
               }
            }
         } else if ("HIVE".equals(sou_bean.getDatabasetype())) {
            for(int i = 0; i < cblist.getTypeList().size(); ++i) {
               if ("STRING".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add("50");
                  map_scaleList.add("0");
               } else if ("VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add("50");
                  map_scaleList.add("0");
               } else if ("DECIMAL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("decimal");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("BOOLEAN".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add("1");
                  map_scaleList.add("0");
               } else if ("TINYINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("SMALLINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("INT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("integer");
                  map_precisionList.add("10");
                  map_scaleList.add("0");
               } else if ("BIGINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("bigint");
                  map_precisionList.add("19");
                  map_scaleList.add("0");
               } else if ("FLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("double");
                  map_precisionList.add("15");
                  map_scaleList.add("0");
               } else if ("BINARY".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("binary");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else if ("DATE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("TIMESTAMP".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else {
                  map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add(cblist.getScalelist().get(i));
               }
            }
         }
      } else {
         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("TINYINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("SMALLINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("MEDIUMINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add("10");
               map_scaleList.add("0");
            } else if ("INT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("integer");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("BIGINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("bigint");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("BIT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("DOUBLE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("double");
               map_precisionList.add("15");
               map_scaleList.add("0");
            } else if ("FLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("real");
               map_precisionList.add("7");
               map_scaleList.add("0");
            } else if ("DECIMAL".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("decimal");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            } else if ("CHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("string");
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add("0");
            } else if ("DATE".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("TIME".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("YEAR".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("small integer");
               map_precisionList.add("5");
               map_scaleList.add("0");
            } else if ("TIMESTAMP".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("DATETIME".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("TINYBLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("BLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("65535");
               map_scaleList.add("0");
            } else if ("MEDIUMBLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("16777215");
               map_scaleList.add("0");
            } else if ("LONGBLOB".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("TINYTEXT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("TEXT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("65535");
               map_scaleList.add("9");
            } else if ("MEDIUMTEXT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("16777215");
               map_scaleList.add("0");
            } else if ("LONGTEXT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("ntext");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("ENUM".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("1");
               map_scaleList.add("0");
            } else if ("SET".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("nstring");
               map_precisionList.add("1");
               map_scaleList.add("0");
            } else if ("BINARY".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("VARBINARY".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("255");
               map_scaleList.add("0");
            } else if ("POINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("LINESTRING".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("POLYGON".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("GEOMETRY".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("MULTIPOINT".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("MULTILINESTRING".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("MULTIPOLYGON".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else if ("GEOMETRYCOLLECTION".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("binary");
               map_precisionList.add("104857600");
               map_scaleList.add("0");
            } else {
               map_typeList.add(((String)cblist.getTypeList().get(i)).toLowerCase());
               map_precisionList.add(cblist.getPrecisionList().get(i));
               map_scaleList.add(cblist.getScalelist().get(i));
            }
         }
      }

      if ("TERADATA".equals(sou_bean.getDescripion())) {
         System.out.println("date >>>>>>>>>>>>>>>>>>>>>>format");

         for(int i = 0; i < cblist.getTypeList().size(); ++i) {
            if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
               map_typeList.add("date/time");
               map_precisionList.add("29");
               map_scaleList.add("9");
            }
         }
      }

      mapping_cd.setNameList(cblist.getNameList());
      mapping_cd.setMappingLengthList(map_precisionList);
      mapping_cd.setMappingTypeList(map_typeList);
      mapping_cd.setMappingScalelist(map_scaleList);
      map_bean.setCb(mapping_cd);
      new MAPPING();
      MappingUtil mu = new MappingUtil();
      MAPPING var62 = mu.getMapping(map_bean);
      folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var62);
      new CONFIG();
      CONFIG var66 = Configutil.getConfig();
      folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var66);
      WorkflowBean work_bean = new WorkflowBean();
      work_bean.setWorkflow_name("wf_" + sou_bean.getSo_name());
      work_bean.setMapping_name(map_bean.getMapping_name());
      work_bean.setSourcename(sou_bean.getSo_name());
      work_bean.setTargetname(tar_bean.getTar_name());
      work_bean.setSqname(map_bean.getSq_name());
      work_bean.setTargetdbname(tar_bean.getTar_name());
      work_bean.setSourcedbname(sou_bean.getSo_name());
      work_bean.setSourceownername(sou_bean.getSourceownername());
      work_bean.setTargetownername(tar_bean.getTargetownername());
      work_bean.setMappletbean(mapplet);
      work_bean.setSou_linkname(sou_bean.getLinkname());
      work_bean.setTar_linkname(tar_bean.getLinkname());
      work_bean.setParampath(par_bean.getParam_path());
      work_bean.setSource_dbtype(sou_bean.getDatabasetype());
      work_bean.setTarget_dbtype(tar_bean.getDatabasetype());
      work_bean.setS_file_name(sou_bean.getFilename());
      work_bean.setT_file_name(tar_bean.getFilename());
      work_bean.setS_file_path(sou_bean.getFilepath());
      work_bean.setT_file_path(tar_bean.getFilepath());
      new WORKFLOW();
      WorkflowUtil wu = new WorkflowUtil();
      WORKFLOW var70 = wu.getWorkflow(sou_bean, tar_bean, work_bean, tengine);
      folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var70);
      repository.getFOLDER().add(folder);
      powermart.getREPOSITORY().add(repository);
      List<Object> alllist = new ArrayList();
      alllist.add(powermart);
      OutputStream f = null;
      String xmlFileStr = "masking_task";
      if (maskingType.length > 1 && null != maskingType && maskingType.length > 0 && maskingType[1].equals("self")) {
         xmlFileStr = "masking_self";
      }

      FileTool.createFolder(tengine.getXmldir() + File.separator + xmlFileStr + File.separator + par_bean.getTaskname());
      OutputStream var77 = new FileOutputStream(tengine.getXmldir() + File.separator + xmlFileStr + File.separator + par_bean.getTaskname() + File.separator + sou_bean.getSo_name() + ".xml");
      ToObjutil.marshalmapplet("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean", alllist, var77, "");
   }
}
