Fixed an ActivityIndex query

This commit is contained in:
Rsl1122 2019-07-19 13:03:01 +03:00
parent ad7f8c5631
commit 4ff86347b0
2 changed files with 14 additions and 4 deletions

View File

@ -202,10 +202,10 @@ public class ActivityIndexQueries {
public void prepare(PreparedStatement statement) throws SQLException { public void prepare(PreparedStatement statement) throws SQLException {
setSelectActivityIndexSQLParameters(statement, 1, threshold, serverUUID, end); setSelectActivityIndexSQLParameters(statement, 1, threshold, serverUUID, end);
setSelectActivityIndexSQLParameters(statement, 12, threshold, serverUUID, start); setSelectActivityIndexSQLParameters(statement, 12, threshold, serverUUID, start);
statement.setDouble(22, ActivityIndex.REGULAR); statement.setDouble(23, ActivityIndex.REGULAR);
statement.setDouble(23, 5.1); statement.setDouble(24, 5.1);
statement.setDouble(24, -0.1); statement.setDouble(25, -0.1);
statement.setDouble(25, ActivityIndex.IRREGULAR); statement.setDouble(26, ActivityIndex.IRREGULAR);
} }
@Override @Override

View File

@ -33,6 +33,7 @@ import com.djrapitops.plan.data.time.WorldTimes;
import com.djrapitops.plan.db.access.Executable; import com.djrapitops.plan.db.access.Executable;
import com.djrapitops.plan.db.access.Query; import com.djrapitops.plan.db.access.Query;
import com.djrapitops.plan.db.access.queries.*; import com.djrapitops.plan.db.access.queries.*;
import com.djrapitops.plan.db.access.queries.analysis.ActivityIndexQueries;
import com.djrapitops.plan.db.access.queries.containers.AllPlayerContainersQuery; import com.djrapitops.plan.db.access.queries.containers.AllPlayerContainersQuery;
import com.djrapitops.plan.db.access.queries.containers.ContainerFetchQueries; import com.djrapitops.plan.db.access.queries.containers.ContainerFetchQueries;
import com.djrapitops.plan.db.access.queries.containers.ServerPlayerContainersQuery; import com.djrapitops.plan.db.access.queries.containers.ServerPlayerContainersQuery;
@ -1392,6 +1393,15 @@ public interface DatabaseTest {
assertEquals(expected.parseHtml(), table.getHtmlTable().parseHtml()); assertEquals(expected.parseHtml(), table.getHtmlTable().parseHtml());
} }
@Test
public void activeTunredInactiveQueryHasAllParametersSet() {
Integer result = db.query(ActivityIndexQueries.countRegularPlayersTurnedInactive(
0, System.currentTimeMillis(), serverUUID,
TimeUnit.HOURS.toMillis(2L)
));
assertNotNull(result);
}
@PluginInfo(name = "ConditionalExtension") @PluginInfo(name = "ConditionalExtension")
class ConditionalExtension implements DataExtension { class ConditionalExtension implements DataExtension {