Skip to content
Snippets Groups Projects
Commit 3032c3c4 authored by S.Listl's avatar S.Listl
Browse files

Attribute and Index optimization

parent 813fb966
No related branches found
No related tags found
No related merge requests found
Showing
with 39 additions and 17 deletions
......@@ -5134,7 +5134,7 @@
<name>OFFER</name>
<title>Offer</title>
<icon>VAADIN:CART</icon>
<active v="false" />
<active v="true" />
<idColumn>OFFERID</idColumn>
<titleColumn>TITLECOLUMN</titleColumn>
<descriptionColumn>DESCCOLUMN</descriptionColumn>
......@@ -5147,9 +5147,9 @@
</indexSearchGroup>
<indexSearchGroup>
<name>SALESORDER</name>
<title>Order</title>
<title>Receipt</title>
<icon>VAADIN:DOLLAR</icon>
<active v="false" />
<active v="true" />
<idColumn>SALESORDERID</idColumn>
<titleColumn>TITLECOLUMN</titleColumn>
<descriptionColumn>DESCCOLUMN</descriptionColumn>
......
......@@ -2,9 +2,12 @@ import("system.result");
import("system.vars");
import("system.calendars");
import("system.db");
import("Keyword_lib");
import("Sql_lib");
import("KeywordRegistry_basic");
var sqlQuery, sqlHelper, queryCondition, affectedIds;
queryCondition = "";
if (vars.exists("$local.idvalue")) {
affectedIds = vars.get("$local.idvalue");
queryCondition = "where OFFERID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')";
......@@ -12,9 +15,10 @@ if (vars.exists("$local.idvalue")) {
}
sqlHelper = new SqlMaskingUtils();
sqlQuery = "select OFFERID, "
+ "OFFERCODE as TITLECOLUMN, "
+ sqlHelper.concat(["ORGNAME", "'| Kd-Nr.: '", "CUSTOMERCODE"])
+ " as DESCCOLUMN, OFFERCODE, ORGNAME, CUSTOMERCODE "
+ sqlHelper.concat(["OFFERCODE", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.offerStatus(), "OFFER.STATUS")], " | ")
+ " as TITLECOLUMN, "
+ sqlHelper.concat(["ORGANISATION.NAME", "'| Kd-Nr.: '", "CUSTOMERCODE"])
+ " as DESCCOLUMN, OFFERCODE, ORGANISATION.NAME, CUSTOMERCODE "
+ " from OFFER "
+ " join CONTACT on OFFER.CONTACT_ID = CONTACTID "
+ " join ORGANISATION on ORGANISATIONID = CONTACT.ORGANISATION_ID "
......
......@@ -12,7 +12,7 @@ if (vars.exists("$local.idvalue")) {
}
sqlHelper = new SqlMaskingUtils();
sqlQuery = "select CONTACT.CONTACTID "
+ "," + sqlHelper.concat(["ORGANISATION.NAME", "ORGANISATION.CUSTOMERCODE"])
+ "," + sqlHelper.concat(["ORGANISATION.NAME", "ORGANISATION.CUSTOMERCODE"], " | ")
+ " as TITLECOLUMN "
+ "," + sqlHelper.concat([
sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO"])
......
......@@ -12,7 +12,7 @@ if (vars.exists("$local.idvalue")) {
}
sqlHelper = new SqlMaskingUtils();
sqlQuery = "select CONTACT.CONTACTID "
+ "," + sqlHelper.concat(["PERSON.SALUTATION", "PERSON.FIRSTNAME", "PERSON.LASTNAME", "ORGANISATION.NAME"])
+ "," + sqlHelper.concat(["PERSON.SALUTATION", "PERSON.FIRSTNAME", "PERSON.LASTNAME", "'|'", "ORGANISATION.NAME"])
+ " as TITLECOLUMN "
+ "," + sqlHelper.concat([
sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO"])
......
......@@ -5,6 +5,7 @@ import("system.db");
import("Sql_lib");
var sqlQuery, sqlHelper, queryCondition, affectedIds;
queryCondition = "";
if (vars.exists("$local.idvalue")) {
affectedIds = vars.get("$local.idvalue");
queryCondition = "where OFFERID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')";
......@@ -12,11 +13,11 @@ if (vars.exists("$local.idvalue")) {
}
sqlHelper = new SqlMaskingUtils();
sqlQuery = "select SALESORDERID, "
+ " ORDERCODE as TITLECOLUMN, "
+ sqlHelper.concat(["ORGNAME", "'| Kd-Nr.: '", "CUSTOMERCODE"])
+ " as DESCCOLUMN, ORDERCODE, ORGNAME, CUSTOMERCODE "
+ " SALESORDERCODE as TITLECOLUMN, "
+ sqlHelper.concat(["ORGANISATION.NAME", "'| Kd-Nr.: '", "CUSTOMERCODE"])
+ " as DESCCOLUMN, SALESORDERCODE, ORGANISATION.NAME, CUSTOMERCODE "
+ " from SALESORDER "
+ " join RELATION on SALESORDER.RELATION_ID = RELATIONID "
+ " join ORG on ORGID = RELATION.ORG_ID "
+ queryCondition + " order by ORDERCODE ";
+ " join CONTACT on SALESORDER.CONTACT_ID = CONTACTID "
+ " join ORGANISATION on ORGANISATIONID = CONTACT.ORGANISATION_ID "
+ queryCondition + " order by SALESORDERCODE ";
result.string(sqlQuery);
\ No newline at end of file
......@@ -130,6 +130,7 @@
<title>Superordinate Attribute</title>
<possibleItemsProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attribute_parent_id/possibleItemsProcess.js</possibleItemsProcess>
<groupable v="true" />
<displayValueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attribute_parent_id/displayValueProcess.js</displayValueProcess>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
......@@ -198,6 +199,7 @@
<alias>Data_alias</alias>
<fromClauseProcess>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess>
<conditionProcess>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<orderClauseProcess>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
<linkInformation>
<linkInformation>
<name>14697123-47ee-4ff0-8ab2-2b8d1217f637</name>
......
import("system.vars");
import("system.result");
import("Attribute_lib");
result.string(AttributeUtil.getFullAttributeName(vars.get("$field.ATTRIBUTE_PARENT_ID")));
\ No newline at end of file
import("system.db");
import("system.result");
result.object({
"AB_ATTRIBUTE.ATTRIBUTE_PARENT_ID" : db.ASCENDING
});
\ No newline at end of file
......@@ -38,6 +38,7 @@
<title>Superordinate Attribute</title>
<consumer>AttributeChildren</consumer>
<linkedContext>Attribute</linkedContext>
<searchable v="false" />
<stateProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_parent_id/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_parent_id/displayValueProcess.js</displayValueProcess>
......@@ -122,6 +123,7 @@
<title>Active</title>
<contentType>BOOLEAN</contentType>
<possibleItemsProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_active/possibleItemsProcess.js</possibleItemsProcess>
<groupable v="true" />
<valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_active/valueProcess.js</valueProcess>
</entityField>
<entityConsumer>
......@@ -152,6 +154,7 @@
<name>KEYWORD_CONTAINER</name>
<title>Keyword</title>
<possibleItemsProcess>%aditoprj%/entity/Attribute_entity/entityfields/keyword_container/possibleItemsProcess.js</possibleItemsProcess>
<searchable v="false" />
<state>AUTO</state>
<stateProcess>%aditoprj%/entity/Attribute_entity/entityfields/keyword_container/stateProcess.js</stateProcess>
</entityField>
......
......@@ -27,9 +27,11 @@
</tableViewTemplate>
<treetableViewTemplate>
<name>RelationsTreetable</name>
<parentField>ATTRIBUTE_PARENT_ID</parentField>
<titleField>AB_ATTRIBUTE_ID</titleField>
<descriptionField>ATTRIBUTERELATION_VALUE</descriptionField>
<titleField>valueProxy</titleField>
<defaultGroupFields>
<element>ATTRIBUTE_PARENT_ID</element>
<element>AB_ATTRIBUTE_ID</element>
</defaultGroupFields>
<entityField>#ENTITY</entityField>
</treetableViewTemplate>
</children>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment