protected String buildQeuryString() {
        String query = "INSERT INTO register_info (";
        String args = "";
        String vals = "";
        String updates = "";

        Set<Map.Entry<String, String[]>> entries = this.paramMap.entrySet();
        Iterator<Map.Entry<String, String[]>> it = entries.iterator();
        while (it.hasNext()) {
            Map.Entry<String, String[]> item = it.next();
            /**
             * If the key is not in the fields of register_info_fields, it
             * will not be processed.
             */
            if(register_info_fields.contains(item.getKey()) == false) {
                continue;
            }
            args += item.getKey();
            updates += item.getKey() + " = ";

            String[] val = item.getValue();
            if (val.length == 0) {
                vals += "null";
                updates += "null";
            } else {
                vals += "\'" + val[0] + "\'";
                updates += "\'" + val[0] + "\'";
            }
            if (it.hasNext()) {
                vals += ",";
                args += ",";
                updates += ",";
            }
        }

        /**
         * If the invalid field name is at the last position,
         * it will append an extra comma ',' to the end of the query
         * string.
         * So we need to drop the comma.
         */
        args = args.trim();
        while (args.endsWith(",")) {
            args = args.substring(0, args.length()-1);
        }

        vals = vals.trim();
        while (vals.endsWith(",")) {
            vals = vals.substring(0, vals.length()-1);
        }

        updates = updates.trim();
        while (updates.endsWith(",")) {
            updates = updates.substring(0, updates.length()-1);
        }

        /**
         * Set the createTime and updateTime in the table register_info.
         */
        args += ",createTime";
        vals += ",\'" + LoggingProxy.getTimeStamp() +"\'";
        updates += ",updateTime=\'" + LoggingProxy.getTimeStamp()+"\'";

        /**
         * Add all the components together.
         */
        query += args + ")";
        query += " VALUES (";
        query += vals + ") ON DUPLICATE KEY UPDATE ";
        query += updates + ";";

        return query;
    }