Table of Contents

Work Order Task File Attachment

Table

Database Table Entity On Key 5 Conversions On Key 5 Tables Other Entities stored in same Table
Transaction wm.work_order_task_file_attachment Work Order Task File Attachment ConvertWorkOrderTaskFileAttachmentAttachment
stdRecordFiles

Columns

Property Db Table Db Column Db DataType Nullable Primary Key Joins
WorkOrderTaskId wm.work_order_task_file_attachment work_order_task_id bigint False
WorkOrderTaskTaskCode wm.work_order_task task_code character varying False wm.work_order_task_file_attachment.work_order_task_id = wm.work_order_task.work_order_task_id
WorkOrderTaskTaskDescription wm.work_order_task task_description character varying False wm.work_order_task_file_attachment.work_order_task_id = wm.work_order_task.work_order_task_id
CreatedByUserId wm.work_order_task_file_attachment created_by_user_id bigint False
CreatedByUserCode uam.user code character varying(50) False wm.work_order_task_file_attachment.created_by_user_id = uam.user.user_id
CreatedByUserFullName uam.user full_name character varying(200) False wm.work_order_task_file_attachment.created_by_user_id = uam.user.user_id
CreatedOn wm.work_order_task_file_attachment created_on timestamp without time zone False
FileInfoId dm.file_attachment_store file_attachment_store_id bigint False True wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id
ContentId dm.file_attachment_store file_content_store_identity_id bigint True
ContentFileLocationId system.file_content_store_location file_content_store_location_id bigint False True wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.file_content_store_identity_id = system.file_content_store_identity.file_content_store_identity_id Then
system.file_content_store_identity.location_id = system.file_content_store_location.file_content_store_location_id
ContentFileLocationDescription system.file_content_store_location description text False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.file_content_store_identity_id = system.file_content_store_identity.file_content_store_identity_id Then
system.file_content_store_identity.location_id = system.file_content_store_location.file_content_store_location_id
ContentFileLocationFileLocationType system.file_content_store_location location_type system.file_content_store_location_type False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.file_content_store_identity_id = system.file_content_store_identity.file_content_store_identity_id Then
system.file_content_store_identity.location_id = system.file_content_store_location.file_content_store_location_id
ContentFileLocationOnKeyFileStoreId system.file_content_store_location onkey_file_content_store_id uuid False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.file_content_store_identity_id = system.file_content_store_identity.file_content_store_identity_id Then
system.file_content_store_identity.location_id = system.file_content_store_location.file_content_store_location_id
ContentSizeInBytes system.file_content_store_identity size_in_bytes bigint False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.file_content_store_identity_id = system.file_content_store_identity.file_content_store_identity_id
ContentSizeInKb system.file_content_store_identity size_in_kb numeric(19,4) False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.file_content_store_identity_id = system.file_content_store_identity.file_content_store_identity_id
ContentSizeInMb system.file_content_store_identity size_in_mb numeric(19,4) False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.file_content_store_identity_id = system.file_content_store_identity.file_content_store_identity_id
ContentVersion dm.file_attachment_store content_version integer False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id
EntityType dm.file_attachment_store entity_type system.entity_type False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id
FileCategoryId dm.file_attachment_store category_id bigint True
FileCategoryCode dm.file_attachment_category code character varying(50) False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.category_id = dm.file_attachment_category.file_attachment_category_id
FileCategoryDescription dm.file_attachment_category description text False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.category_id = dm.file_attachment_category.file_attachment_category_id
FileCategoryAutoIsRestricted dm.file_attachment_category auto_is_restricted boolean False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.category_id = dm.file_attachment_category.file_attachment_category_id
FileFullName dm.file_attachment_store file_full_name text False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id
FileName dm.file_attachment_store file_name text False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id
FileTypeId dm.file_attachment_store type_id bigint True
FileTypeExtension dm.file_attachment_file_type extension text False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id Then
dm.file_attachment_store.type_id = dm.file_attachment_file_type.file_attachment_file_type_id
IsRestricted dm.file_attachment_store is_restricted boolean False wm.work_order_task_file_attachment.work_order_task_file_attachment_id = dm.file_attachment_store.file_attachment_store_id
Id wm.work_order_task_file_attachment work_order_task_file_attachment_id bigint False True
IsActive wm.work_order_task_file_attachment is_active boolean False
ModifiedByUserId wm.work_order_task_file_attachment modified_by_user_id bigint False
ModifiedByUserCode uam.user code character varying(50) False wm.work_order_task_file_attachment.modified_by_user_id = uam.user.user_id
ModifiedByUserFullName uam.user full_name character varying(200) False wm.work_order_task_file_attachment.modified_by_user_id = uam.user.user_id
ModifiedOn wm.work_order_task_file_attachment modified_on timestamp without time zone False
PermissionTreeId wm.work_order_task_file_attachment permission_tree_id bigint False
PermissionTreeCode uam.permission_tree code text False wm.work_order_task_file_attachment.permission_tree_id = uam.permission_tree.permission_tree_id
PermissionTreeDescription uam.permission_tree description text True wm.work_order_task_file_attachment.permission_tree_id = uam.permission_tree.permission_tree_id
Version wm.work_order_task_file_attachment version integer False

