namespace PayRollDAL.Query.SAPPaySlip
{
///
/// SQL constants for SAP PaySlip DAL queries.
/// Each logical query has two variants:
/// _SQL — SQL Server (UPPERCASE identifiers, ISNULL, YEAR(), unquoted aliases)
/// _PG — PostgreSQL (lowercase identifiers, COALESCE, EXTRACT, double-quoted aliases)
/// The DAL selects the correct variant using login.DatabaseType.
///
public static class SAPPaySlipQB
{
///
/// Retrieves the organization unit code from MORGANIZATIONUNIT by its ID.
/// The returned OrganizationUnitCode is used as the SAP client / mandt number
/// (e.g. "633") when calling the ZPY_PAYSLIP_SRV OData service.
///
/// Parameter: @OrganizationUnitId — maps to LoginDTO.ClientId
///
public const string GET_SAP_CLIENT_CODE_SQL = @"
SELECT ORGANIZATIONUNITCODE AS OrganizationUnitCode
FROM MORGANIZATIONUNIT
WHERE OUID = @OrganizationUnitId";
/// PostgreSQL variant of .
public const string GET_SAP_CLIENT_CODE_PG = @"
SELECT organizationunitcode AS ""OrganizationUnitCode""
FROM morganizationunit
WHERE ouid = @OrganizationUnitId";
}
}