1.4.0
Added Server Player Commands section.
This commit is contained in:
1 parent
25a83e7dc5
commit
293be5887a
128 files changed
+2182
-408
No files matched your search
@@ -0,0 +1,70 @@
|
||||
package com.rsscripting.rswarehouse.dao;
|
||||
|
||||
import com.rsscripting.rswarehouse.database.DatabaseManager;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class DiscoveryDAO {
|
||||
|
||||
public static void assignDiscovererIfNull(
|
||||
int inventoryId,
|
||||
String discovererUuid,
|
||||
String discovererName
|
||||
) {
|
||||
|
||||
try (
|
||||
|
||||
Connection connection =
|
||||
DatabaseManager.getConnection()
|
||||
|
||||
) {
|
||||
|
||||
PreparedStatement statement =
|
||||
connection.prepareStatement(
|
||||
"""
|
||||
UPDATE warehouse_inventory
|
||||
SET
|
||||
discoverer_uuid = ?,
|
||||
discoverer_name = ?,
|
||||
discovered_date = ?
|
||||
WHERE
|
||||
id = ?
|
||||
AND
|
||||
discoverer_uuid IS NULL
|
||||
"""
|
||||
);
|
||||
|
||||
statement.setString(
|
||||
1,
|
||||
discovererUuid
|
||||
);
|
||||
|
||||
statement.setString(
|
||||
2,
|
||||
discovererName
|
||||
);
|
||||
|
||||
statement.setString(
|
||||
3,
|
||||
LocalDate.now().toString()
|
||||
);
|
||||
|
||||
statement.setInt(
|
||||
4,
|
||||
inventoryId
|
||||
);
|
||||
|
||||
int updated =
|
||||
statement.executeUpdate();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user