Enumerations

Mapping 1

Property Property Type Db Column Db Column Type Db Column Values
ContentFileLocationFileLocationType FileContentStoreLocationType location_type system.file_content_store_location_type FileSystem
Database

Mapping 2

Property Property Type Db Column Db Column Type Db Column Values
EntityType EntityType entity_type system.entity_type Alarm
NewAlarm
AlarmExpression
AlarmExpressionTask
AlarmAttribute
AlarmDocument
AlarmType
MonitoringPoint
MonitoringPointBoundEvaluationLog
MonitoringPointParameter
MonitoringPointReading
MonitoringPointTrigger
MonitoringPointTriggerExpression
MonitoringPointTriggerExpressionAlarmType
MonitoringPointTriggerExpressionParameter
MonitoringPointTriggerExpressionEvaluation
MonitoringPointTriggerExpressionEvaluationLog
MonitoringPointType
MonitoringPointTypeParameter
MonitoringPointAttribute
MonitoringPointDocument
AuxiliaryAssetTask
AuxiliaryAssetTaskResource
AuxiliaryAssetTaskSpare
AuxiliaryAssetTaskSubTask
RegularAssetComponent
RegularAssetComponentAttribute
RegularAssetComponentDocument
RegularAssetComponentRuleEvaluationFailure
AssetComponent
PlaceholderAssetComponent
PlaceholderAssetComponentOptionValue
PlaceholderAssetComponentCondition
PlaceholderAssetMeter
PlaceholderAssetComponentRuleEvaluationFailure
RegularAssetCondition
RegularAssetActiveCondition
AssetFmeca
RegularAssetOptionValue
Asset
RegularAssetAttribute
RegularAssetDocument
RegularAssetFileAttachment
PlaceholderAsset
PlaceholderAssetAttribute
PlaceholderAssetDocument
PlaceholderAssetFileAttachment
PlaceholderAssetRuleEvaluationFailure
PlaceholderAssetResponsibility
PlaceholderAssetCondition
PlaceholderAssetActiveCondition
AssetTask
SetAssetTaskSpareWarehouseEntity
RegularAssetTask
RegularAssetTaskRuleEvaluationFailure
RegularAssetTaskAttribute
RegularAssetTaskAuxiliaryTask
RegularAssetTaskFollowUpTask
RegularAssetTaskFollowUpTaskExpression
RegularAssetTaskSuppressedTask
RegularAssetTaskResource
RegularAssetTaskResourceRuleEvaluationFailure
RegularAssetTaskSpare
RegularAssetTaskSpareRuleEvaluationFailure
RegularAssetTaskSubTask
RegularAssetTaskFileAttachment
AuxiliaryAssetTypeTask
AuxiliaryAssetTypeTaskResource
AuxiliaryAssetTypeTaskSpare
AuxiliaryAssetTypeTaskSubTask
RegularAssetTypeComponent
RegularAssetTypeComponentAttribute
RegularAssetTypeComponentDocument
AssetTypeComponent
PlaceholderAssetTypeComponent
PlaceholderAssetTypeComponentCondition
PlaceholderAssetTypeComponentAttribute
PlaceholderAssetTypeComponentDocument
PlaceholderAssetTypeComponentRuleLink
RegularAssetTypeComponentRuleLink
PlaceholderAssetComponentAttribute
PlaceholderAssetComponentDocument
PlaceholderAssetComponentActiveCondition
AssetTypeFmeca
AssetTypeFunction
AssetFunction
AssetFmecaTask
AssetTypeFmecaTask
AssetTypeFolder
RegularAssetTypeOption
AssetType
PlaceholderAssetType
PlaceholderAssetTypeSpare
PlaceholderAssetTypeAttribute
PlaceholderAssetTypeDocument
PlaceholderAssetTypeResponsibility
PlaceholderAssetTypeRuleLink
RegularAssetTypeTask
RegularAssetTypeTaskAttribute
RegularAssetTypeTaskAuxiliaryTask
RegularAssetTypeTaskCondition
RegularAssetTypeTaskDocument
RegularAssetTypeTaskFollowUpTask
RegularAssetTypeTaskFollowUpTaskExpression
AssetTypeTask
AssetTypeTaskResource
AssetTaskResource
AssetTaskSpare
AssetTypeTaskSpare
RegularAssetTypeTaskResource
RegularAssetTypeTaskRuleLink
RegularAssetTypeTaskSpare
RegularAssetTypeTaskSubTask
RegularAssetTypeTaskSuppressedTask
Condition
ConditionType
Event
FailureCause
FailureCauseType
FailureMechanism
FailureMechanismType
FailureMode
FailureModeType
InPlaceAssetMeter
InPlaceAssetAttribute
InPlaceAssetFileAttachment
InPlaceAssetRuleEvaluationFailure
InPlaceAssetResponsibility
InPlaceAssetSpare
InPlaceAssetType
InPlaceAssetTypeResponsibility
InPlaceAssetTypeRuleLink
InPlaceAssetTypeSpare
InPlaceAsset
Option
OptionCategory
RegularAsset
RegularAssetTaskDocument
RegularAssetMeter
RegularAssetResponsibility
RegularAssetMonitoringPointTrigger
RegularAssetSpare
RegularAssetTaskCondition
RegularAssetType
RegularAssetTypeAttribute
RegularAssetTypeDocument
RegularAssetTypeCondition
PlaceholderAssetTypeCondition
RegularAssetTypeRule
RegularAssetTypeResponsibility
RegularAssetTypeMonitoringPointTrigger
RegularAssetTypeSpare
RepairType
Rule
RuleCategory
RuleOption
StandardTask
StandardTaskSpare
StandardTaskSubTask
StandardTaskResource
StandardTaskAttribute
TaskImportance
TaskInterval
TaskIntervalType
TaskRollUpPoint
TypeOfWork
RegularAssetTypeTaskSpareRuleLink
InPlaceAssetTypeAttribute
RegularAssetTypeTaskResourceRuleLink
PlaceholderAssetSpare
RegularAssetMonitoringPointTriggerParameter
AssetSpare
AssetTypeSpare
AssetMeter
AssetConsumption
RegularAssetConsumption
PlaceholderAssetConsumption
InPlaceAssetConsumption
Meter
MeterAttribute
MeterDocument
MeterReading
PredictedMeterReading
TimeLossCategory
TimeLossReason
TimeLossType
Consumable
AcquisitionStatus
AcquisitionType
DocumentFolder
DocumentRecord
DocumentRecordAttribute
FileAttachment
FileAttachmentCategory
FileAttachmentContentHistory
DocumentRecordFileHistory
Costing
CostingBudget
CostCentre
CostCentreAttribute
CostCentreDocument
CostCentreType
CostElement
CostElementAttribute
CostElementDocument
Currency
BudgetTemplate
BudgetTemplateParameter
FinancialYear
FinancialYearPeriod
GeneralLedger
GeneralLedgerAttribute
GeneralLedgerDocument
CurrencyRate
Budget
BudgetParameter
AddressType
Approval
Attribute
AttributeAllowedValue
Calendar
CalendarDay
CalendarException
CalendarDayHour
Classification
ClassificationAllowedValue
EmailType
Language
OperationalRole
OperationalRoleTemplate
OperationalRoleResource
PhoneNumberType
UserOperationalRole
UserOperationalRoleTemplate
UserOperationalRoleResource
TermsAndCondition
TermsAndConditionVersion
TermsAndConditionOperationalRole
UserTermsAndConditionVersion
Location
LocationAttribute
LocationDocument
LocalisationSet
LocalisationKey
LocalisationTranslation
Phrase
PhraseTranslation
PreconfiguredReason
Site
SiteAttribute
SiteDocument
SiteType
Supplier
SupplierFileAttachment
SupplierAttribute
SupplierDocument
SupplierContactAddress
SupplierContactEmail
SupplierContactPhoneNumber
SupplierResource
SupplierTaxRate
UnitOfMeasurement
SiteResource
SiteContactAddress
SiteContactEmail
SiteContactPhoneNumber
ChangeDataTrigger
ChangeDataTriggerOccurrenceLog
ChangeDataTriggerCriteria
NotificationTemplate
ChangeDataTriggerCriteriaParameter
ChangeDataTriggerNotificationEvent
NotificationTemplateParameter
ChangeDataTriggerNotificationEventAttachment
ChangeDataTriggerNotificationEventAttachmentParameter
RequestType
Category
Commodity
MaterialMaster
MaterialMasterAttribute
MaterialMasterDocument
MaterialMasterBin
MaterialMasterSupplier
MaterialMasterLinkWarehouse
StockItem
StockItemFileAttachment
StockItemAttribute
StockItemDocument
StockItemBin
StockItemSupplier
WarehouseAttribute
Warehouse
WarehouseDocument
Requisition
RequisitionFileAttachment
RequisitionStatus
RequisitionStatusChange
RequisitionStatusAttribute
RequisitionStatusDocument
RequisitionStatusChangeHistory
RequisitionItemTransaction
ApprovalRole
RequisitionAttribute
RequisitionDocument
RequisitionTransaction
RequisitionItem
RequisitionItemFileAttachment
UserSiteApprovalRole
ApprovalWorkflow
ApprovalWorkflowExpression
ApprovalWorkflowExpressionApprovalRole
Competency
Resource
ResourceAttribute
ResourceAddress
ResourceClassification
ResourceCompetency
ResourceDocument
ResourceEmail
ResourcePhoneNumber
ResourceTrade
ResourceTradeCompetency
ResourceTradeFinancialRate
Section
SectionAttribute
SectionDocument
SectionTrade
TradeAttribute
TradeDocument
Trade
TradeCompetency
TradeFinancialRate
ResourceContext
ResourceFileAttachment
AssetImportance
RiskConsequence
RiskConsequenceCategory
RiskModel
RiskModelConsequenceCategory
RiskModelImportance
RiskModelProbability
RiskProbability
WorkOrderImportance
WorkOrderStatus
WorkOrderStatusAttribute
WorkOrderStatusDocument
WorkOrderStatusAllowedChange
WorkOrder
WorkOrderStatusChangeHistory
WorkOrderStatusChange
WorkOrderMerge
WorkOrderSplit
WorkOrderMeter
WorkOrderAttribute
WorkOrderDocument
WorkOrderFileAttachment
WorkOrderTaskFileAttachment
WorkOrderTaskSpareFileAttachment
WorkOrderTask
WorkOrderTaskDocument
WorkOrderTaskAdHocCost
WorkOrderMonitoringPoint
WorkOrderTaskMonitoringPoint
WorkOrderTaskSpare
WorkOrderTaskSubTask
WorkOrderTaskResource
WorkOrderTaskResourceUsage
DueTask
DueTaskSuppressor
ProposedWorkOrderBatch
ProposedWorkOrder
ProposedWorkOrderTask
ProposedWorkOrderMeter
WorkOrderMovement
WorkOrderTaskMovement
WorkOrderTaskResourceMovement
WorkOrderTaskSpareMovement
WorkOrderTaskSubTaskMovement
WorkOrderCompleteAllTasksLog
WorkRequest
WorkRequestAttribute
WorkRequestDocument
WorkRequestStatus
WorkRequestStatusChange
WorkRequestStatusChangeHistory
WorkRequestFileAttachment
WorkOrderDowntimeLoss
WorkOrderProgressEvent
WorkOrderProgressEventAllowedChange
WorkOrderProgressLog
ServiceLevelAgreementClassification
ServiceLevelAgreement
ServiceLevelAgreementMeasure
WorkOrderServiceLevelAgreement
WorkOrderServiceLevelAgreementMeasure
ServiceLevelAgreementMeasureTrigger
ServiceLevelAgreementMeasureFieldAssignment
PermissionTree
User
UserAttribute
UserDocument
UserAuthentication
SecurityRole
SecurityRolePermission
UserSecurityRole
UserCustomPermission
UserOption
BackgroundTask
BackgroundTaskStep
ScheduledBackgroundTask
ScheduledJob
UserDefinedField
UserDefinedFieldPredefinedValue
SystemOption
SystemOptionPageLimit
SystemOptionWorkOrderStatus
SystemOptionDefaultStandardTask
SystemOptionWorkOrderStatusTypeOfWork
SystemOptionReferenceDataViewPermission
RecordChange
RecordChangeValue
RecordChangeUser
RecordChangeProperty
NotificationEventOutbox
NotificationEventAttachmentOutbox
NotificationOutbox
NotificationOutboxLog
ChangeDataTriggerCriteriaEvaluation
SystemOptionReportServerEntity
SystemOptionReportServerEntityDefaultReport
TemplateMigrationLog
TemplateMigrationLogIntent
ResourceActionMigrationLog
UserDefinedQuery
ResourceActionCustomisation
TemplateCustomisation
TemplateResource
ClusterSettings
ClusterIdentityProviderSettings
MessageBrokerHost
MessageBrokerTopic
MessageBrokerTopicConsumer
TenantSettings
TenantChangeDataSubscriptionSettings
TenantIdentityProviderSettings
TenantJobSettings
TenantFileContentStoreLocationSettings
TenantFileContentStoreFileTypeGroupSettings
TenantFileContentStoreFileTypeSettings
ClusterFeatureToggle
TenantFeatureToggle
TenantHealthCheck
TenantMachineHealthCheck
ClusterHealthCheck
ClusterMachineHealthCheck
ClusterCapacitySlot
TenantChangeLogCleanupExpressionSettings
ClusterJobSettings

