Merge branch 'main' of http://39.117.244.52:3000/kjs/ERP-node into logistream

This commit is contained in:
dohyeons 2025-11-13 18:07:24 +09:00
commit cb8184735c
2 changed files with 19 additions and 3 deletions

View File

@ -17,6 +17,7 @@ import {
} from "../types/screen";
import { generateId } from "../utils/generateId";
import logger from "../utils/logger";
// 화면 복사 요청 인터페이스
interface CopyScreenRequest {
@ -24,7 +25,7 @@ interface CopyScreenRequest {
screenCode: string;
description?: string;
companyCode: string; // 요청한 사용자의 회사 코드 (인증용)
userId: string;
createdBy?: string; // 생성자 ID
targetCompanyCode?: string; // 복사 대상 회사 코드 (최고 관리자 전용)
}

View File

@ -26,16 +26,31 @@ export interface DataFilterConfig {
*/
export function buildDataFilterWhereClause(
dataFilter: DataFilterConfig | undefined,
tableAlias?: string,
tableAliasOrStartIndex?: string | number,
startParamIndex: number = 1
): { whereClause: string; params: any[] } {
if (!dataFilter || !dataFilter.enabled || !dataFilter.filters || dataFilter.filters.length === 0) {
return { whereClause: "", params: [] };
}
// 파라미터 처리: 첫 번째 파라미터가 숫자면 startParamIndex, 문자열이면 tableAlias
let tableAlias: string | undefined;
let actualStartIndex: number;
if (typeof tableAliasOrStartIndex === "number") {
actualStartIndex = tableAliasOrStartIndex;
tableAlias = undefined;
} else if (typeof tableAliasOrStartIndex === "string") {
tableAlias = tableAliasOrStartIndex;
actualStartIndex = startParamIndex;
} else {
actualStartIndex = startParamIndex;
tableAlias = undefined;
}
const conditions: string[] = [];
const params: any[] = [];
let paramIndex = startParamIndex;
let paramIndex = actualStartIndex;
// 테이블 별칭이 있으면 "alias."를 붙이고, 없으면 그냥 컬럼명만
const getColumnRef = (colName: string) => {