public void CreateMybatisXml(String tableName, String sqlTypeStr,
			String fieldStr) {
		StringBuilder str = new StringBuilder();
		str
				.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
						+ "<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\"\n"
						+ "\"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n");
		str.append("<mapper namespace=\"" + tableName + "_mapper\">\n");
		str.append("<insert id=\"insertLog\" parameterType=\"" + tableName
				+ "\">\n");
		str.append("\t\tinsert into ");
		str.append("${tableName} ");
		str.append("(");
		String[] fields = fieldStr.split(",");
		StringBuilder parameters = new StringBuilder();
		for (int i = 0; i < fields.length; i++) {
			if (fields[i].equals("id")) {
				continue;
			}
			str.append(fields[i]);
			str.append(",");
			parameters.append("#{");
			parameters.append(fields[i]);
			parameters.append("},");
		}
		str.deleteCharAt(str.length() - 1);
		str.append(") values(");
		str.append(parameters.deleteCharAt(parameters.length() - 1).toString());
		str.append(")\n");
		str.append("</insert>\n");

		str.append("<update id=\"createTable\" parameterType=\"" + tableName
				+ "\">\n");
		str.append("\tcreate table if not exists ${tableName} ");
		str.append("(");
		String[] types = sqlTypeStr.split(",");
		for (int i = 0; i < fields.length; i++) {
			if(fields[i].equals("id")){
				continue;
			}
			str.append(fields[i]);
			str.append(" ");
			str.append(types[i]);
			str.append(",");
		}
		str.deleteCharAt(str.length() - 1);
		str.append(")");
		str.append(" ENGINE = MyISAM DEFAULT CHARSET UTF8\n");
		str.append("</update>\n");
		str.append("</mapper>");
		
		// 生成文件
		File file = new File(System.getProperty("user.dir") + "/"
				+ "src/com/logserver/model/"
				+ StringUtils.firstToUpper(tableName + "Log") + ".xml");
		FileOutputStream out;
		try {
			out = new FileOutputStream(file);
			out.write(str.toString().getBytes("utf8"));
			out.flush();
			out.close();
			System.out.println("====生成日志类"
					+ StringUtils.firstToUpper(tableName) + "Log.xml 成功===");
			str.delete(0, str.length());
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}