Queries

The list of example Work Order Task File Attachment queries can be interpreted using the following legend:

Legend Description
Primary Table Alias The alias for the wm.work_order_task_file_attachment table in the query
Include References Include (true) or exclude (false) all lookup table joins in the query
Include Permissions Include (true) or exclude (false) the permission table join in the query to enforce or skip row-level security based on the permissions for the user

Query 1

Primary Table Alias Include References Include Permissions
_wotfa False False
SELECT
    _wotfa.work_order_task_id AS "WorkOrderTaskId",
    _wotfa.created_by_user_id AS "CreatedByUserId",
    _wotfa.created_on AS "CreatedOn",
    _fas.file_attachment_store_id AS "FileInfoId",
    _fas.file_content_store_identity_id AS "ContentId",
    _fas.content_version AS "ContentVersion",
    _fas.entity_type AS "EntityType",
    _fas.category_id AS "FileCategoryId",
    _fas.file_full_name AS "FileFullName",
    _fas.file_name AS "FileName",
    _fas.type_id AS "FileTypeId",
    _fas.is_restricted AS "IsRestricted",
    _wotfa.work_order_task_file_attachment_id AS "Id",
    _wotfa.is_active AS "IsActive",
    _wotfa.modified_by_user_id AS "ModifiedByUserId",
    _wotfa.modified_on AS "ModifiedOn",
    _wotfa.permission_tree_id AS "PermissionTreeId",
    _wotfa.version AS "Version"
