⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getcodingtable.java

📁 一套完整的工商12315的源程序jsp部分在12315里,后台JAVA部分在gs12315src里,没有打包数据库.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
            resultStr = eCode.getContent();
        }
        return resultStr;
    }

    /**
     * 获取城乡标志编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingCxbz(){
        String sql = "select * from a_bm_cxbm order by bm";
        return getCoding(sql);
    }

    /**
     * 获取城乡标志编码表的值
     * @ ArrayList
     */
    public static String getCodingCxbz(String bm){
        String sql = "select * from a_bm_cxbm where bm='" + bm + "' order by bm";
        String resultStr = null;
        EnterpriseCoding eCode = null;
        ArrayList al = getCoding(sql);
        if(0 < al.size()){
            eCode = (EnterpriseCoding) al.get(0);
            resultStr = eCode.getContent();
        }
        return resultStr;
    }

    /**
     * 获取经营场所产权编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingJycscq(){
        String sql = "select * from a_bm_jycscq order by bm";
        return getCoding(sql);
    }

    /**
     * 获取经营场所产权编码表的值
     * @ ArrayList
     */
    public static String getCodingJycscq(String bm){
        String sql = "select * from a_bm_jycscq where bm='" + bm + "' order by bm";
        String resultStr = null;
        EnterpriseCoding eCode = null;
        ArrayList al = getCoding(sql);
        if(0 < al.size()){
            eCode = (EnterpriseCoding) al.get(0);
            resultStr = eCode.getContent();
        }
        return resultStr;
    }

    /**
     * 获取开业类型编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingKylb(){
        String sql = "select * from a_bm_kylb order by bm";
        return getCoding(sql);
    }

    /**
     * 获取经营场所产权编码表的值
     * @ ArrayList
     */
    public static String getCodingKylb(String bm){
        String sql = "select * from a_bm_kylb where bm='" + bm + "' order by bm";
        String resultStr = null;
        EnterpriseCoding eCode = null;
        ArrayList al = getCoding(sql);
        if(0 < al.size()){
            eCode = (EnterpriseCoding) al.get(0);
            resultStr = eCode.getContent();
        }
        return resultStr;
    }

    /**
     * 获取经营类型编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingJylb(){
        String sql = "select * from b_bm_jylb order by bm";
        return getCoding(sql);
    }

    /**
     * 获取经营类型编码表的值
     * @ ArrayList
     */
    public static String getCodingJylb(String bm){
        String sql = "select * from b_bm_jylb where bm='" + bm + "' order by bm";
        String resultStr = null;
        EnterpriseCoding eCode = null;
        ArrayList al = getCoding(sql);
        if(0 < al.size()){
            eCode = (EnterpriseCoding) al.get(0);
            resultStr = eCode.getContent();
        }
        return resultStr;
    }

    /**
     * 获取档案管理期限编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingDaglqx(){
        String sql = "select * from a_bm_dabgjb order by coding";
        return getCoding(sql);
    }

    /**
     * 获取档案管理期限编码表的值
     * @ ArrayList
     */
    public static String getCodingDaglqx(String bm){
        String sql = "select * from a_bm_dabgjb where coding='" + bm + "' order by coding";
        String resultStr = null;
        EnterpriseCoding eCode = null;
        ArrayList al = getCoding(sql);
        if(0 < al.size()){
            eCode = (EnterpriseCoding) al.get(0);
            resultStr = eCode.getContent();
        }
        return resultStr;
    }

    /**
     * 获取企业类型编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingEconomy(){
        String sql = "select * from gsgsjout_coding_economy order by coding";
        return getCoding(sql);
    }

    /**
     * 获取企业类型编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingEconomyByPre(String scape){
        StringBuffer subSql = new StringBuffer();
        if(scape != null && !scape.equals("")){
            StringTokenizer strTok = new StringTokenizer(scape,"~");
            while(strTok.hasMoreTokens()){
                subSql.append("coding like '");
                subSql.append(strTok.nextToken());
                subSql.append("%' or ");
            }
            subSql.delete(subSql.length() - 4,subSql.length() - 1);
        }

        StringBuffer sqlBuf = new StringBuffer();
        sqlBuf.append("select distinct * from ");
        sqlBuf.append(TableNameUtil.GSGSJOUT_CODING_ECONOMY);
        if(scape != null && !scape.equals("")){
            sqlBuf.append(" where ");
            sqlBuf.append(subSql);
        }
        sqlBuf.append(" order by coding");
        return getCoding(sqlBuf.toString());
    }

    /**
     * 获取企业类型编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingEconomy(String coding){
        String sql = "select * from gsgsjout_coding_economy where coding='" + coding + "'";
        return getCoding(sql);
    }

    /**
     * 获取企业类型编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingEconomy(String BID,String str){
        String sql = null;
        sql = "select * from gsgsjout_coding_economy order by coding ";
        if(BID.equalsIgnoreCase("020101")){
            sql = "select * from gsgsjout_coding_economy where substr(coding,0,1)='1' and coding<>'1000' order by coding ";
        }
        if(BID.equalsIgnoreCase("020102")){
            sql = "select * from gsgsjout_coding_economy where substr(coding,0,1)='2' and coding<>'2000' order by coding ";
        }
        if(BID.equalsIgnoreCase("020104")){
            sql = "select * from gsgsjout_coding_economy where substr(coding,0,1)='3' and coding<>'3000' order by coding ";
        }
        if(BID.equalsIgnoreCase("020103")){
            sql = "select * from gsgsjout_coding_economy where substr(coding,0,1)='4' and coding<>'4000' order by coding ";
        }
//        if(BID.equalsIgnoreCase("020302")){
//            sql = "select * from gsgsjout_coding_economy where substr(coding,0,2)='45'  order by coding ";
//        }
        return getCoding(sql);
    }

    /**
     * 获取行业门类编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingTradeCategory(){
        String sql = "select * from gsgsjout_coding_trade where typee='1' order by coding";
        return getCoding(sql);
    }

    /**
     * 获取所有的汇率
     * @return ArrayList
     */
    public static ArrayList getCodingExchangeRate(){
        Connection conn = null;
        Statement stmt = null;
        ResultSet rs = null;

        String sql = "select * from A_BM_EXCHANGE_RATE";
        Debug.println(sql);
        ArrayList returnAL = new ArrayList();
        try{
            conn = Common.getConnection();
            stmt = conn.createStatement();
            rs = stmt.executeQuery(sql);
            while(rs.next()){
                ArrayList al = new ArrayList();
                al.add(rs.getString(1));
                al.add(rs.getString(2));
                al.add(rs.getString(3));
                returnAL.add(al);
            }
        } catch(Exception e){
            Debug.println("[GetCodingTable-->getUserName]Error--" + e.getMessage());
        } finally{
            cleanup(rs,stmt,conn);
        }
        return returnAL;
    }

    /**
     * 获取所有的汇率
     * @return ArrayList
     */
    public static String getCodingExchangeRateHTML(ArrayList rateAL){
        StringBuffer htmlBuf = new StringBuffer();
        ArrayList al = null;
        htmlBuf.append("var bm = new Array();//其他货币种类\n");
        htmlBuf.append("var RATE = new Array();//其他货币对美元的汇率\n");
        for(int i = 0;i < rateAL.size();i++){
            al = (ArrayList) rateAL.get(i);
            htmlBuf.append(" bm[");
            htmlBuf.append(i);
            htmlBuf.append("]='");
            htmlBuf.append(PubFunc.toShowForm((String) al.get(0)));
            htmlBuf.append("';\n");
            htmlBuf.append(" RATE[");
            htmlBuf.append(i);
            htmlBuf.append("]='");
            htmlBuf.append(PubFunc.toShowForm((String) al.get(2)));
            htmlBuf.append("';\n");
        }
        return htmlBuf.toString();
    }

    /**
     *
     * @param bm1
     * @param bm2
     * @return
     */
    public static String getCodingExchangeRate(String bm1,String bm2){
        Connection conn = null;
        Statement stmt = null;
        ResultSet rs = null;

        String sql = "select rate from A_BM_EXCHANGE_RATE where bm1='" + bm1 + "' and  bm2='" + bm2 + "'";
        String resultStr = null;

        try{
            conn = Common.getConnection();
            stmt = conn.createStatement();
            rs = stmt.executeQuery(sql);
            Debug.println(sql);
            if(rs.next()){
                resultStr = rs.getString("rate");
            }
        } catch(Exception e){
            Debug.println("[GetCodingTable-->getUserName]Error--" + e.getMessage());
        } finally{
            cleanup(rs,stmt,conn);
        }

        return resultStr;

    }

    /**
     * 获取行业门类编码表的值
     * @ ArrayList
     */
    public static String getCodingTradeCategory(String bm){
        return getCodingTrade(bm);
    }

    /**
     * 获取地域编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingRegion(){
        String sql = "select * from gsshare_coding_registerorg order by coding";
        return getCoding(sql);
    }

    /**
     * hjm 2004-3-31
     * 获取地域编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingRegion(String strVal,int n){
        String sql = "";
        if(n >= 9){
            sql = "select * from gsshare_coding_registerorg where length(coding)>=" + n + " and coding like '" + strVal + "%' order by coding";
        } else{
            sql = "select * from gsshare_coding_registerorg where coding like '" + strVal + "%' order by coding";
        }
        Debug.print("sql==============" + sql);
        return getCoding(sql);
    }

    /**
     * 获取地域编码表的值
     * @ ArrayList
     */
    public static String getCodingRegion(String bm){
        String sql = "select * from gsshare_coding_registerorg where coding='" + bm + "' order by coding";
        String resultStr = null;
        EnterpriseCoding eCode = null;
        ArrayList al = getCoding(sql);
        if(0 < al.size()){
            eCode = (EnterpriseCoding) al.get(0);
            resultStr = eCode.getContent();
        }
        return resultStr;
    }

    /**
     * 获取行业代码编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingTrade(){
        String sql = "select * from gsgsjout_coding_trade where typee<>'1' order by coding";
        return getCoding(sql);
    }

    /**
     * 获取行业代码编码表的值
     * @ ArrayList
     */
    public static String getCodingTrade(String bm){
        String sql = "select * from gsgsjout_coding_trade where coding='" + bm + "' order by coding";
        String resultStr = null;
        EnterpriseCoding eCode = null;
        ArrayList al = getCoding(sql);
        if(0 < al.size()){
            eCode = (EnterpriseCoding) al.get(0);
            resultStr = eCode.getContent();
        }
        return resultStr;
    }

    /**
     * 获取货币单位编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingMoney(){
        String sql = "select * from universal_dict_money order by bm";
        return getCoding(sql);
    }

    /**
     * 获取货币单位编码表的值
     * @ ArrayList
     */
    public static String getCodingMoney(String bm){
        String sql = "select * from universal_dict_money where bm='" + bm + "' order by bm";
        String resultStr = null;
        EnterpriseCoding eCode = null;
        ArrayList al = getCoding(sql);
        if(0 < al.size()){
            eCode = (EnterpriseCoding) al.get(0);
            resultStr = eCode.getContent();
        }
        return resultStr;
    }

    /**
     * 获取国家编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingCountry(){
        String sql = "select * from a_bm_gbdq order by bmzb";
        return getCoding(sql);
    }

    /**
     * 获取国家编码表的值
     * @ ArrayList 类型编码表
     */
    public static ArrayList getCodingCountry(String coding){
        String sql = "select * from a_bm_gbdq where bm='" + coding + "'";
        return getCoding(sql);
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -