Skip to content

Commit

Permalink
LPD-42641 auto SF
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed Dec 10, 2024
1 parent 6cd91a4 commit 5d687b5
Showing 1 changed file with 33 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public int filterCountF_A_ByG_F_DDMSI_NotS(
int[] excludedStatuses, QueryDefinition<?> queryDefinition) {

return doCountF_A_ByG_F_DDMSI_NotS(
groupId, folderId, ddmStructureId, excludedStatuses, queryDefinition, true);
groupId, folderId, ddmStructureId, excludedStatuses,
queryDefinition, true);
}

@Override
Expand Down Expand Up @@ -159,8 +160,9 @@ public List<JournalFolder> findF_ByNoAssets() {
}

protected int doCountF_A_ByG_F_DDMSI_NotS(
long groupId, long folderId, long ddmStructureId, int[] excludedStatuses,
QueryDefinition<?> queryDefinition, boolean inlineSQLHelper) {
long groupId, long folderId, long ddmStructureId,
int[] excludedStatuses, QueryDefinition<?> queryDefinition,
boolean inlineSQLHelper) {

Session session = null;

Expand Down Expand Up @@ -459,6 +461,32 @@ protected String getDDMStructureId(long ddmStructureId) {
return sb.toString();
}

protected String getExcludedStatuses(
int[] excludedStatuses, String tableName) {

if (ArrayUtil.isEmpty(excludedStatuses)) {
return StringPool.BLANK;
}

StringBundler sb = new StringBundler(5);

sb.append(" and ");
sb.append(tableName);
sb.append(".status not in (");

for (int i = 0; i < excludedStatuses.length; i++) {
sb.append(excludedStatuses[i]);

if (i != (excludedStatuses.length - 1)) {
sb.append(", ");
}
}

sb.append(")");

return sb.toString();
}

protected String getFolderId(long folderId, String tableName) {
if (folderId < 0) {
return StringPool.BLANK;
Expand Down Expand Up @@ -498,34 +526,9 @@ protected String getFoldersSQL(
return sql;
}

protected String getExcludedStatuses(
int[] excludedStatuses, String tableName) {

if (ArrayUtil.isEmpty(excludedStatuses)) {
return StringPool.BLANK;
}

StringBundler sb = new StringBundler(5);

sb.append(" and ");
sb.append(tableName);
sb.append(".status not in (");

for (int i = 0; i < excludedStatuses.length; i++) {
sb.append(excludedStatuses[i]);

if (i != (excludedStatuses.length - 1)) {
sb.append(", ");
}
}

sb.append(")");

return sb.toString();
}

protected String updateSQL(
String sql, long folderId, long ddmStructureId, int[] excludedStatuses) {
String sql, long folderId, long ddmStructureId,
int[] excludedStatuses) {

return StringUtil.replace(
sql,
Expand Down

0 comments on commit 5d687b5

Please sign in to comment.