FROM
    wm.work_order_task_file_attachment _wotfa
    LEFT JOIN dm.file_attachment_store _fas ON _wotfa.work_order_task_file_attachment_id = _fas.file_attachment_store_id


Query 2

Primary Table Alias Include References Include Permissions
_wotfa True False
SELECT
    _wot.work_order_task_id AS "WorkOrderTaskId",
    _wot.task_code AS "WorkOrderTaskTaskCode",
    _wot.task_description AS "WorkOrderTaskTaskDescription",
    _u.user_id AS "CreatedByUserId",
    _u.code AS "CreatedByUserCode",
    _u.full_name AS "CreatedByUserFullName",
    _wotfa.created_on AS "CreatedOn",
    _fas.file_attachment_store_id AS "FileInfoId",
    _fcsi.file_content_store_identity_id AS "ContentId",
    _fcsi.location_id AS "ContentFileLocation",
    _fcsl.file_content_store_location_id AS "ContentFileLocationId",
    _fcsl.description AS "ContentFileLocationDescription",
    _fcsl.location_type AS "ContentFileLocationFileLocationType",
    _fcsl.onkey_file_content_store_id AS "ContentFileLocationOnKeyFileStoreId",
    _fcsi.size_in_bytes AS "ContentSizeInBytes",
    _fcsi.size_in_kb AS "ContentSizeInKb",
    _fcsi.size_in_mb AS "ContentSizeInMb",
    _fas.content_version AS "ContentVersion",
    _fas.entity_type AS "EntityType",
    _fac.file_attachment_category_id AS "FileCategoryId",
    _fac.code AS "FileCategoryCode",
    _fac.description AS "FileCategoryDescription",
    _fac.auto_is_restricted AS "FileCategoryAutoIsRestricted",
    _fas.file_full_name AS "FileFullName",
    _fas.file_name AS "FileName",
    _faft.file_attachment_file_type_id AS "FileTypeId",
    _faft.extension AS "FileTypeExtension",
    _fas.is_restricted AS "IsRestricted",
    _wotfa.work_order_task_file_attachment_id AS "Id",
    _wotfa.is_active AS "IsActive",
    _u1.user_id AS "ModifiedByUserId",
    _u1.code AS "ModifiedByUserCode",
    _u1.full_name AS "ModifiedByUserFullName",
    _wotfa.modified_on AS "ModifiedOn",
    _pt.permission_tree_id AS "PermissionTreeId",
    _pt.code AS "PermissionTreeCode",
    _pt.description AS "PermissionTreeDescription",
    _wotfa.version AS "Version"
