SETsRefData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `reference_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_reference_data`',IF(refIdsTableISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `reference_data` AS subdata WHERE ',existence_op,' (SELECT 1 FROM `',refIdsTable,'` AS refIdsTable WHERE subdata.value=refIdsTable.id LIMIT 1) AND subdata.status != "REPLACEMENT" UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_reference_data` AS subdata WHERE ',existence_op,' (SELECT 1 FROM `',refIdsTable,'` AS refIdsTable WHERE subdata.value=refIdsTable.id LIMIT 1) AND subdata.status != "REPLACEMENT"')));
SETsRefData=IF(vTextISNULL,
' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `reference_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_reference_data`',
IF(refIdsTableISNULL,
NULL,
CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `reference_data` AS subdata WHERE ',existence_op,' (SELECT 1 FROM `',refIdsTable,'` AS refIdsTable WHERE subdata.value=refIdsTable.id LIMIT 1) AND subdata.status != "REPLACEMENT" UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_reference_data` AS subdata WHERE ',existence_op,' (SELECT 1 FROM `',refIdsTable,'` AS refIdsTable WHERE subdata.value=refIdsTable.id LIMIT 1) AND subdata.status != "REPLACEMENT"')));
SETsDoubleData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT subdata.domain_id, subdata.entity_id, _get_head_iversion(subdata.entity_id) AS _iversion, subdata.property_id FROM `double_data` AS subdata UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_double_data` ',IF(vDoubleISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id), property_id FROM `double_data` AS subdata WHERE ',getDoubleWhereClause(vDouble,unit_sig,vDoubleStdUnit,stdUnit_sig,o),' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_double_data` AS subdata WHERE ',getDoubleWhereClause(vDouble,unit_sig,vDoubleStdUnit,stdUnit_sig,o))));
SETsDoubleData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT subdata.domain_id, subdata.entity_id, _get_head_iversion(subdata.entity_id) AS _iversion, subdata.property_id FROM `double_data` AS subdata UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_double_data` ',IF(vDoubleISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id), property_id FROM `double_data` AS subdata WHERE ',getDoubleWhereClause(vDouble,unit_sig,vDoubleStdUnit,stdUnit_sig,o),' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_double_data` AS subdata WHERE ',getDoubleWhereClause(vDouble,unit_sig,vDoubleStdUnit,stdUnit_sig,o))));
SETsIntData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT subdata.domain_id, subdata.entity_id, _get_head_iversion(subdata.entity_id) AS _iversion, subdata.property_id FROM `integer_data` AS subdata UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_integer_data`',IF(vIntISNULLANDvDoubleStdUnitISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `integer_data` AS subdata WHERE ',getDoubleWhereClause(vInt,unit_sig,vDoubleStdUnit,stdUnit_sig,o),' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_integer_data` AS subdata WHERE ',getDoubleWhereClause(vInt,unit_sig,vDoubleStdUnit,stdUnit_sig,o))));
SETsIntData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT subdata.domain_id, subdata.entity_id, _get_head_iversion(subdata.entity_id) AS _iversion, subdata.property_id FROM `integer_data` AS subdata UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_integer_data`',IF(vIntISNULLANDvDoubleStdUnitISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `integer_data` AS subdata WHERE ',getDoubleWhereClause(vInt,unit_sig,vDoubleStdUnit,stdUnit_sig,o),' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_integer_data` AS subdata WHERE ',getDoubleWhereClause(vInt,unit_sig,vDoubleStdUnit,stdUnit_sig,o))));
SETsDatetimeData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `datetime_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_datetime_data`',IF(vDateTimeISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `datetime_data` AS subdata WHERE ',getDateTimeWhereClause(vDateTime,o),' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_datetime_data` AS subdata WHERE ',getDateTimeWhereClause(vDateTime,o))));
SETsDatetimeData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `datetime_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_datetime_data`',IF(vDateTimeISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `datetime_data` AS subdata WHERE ',getDateTimeWhereClause(vDateTime,o),' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_datetime_data` AS subdata WHERE ',getDateTimeWhereClause(vDateTime,o))));
SETsDateData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `date_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_date_data`',IF(vDateTimeDotNotationISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `date_data` AS subdata WHERE ',getDateWhereClause(vDateTimeDotNotation,o),' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_date_data` AS subdata WHERE ',getDateWhereClause(vDateTimeDotNotation,o))));
SETsDateData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `date_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_date_data`',IF(vDateTimeDotNotationISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `date_data` AS subdata WHERE ',getDateWhereClause(vDateTimeDotNotation,o),' UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_date_data` AS subdata WHERE ',getDateWhereClause(vDateTimeDotNotation,o))));
SETsNullData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `null_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_null_data`',NULL);
SETsNullData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, _get_head_iversion(entity_id) AS _iversion, property_id FROM `null_data` UNION ALL SELECT DISTINCT domain_id, entity_id, _iversion, property_id FROM `archive_null_data`',NULL);
SETsTextData=IF(vTextISNULL,'SELECT DISTINCT domain_id, entity_id, property_id FROM `text_data`',CONCAT('SELECT DISTINCT domain_id, entity_id, property_id FROM `text_data` AS subdata WHERE subdata.value ',o,' ?'));
SETsTextData=IF(vTextISNULL,'SELECT DISTINCT domain_id, entity_id, property_id FROM `text_data`',CONCAT('SELECT DISTINCT domain_id, entity_id, property_id FROM `text_data` AS subdata WHERE subdata.value ',o,' ?'));
SETsNameData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `name_data`',CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `name_data` AS subdata WHERE subdata.value ',o,' ?'));
SETsNameData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `name_data`',CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `name_data` AS subdata WHERE subdata.value ',o,' ?'));
...
@@ -227,7 +232,11 @@ POV_LABEL: BEGIN
...
@@ -227,7 +232,11 @@ POV_LABEL: BEGIN
IFo="!="ANDrefIdsTableISNOTNULLTHEN
IFo="!="ANDrefIdsTableISNOTNULLTHEN
SETexistence_op="NOT EXISTS";
SETexistence_op="NOT EXISTS";
ENDIF;
ENDIF;
SETsRefData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `reference_data`',IF(refIdsTableISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `reference_data` AS subdata WHERE ',existence_op,' (SELECT 1 FROM `',refIdsTable,'` AS refIdsTable WHERE subdata.value=refIdsTable.id LIMIT 1) AND subdata.status != "REPLACEMENT"')));
SETsRefData=IF(vTextISNULL,
' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `reference_data`',
IF(refIdsTableISNULL,
NULL,
CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `reference_data` AS subdata WHERE ',existence_op,' (SELECT 1 FROM `',refIdsTable,'` AS refIdsTable WHERE subdata.value=refIdsTable.id LIMIT 1) AND subdata.status != "REPLACEMENT"')));
SETsDoubleData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT subdata.domain_id, subdata.entity_id, subdata.property_id FROM `double_data` AS subdata',IF(vDoubleISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `double_data` AS subdata WHERE ',getDoubleWhereClause(vDouble,unit_sig,vDoubleStdUnit,stdUnit_sig,o))));
SETsDoubleData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT subdata.domain_id, subdata.entity_id, subdata.property_id FROM `double_data` AS subdata',IF(vDoubleISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `double_data` AS subdata WHERE ',getDoubleWhereClause(vDouble,unit_sig,vDoubleStdUnit,stdUnit_sig,o))));
SETsIntData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT subdata.domain_id, subdata.entity_id, subdata.property_id FROM `integer_data` AS subdata',IF(vIntISNULLANDvDoubleStdUnitISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `integer_data` AS subdata WHERE ',getDoubleWhereClause(vInt,unit_sig,vDoubleStdUnit,stdUnit_sig,o))));
SETsIntData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT subdata.domain_id, subdata.entity_id, subdata.property_id FROM `integer_data` AS subdata',IF(vIntISNULLANDvDoubleStdUnitISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `integer_data` AS subdata WHERE ',getDoubleWhereClause(vInt,unit_sig,vDoubleStdUnit,stdUnit_sig,o))));
SETsDatetimeData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `datetime_data`',IF(vDateTimeISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `datetime_data` AS subdata WHERE ',getDateTimeWhereClause(vDateTime,o))));
SETsDatetimeData=IF(vTextISNULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `datetime_data`',IF(vDateTimeISNULL,NULL,CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `datetime_data` AS subdata WHERE ',getDateTimeWhereClause(vDateTime,o))));