How to Compare two layer’s object: Get AOT objects both modified in USR & SL1 layer

static void CompareJob(Args _args)
{
    UtilElements utilElements;
    UtilElements_Job utilElementsJob;
    UtilElements_Job utilElementsJob_usr;
    UtilElements_Job utilElementsJob_sl1;
    ;
 
    delete_from utilElementsJob;
    Insert_Recordset utilElementsJob(utilLevel, recordType, parentId, name)
        select utilLevel, recordType, parentId, name from utilElements
            where utilElements.utilLevel == UtilEntryLevel::usr || utilElements.utilLevel == UtilEntryLevel::sl1;
    info("Imported completed!");
 
    while select utilElementsJob_usr join utilElementsJob_sl1
        where utilElementsJob_usr.utilLevel == UtilEntryLevel::usr
        && utilElementsJob_sl1.utilLevel == UtilEntryLevel::sl1
        && utilElementsJob_usr.name == utilElementsJob_sl1.name
        // && utilElementsJob_usr.parentId == 0 && utilElementsJob_sl1.parentId == 0
        &&
        (
            (utilelementsJob_usr.recordType == UtilElementType::Class && utilelementsJob_sl1.recordType == UtilElementType::Class)
            ||
            (utilelementsJob_usr.recordType == UtilElementType::Form && utilelementsJob_sl1.recordType == UtilElementType::Form)
            ||
            (utilelementsJob_usr.recordType == UtilElementType::Table && utilelementsJob_sl1.recordType == UtilElementType::Table)
        )
        {
            info(utilElementsJob_usr.name);
        }
}
How it works:

1. There is one special table in AOT\System Documentation\Tables\UtilElements, firstly, create a similar table UtilElements_Job with those fields: utilLevel(Enum: UtilEntryLevel), recordType(Enum: UtilElementType), parentId(int), name(EDT: Name)

2. import data from UtilElements table into new table UtilElements_Job

Bcs it’s very slow when querying the UtilElements table. (I cannot find the UtilElements table in AOT Data Dictionary tables folder, Maybe it is a system table, a file-based table, or a queried table…)

3. while select…

原文地址:https://www.cnblogs.com/aot/p/1900140.html