import java.util.ArrayList;
import java.util.List;

public class getPublicSql {

    public static void main(String[] args) {
        getPublicSql.makeErrCodeSql();
    }
    public static void makeErrCodeSql(){

        String[] errCode00 = {
                "00,请输入密码",
                "01,用户不存在或密码不正确",
                "02,用户已临时冻结",
                "03,用户永久冻结",
                "04,用户已注销",
                "05,用户状态异常",
                "06,两次密码不一致，请修改",
                "07,用户不存在"
        };
        getPublicSql.getErrCodeSql("00",errCode00);


        String[] errCode02_TEST = {
                "00,用户正在进行中，请勿重复调用该接口",
                "01,用户已参与本项目，不能重复参与",
                "02,数据不存在"
        };
        getPublicSql.getErrCodeSql("02",errCode02_TEST);


        String[] errCode03_STUDY = {
                "00,用户数据异常，请排查"
        };
        getPublicSql.getErrCodeSql("03",errCode03_STUDY);


        String[] errCode06_MINE = {
                "00,用户已签到，请勿重复操作"
        };
        getPublicSql.getErrCodeSql("06",errCode06_MINE);


        String[] errCode05_MEETING = {
                "00,用户已签到，请勿重复操作",
                "01,用户签到数据异常，请排查",
                "02,用户已参加会议，请勿重复操作",
                "03,您无本次会议权限，无法操作",
                "04,您未参加本次会议，无法参与讨论"
        };
        getPublicSql.getErrCodeSql("05",errCode05_MEETING);


        String[] errCode90_PUBLIC = {
                "00,参数不全",
        };
        getPublicSql.getErrCodeSql("90",errCode90_PUBLIC);


    }
    public static void getErrCodeSql(String model,String[] list){
        String bsnCode = "PBSE"+model;
        String sql1s = "";
        String sql2s = "";
        for(int i = 0;i<list.length ;i++){
            String[] codes = list[i].split(",");
            String errCode = bsnCode+codes[0];
            String errLabel = codes[1];
            String errLang = "zh";
            String errIndex = "1";
            String sql1 = "insert into t_sys_dict (dict_code,dict_name,dict_type)values ('"+errCode+"','"+errCode+"错误','3');";
            String sql2 ="insert into t_sys_ditc_detail (dict_code,dict_label,dict_index,dict_lang)values" +
                    " ('"+errCode+"','"+errLabel+"','"+errIndex+"','"+errLang+"');";
            sql1s +=sql1 +" \n";
            sql2s +=sql2 +" \n";
//            System.out.println(sql1+"\n "+sql2);
        }
        System.out.println("#sql1s:\n"+sql1s);
        System.out.println("#sql2s:\n"+sql2s);

    }

}