FROM
    wm.work_order_task_file_attachment _wotfa
    JOIN wm.work_order_task _wot ON _wotfa.work_order_task_id = _wot.work_order_task_id
    JOIN uam.user _u ON _wotfa.created_by_user_id = _u.user_id
    LEFT JOIN dm.file_attachment_store _fas ON _wotfa.work_order_task_file_attachment_id = _fas.file_attachment_store_id
    LEFT JOIN system.file_content_store_identity _fcsi ON _fas.file_content_store_identity_id = _fcsi.file_content_store_identity_id
    LEFT JOIN system.file_content_store_location _fcsl ON _fcsi.location_id = _fcsl.file_content_store_location_id
    LEFT JOIN dm.file_attachment_category _fac ON _fas.category_id = _fac.file_attachment_category_id
    LEFT JOIN dm.file_attachment_file_type _faft ON _fas.type_id = _faft.file_attachment_file_type_id
    JOIN uam.user _u1 ON _wotfa.modified_by_user_id = _u1.user_id
    JOIN uam.permission_tree _pt ON _wotfa.permission_tree_id = _pt.permission_tree_id


Query 3

Primary Table Alias Include References Include Permissions
_wotfa False True
Parameter Name Data Type Value
@permission_user_id Bigint 500000000000
@permission_id Bigint 110714200
WITH permission_tree_ids AS
(
    SELECT DISTINCT unnest(psd.permission_tree_ids) AS permission_tree_id FROM uam.user_permission up JOIN uam.permission_set_data psd ON up.permission_set_id = psd.permission_set_id WHERE up.user_id = @permission_user_id AND up.permission_id = @permission_id
)
SELECT
    _wotfa.work_order_task_id AS "WorkOrderTaskId",
    _wotfa.created_by_user_id AS "CreatedByUserId",
    _wotfa.created_on AS "CreatedOn",
    _fas.file_attachment_store_id AS "FileInfoId",
    _fas.file_content_store_identity_id AS "ContentId",
    _fas.content_version AS "ContentVersion",
    _fas.entity_type AS "EntityType",
    _fas.category_id AS "FileCategoryId",
    _fas.file_full_name AS "FileFullName",
    _fas.file_name AS "FileName",
    _fas.type_id AS "FileTypeId",
    _fas.is_restricted AS "IsRestricted",
    _wotfa.work_order_task_file_attachment_id AS "Id",
    _wotfa.is_active AS "IsActive",
    _wotfa.modified_by_user_id AS "ModifiedByUserId",
    _wotfa.modified_on AS "ModifiedOn",
    _wotfa.permission_tree_id AS "PermissionTreeId",
    _wotfa.version AS "Version",
    _wotfa.permission_tree_id AS "_wotfa_permission_tree_id"
