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

Employee sql fix

parent 9a14a439
No related branches found
No related tags found
No related merge requests found
......@@ -44,11 +44,18 @@ users = users.map(function (user)
var renderer = new ContactTitleRenderer(Contact.createWithColumnPreset(), ContactTitleRenderer.OPTIONS.NoOption);
var selectExpression = renderer.asSql();
var names = db.table(SqlCondition.begin()
.andIn("CONTACT.CONTACTID", contactIds)
.buildSql("select CONTACTID, " + selectExpression + " from CONTACT \n\
left join PERSON on (PERSON.PERSONID = CONTACT.PERSON_ID)")
);
var idsPerPage = 1000;
var names = [];
var select = "select CONTACTID, " + selectExpression + " from CONTACT \n\
left join PERSON on (PERSON.PERSONID = CONTACT.PERSON_ID)";
for (let begin = 0, max = contactIds.length; begin < max; begin += idsPerPage)
{
names = names.concat(db.table(SqlCondition.begin()
.andIn("CONTACT.CONTACTID", contactIds.slice(begin, begin + idsPerPage))
.buildSql(select)
));
}
var nameMap = {};
for (let i = 0, l = names.length; i < l; i++)
nameMap[names[i][0]] = names[i][1];
......
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