<commit_before>package metridoc.gate

import groovy.sql.Sql
import groovy.util.logging.Slf4j
import metridoc.core.Step
import metridoc.core.services.CamelService
import metridoc.core.tools.CamelTool
import metridoc.core.tools.RunnableTool
import metridoc.service.gorm.GormService
import metridoc.utils.DataSourceConfigUtil

import java.sql.*;
import java.text.SimpleDateFormat

@Slf4j
class GateSQLService {
	private static String getAllDoors = '''SELECT door_id AS id, door_name AS name FROM gate_door;'''

	private static String getAllAffiliations = '''SELECT affiliation_id AS id, affiliation_name AS name FROM gate_affiliation;'''

	private static String getAllCenters = '''SELECT center_id AS id, center_name AS name FROM gate_center;'''

	private static String getAllDepartments = '''SELECT department_id AS id, department_name AS name FROM gate_department;'''

	private static String getAllUSCs = '''SELECT USC_id AS id, USC_name AS name FROM gate_USC;'''

	private static String insertDoorStmt = '''INSERT INTO gate_door (door_id, door_name) VALUES (?, ?)''';
	private static String insertAffiliationStmt = '''INSERT INTO gate_affiliation (affiliation_id, affiliation_name) VALUES (?, ?)'''
	private static String insertCenterStmt = '''INSERT INTO gate_center (center_id, center_name) VALUES (?, ?)''';
	private static String insertDepartmentStmt = '''INSERT INTO gate_department (department_id, department_name) VALUES (?, ?)''';
	private static String insertUSCStmt = '''INSERT INTO gate_usc (USC_id, USC_name) VALUES (?, ?)''';

	private static String insertRecordStmt = '''INSERT INTO gate_entry_record (entry_datetime, door, affiliation, center, department, usc, entry_id) VALUES (?, ?, ?, ?, ?, ?, ?)'''

	private static String getMaxIdStmt = '''SELECT max(entry_id) FROM metridoc.gate_entry_record;''';

	private static String deleteEntryRecordsByMonth = '''DELETE FROM gate_entry_record WHERE entry_datetime BETWEEN ? AND ?;'''

	private static Connection conn = null;

	private static String url = "jdbc:mysql://localhost:3306/metridoc";
	private static String driver = "com.mysql.jdbc.Driver";
	private static String userName; 
	private static String password;
	private static int maxId;
	private static Statement stmt;

	private static HashMap<String, Integer> newDoors = [:];<commit_msg>deleted hardcoded value<commit_after>package metridoc.gate

import groovy.sql.Sql
import groovy.util.logging.Slf4j
import metridoc.core.Step
import metridoc.core.services.CamelService
import metridoc.core.tools.CamelTool
import metridoc.core.tools.RunnableTool
import metridoc.service.gorm.GormService
import metridoc.utils.DataSourceConfigUtil

import java.sql.*;
import java.text.SimpleDateFormat

@Slf4j
class GateSQLService {
	private static String getAllDoors = '''SELECT door_id AS id, door_name AS name FROM gate_door;'''

	private static String getAllAffiliations = '''SELECT affiliation_id AS id, affiliation_name AS name FROM gate_affiliation;'''

	private static String getAllCenters = '''SELECT center_id AS id, center_name AS name FROM gate_center;'''

	private static String getAllDepartments = '''SELECT department_id AS id, department_name AS name FROM gate_department;'''

	private static String getAllUSCs = '''SELECT USC_id AS id, USC_name AS name FROM gate_USC;'''

	private static String insertDoorStmt = '''INSERT INTO gate_door (door_id, door_name) VALUES (?, ?)''';
	private static String insertAffiliationStmt = '''INSERT INTO gate_affiliation (affiliation_id, affiliation_name) VALUES (?, ?)'''
	private static String insertCenterStmt = '''INSERT INTO gate_center (center_id, center_name) VALUES (?, ?)''';
	private static String insertDepartmentStmt = '''INSERT INTO gate_department (department_id, department_name) VALUES (?, ?)''';
	private static String insertUSCStmt = '''INSERT INTO gate_usc (USC_id, USC_name) VALUES (?, ?)''';

	private static String insertRecordStmt = '''INSERT INTO gate_entry_record (entry_datetime, door, affiliation, center, department, usc, entry_id) VALUES (?, ?, ?, ?, ?, ?, ?)'''

	private static String getMaxIdStmt = '''SELECT max(entry_id) FROM metridoc.gate_entry_record;''';

	private static String deleteEntryRecordsByMonth = '''DELETE FROM gate_entry_record WHERE entry_datetime BETWEEN ? AND ?;'''

	private static Connection conn = null;

	private static String url;
	private static String driver;
	private static String userName; 
	private static String password;
	private static int maxId;
	private static Statement stmt;

	private static HashMap<String, Integer> newDoors = [:];
{'fraction_non_alphanumeric': 0.10204081632653061, 'fraction_numerical': 0.0017555409260478386, 'mean_word_length': 6.2928, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3523790', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1311, 'n_words': 420}