package com.qmth.qrzk.repository.common;

import java.util.Map;

import org.apache.taglibs.standard.functions.Functions;

/**
 *
 * <p>Title: </p>
 * <p>Description: 内存对像自定义方法</p>
 * <p>Copyright: Copyright (c) 2005</p>
 * <p>Company: </p>
 *  * @author <a href="mailto:sunrao@91bi.com">sunrao</a>
 * @author not attributable
 * @version 1.0
 */
public class SqlFuncUtil {
    public SqlFuncUtil() {
    }

    public static String getMapValue(Map map, String key) {
            return map.get(key).toString();

    }
    public static Float Score_key(String value, String key,String key2) {
            if(value.indexOf(key)==-1||value.indexOf(key2)==-1){
               return 0f;
            }
            return Float.parseFloat(Functions.substringBefore(Functions.substringAfter(value, key),key2));

    }


    public static Float Scores_js(String value, String key,String flag) {
        try {
            return Float.parseFloat(Functions.substringBefore(Functions.substringAfter(value, key),";"));
        } catch (Exception ex) {
            if(flag!=null&&flag.equals("2"))
              return Float.parseFloat("99999999");
            else
              return Float.parseFloat("0");
        }
    }


    public  int parseInt(String s){
        return Integer.parseInt(s);
    }

    public  float parseFloat(String s){
        return Float.parseFloat(s);
    }

    public static void main(String[] args) {
        SqlFuncUtil sqlfuncutil = new SqlFuncUtil();
    }
}