FROM
    wm.work_order_task_file_attachment _wotfa
    JOIN permission_tree_ids permission_join ON _wotfa.permission_tree_id = permission_join.permission_tree_id
    LEFT JOIN dm.file_attachment_store _fas ON _wotfa.work_order_task_file_attachment_id = _fas.file_attachment_store_id


Query 4

Primary Table Alias Include References Include Permissions
_wotfa True True
Parameter Name Data Type Value
@permission_user_id Bigint 500000000000
@permission_id Bigint 110714200
WITH permission_tree_ids AS
(
    SELECT DISTINCT unnest(psd.permission_tree_ids) AS permission_tree_id FROM uam.user_permission up JOIN uam.permission_set_data psd ON up.permission_set_id = psd.permission_set_id WHERE up.user_id = @permission_user_id AND up.permission_id = @permission_id
)
SELECT
    _wot.work_order_task_id AS "WorkOrderTaskId",
    _wot.task_code AS "WorkOrderTaskTaskCode",
    _wot.task_description AS "WorkOrderTaskTaskDescription",
    _u.user_id AS "CreatedByUserId",
    _u.code AS "CreatedByUserCode",
    _u.full_name AS "CreatedByUserFullName",
    _wotfa.created_on AS "CreatedOn",
    _fas.file_attachment_store_id AS "FileInfoId",
    _fcsi.file_content_store_identity_id AS "ContentId",
    _fcsi.location_id AS "ContentFileLocation",
    _fcsl.file_content_store_location_id AS "ContentFileLocationId",
    _fcsl.description AS "ContentFileLocationDescription",
    _fcsl.location_type AS "ContentFileLocationFileLocationType",
    _fcsl.onkey_file_content_store_id AS "ContentFileLocationOnKeyFileStoreId",
    _fcsi.size_in_bytes AS "ContentSizeInBytes",
    _fcsi.size_in_kb AS "ContentSizeInKb",
    _fcsi.size_in_mb AS "ContentSizeInMb",
    _fas.content_version AS "ContentVersion",
    _fas.entity_type AS "EntityType",
    _fac.file_attachment_category_id AS "FileCategoryId",
    _fac.code AS "FileCategoryCode",
    _fac.description AS "FileCategoryDescription",
    _fac.auto_is_restricted AS "FileCategoryAutoIsRestricted",
    _fas.file_full_name AS "FileFullName",
    _fas.file_name AS "FileName",
    _faft.file_attachment_file_type_id AS "FileTypeId",
    _faft.extension AS "FileTypeExtension",
    _fas.is_restricted AS "IsRestricted",
    _wotfa.work_order_task_file_attachment_id AS "Id",
    _wotfa.is_active AS "IsActive",
    _u1.user_id AS "ModifiedByUserId",
    _u1.code AS "ModifiedByUserCode",
    _u1.full_name AS "ModifiedByUserFullName",
    _wotfa.modified_on AS "ModifiedOn",
    _pt.permission_tree_id AS "PermissionTreeId",
    _pt.code AS "PermissionTreeCode",
    _pt.description AS "PermissionTreeDescription",
    _wotfa.version AS "Version",
    _wotfa.permission_tree_id AS "_wotfa_permission_tree_id",
    _wot.permission_tree_id AS "_wot_permission_tree_id",
    _u.permission_tree_id AS "_u_permission_tree_id",
    _fac.permission_tree_id AS "_fac_permission_tree_id",
    _u1.permission_tree_id AS "_u1_permission_tree_id"
FROM
    wm.work_order_task_file_attachment _wotfa
    JOIN permission_tree_ids permission_join ON _wotfa.permission_tree_id = permission_join.permission_tree_id
    JOIN wm.work_order_task _wot ON _wotfa.work_order_task_id = _wot.work_order_task_id
    JOIN uam.user _u ON _wotfa.created_by_user_id = _u.user_id
    LEFT JOIN dm.file_attachment_store _fas ON _wotfa.work_order_task_file_attachment_id = _fas.file_attachment_store_id
    LEFT JOIN system.file_content_store_identity _fcsi ON _fas.file_content_store_identity_id = _fcsi.file_content_store_identity_id
    LEFT JOIN system.file_content_store_location _fcsl ON _fcsi.location_id = _fcsl.file_content_store_location_id
    LEFT JOIN dm.file_attachment_category _fac ON _fas.category_id = _fac.file_attachment_category_id
    LEFT JOIN dm.file_attachment_file_type _faft ON _fas.type_id = _faft.file_attachment_file_type_id
    JOIN uam.user _u1 ON _wotfa.modified_by_user_id = _u1.user_id
    JOIN uam.permission_tree _pt ON _wotfa.permission_tree_id = _pt.permission_tree_id