-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueries.json
36 lines (24 loc) · 22.4 KB
/
queries.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"queries":{
"count":"select count(id) as count,sum(budget) as totalbudget, (select count(id) from project where manager_id={USERID} and status > 0 and companyid = {CID}) as managercount, (select count(id) from project where owner_id={USERID} and status > 0 and companyid = {CID}) as ownercount, (select count(id) from project p where stage=4 and closureworkflowstatus!=4 and status>0 and companyid={CID} and ({CONDITION})) as pendingclosureprojectcount from project p where status > 0 and companyid = {CID} and ({CONDITION})",
"projectAndReport":"SELECT {LISTCOUNT} p.id as projectid, p.lastupdatedreportid AS reportid, p.projectname, p.description, p.problemstatement, p.projectboardid, p.scopedetail, p.projectstatus, p.driverforchange, p.budget, p.actualbudget, p.ytdbudget, p.start_date, p.end_date, p.actual_start_date, p.actual_end_date, p.forecast_start_date, p.forecast_end_date, p.totalftecount, p.projectbackground, p.stage AS stagenumber, ( SELECT contents FROM bomstatus WHERE lov_name = 'project_stage' AND value=p.stage) AS stage, p.closureworkflowstatus, ( SELECT trim(personfirstname+' '+personlastname) FROM user_loginusertable u WHERE u.userid = p.manager_id) AS projectmanager, p.manager_id, ( SELECT trim(personfirstname+' '+personlastname) FROM user_loginusertable u WHERE u.userid = p.owner_id) AS projectowner, p.owner_id, ( SELECT trim(personfirstname+' '+personlastname) FROM user_loginusertable u WHERE u.userid = p.benefitsmanagerid) AS benefitsmanager, p.benefitsmanagerid, ( SELECT trim(personfirstname+' '+personlastname) FROM user_loginusertable u WHERE u.userid = p.projectdirector) AS projectdirector, p.projectdirector, ( SELECT trim(personfirstname+' '+personlastname) FROM user_loginusertable u WHERE u.userid = p.pmoresponsibleid) AS projectpmo, p.pmoresponsibleid , ( SELECT email FROM user_loginusertable u WHERE u.userid = p.manager_id) AS projectmanageremail, ( SELECT email FROM user_loginusertable u WHERE u.userid = p.owner_id) AS projectowneremail, ( SELECT email FROM user_loginusertable u WHERE u.userid = p.benefitsmanagerid) AS benefitsmanageremail, ( SELECT email FROM user_loginusertable u WHERE u.userid = p.projectdirector) AS projectdirectoremail, ( SELECT email FROM user_loginusertable u WHERE u.userid = p.pmoresponsibleid) AS projectpmoemail, ( SELECT divisionname FROM division d WHERE d.id = p.divisionid AND status>0) AS division, ( SELECT branchname FROM branch d WHERE d.branchid = p.branchid AND status>0) AS branch, ( SELECT NAME FROM section s WHERE s.id = p.sectionid AND status>0) AS section, ( SELECT NAME FROM projectconfiguration pc WHERE pc.configurationtype = 'tier' AND pc.id = p.projecttierid) AS tier, isnull( ( SELECT TOP 1 milestonename FROM projectmilestone pm WHERE pm.status > 0 AND pm.duedate>getdate() AND pm.projectid = p.id ORDER BY pm.duedate ) ,'Not Available') AS nextmilestone, isnull(CONVERT(varchar(20), ( SELECT TOP 1 duedate FROM projectmilestone pm WHERE pm.status > 0 AND pm.duedate>getdate() AND pm.projectid = p.id ORDER BY pm.duedate ),103) ,'Not Available') AS nextmilestoneduedate, ( SELECT count(id) FROM project WHERE projectboardid = p.id AND status>0 AND entitytype=2 AND companyid={CID} AND ( closureworkflowstatus IS NULL OR closureworkflowstatus!=4)) AS projectinprogramcount, ( SELECT projectname FROM project pg WHERE pg.id=p.projectboardid) AS programname, ( SELECT count(id) FROM product WHERE status>0 AND percentage=100 AND id IN ( SELECT productid FROM projectproduct WHERE projectid=p.id)) AS completedproductcount, ( SELECT count(id) FROM product WHERE id IN ( SELECT productid FROM projectproduct WHERE status>0 AND projectid=p.id)) AS productcount, ( SELECT count(entityid) FROM riskregister rr WHERE rr.entitytype = 2 AND rr.status>0 AND rr.riskstatus=1 AND rr.entityid = p.id) AS riskcount, ( SELECT count(entityid) FROM riskregister rr WHERE rr.entitytype = 2 AND rr.status>0 AND rr.riskstatus=1 AND rr.entityid = p.id AND rr.actualriskratingmatrixid IN ( SELECT rm.id FROM riskmatrix rm WHERE rm.levelname IN ('HIGH'))) AS highriskcount, ( SELECT count(entityid) FROM riskregister rr WHERE rr.entitytype = 2 AND rr.riskstatus=1 AND rr.status>0 AND rr.entityid = p.id AND rr.actualriskratingmatrixid IN ( SELECT rm.id FROM riskmatrix rm WHERE rm.levelname IN ('LOW'))) AS lowriskcount, ( SELECT count(entityid) FROM riskregister rr WHERE rr.entitytype = 2 AND rr.status>0 AND rr.riskstatus=1 AND rr.entityid = p.id AND rr.actualriskratingmatrixid IN ( SELECT rm.id FROM riskmatrix rm WHERE rm.levelname IN ('EXTREME', 'VERY HIGH'))) AS extremeriskcount, ( SELECT count(entityid) FROM riskregister rr WHERE rr.entitytype = 2 AND rr.status>0 AND rr.riskstatus=1 AND rr.entityid = p.id AND rr.actualriskratingmatrixid IN ( SELECT rm.id FROM riskmatrix rm WHERE rm.levelname IN ('MEDIUM', 'MODERATE'))) AS mediumriskcount, ( SELECT count(entityid) FROM issueregister ir WHERE ir.entitytype = 2 AND ir.status>0 AND ir.entityid=p.id) AS issuecount, ( SELECT count(id) FROM mapping map WHERE map.mappingtype='ProjectDependency' AND map.status = 1 AND map.companyid={CID} AND ( map.entityid=p.id OR map.mappingentityid=p.id) AND map.entityid IN ( SELECT p.id FROM project p WHERE p.status>0 AND p.companyid={CID}) AND map.mappingentityid IN ( SELECT p.id FROM project p WHERE p.status>0 AND p.companyid={CID})) AS dependentprojectcount, psr.intervalstartdate, psr.intervalenddate, psr.programmanagername, psr.nextactivityplanned, psr.previousreportingachievements, psr.overallstatus, psr.overallstatussummary, psr.financestatus, psr.financestatussummary, psr.schedulestatus, psr.schedulestatussummary, psr.scopestatus, psr.scopestatussummary, psr.resourcestatus, psr.resourcestatussummary, psr.riskstatus, psr.riskstatussummary, psr.issuestatus, psr.issuestatussummary, psr.reportstatus, ( CASE WHEN (SELECT reportingfrequencyid FROM project AS p WHERE p.id = psr.projectid) = 1 THEN 7 + intervalenddate WHEN (SELECT reportingfrequencyid FROM project AS p WHERE p.id = psr.projectid) = 2 THEN 14 + intervalenddate WHEN (SELECT reportingfrequencyid FROM project AS p WHERE p.id = psr.projectid) = 3 THEN Day(Eomonth(Dateadd(month, Datediff(month, -1, Getdate())-1, -1))) + intervalenddate WHEN (SELECT reportingfrequencyid FROM project AS p WHERE p.id = psr.projectid) = 4 THEN 90 + intervalenddate ELSE 90 + intervalenddate END ) AS reportduedate, ( CASE WHEN (SELECT reportingfrequencyid FROM project AS p WHERE p.id = psr.projectid) = 1 THEN Datediff(day, 7 + intervalenddate, Getdate()) WHEN (SELECT reportingfrequencyid FROM project AS p WHERE p.id = psr.projectid) = 2 THEN Datediff(day, 14 + intervalenddate, Getdate()) WHEN (SELECT reportingfrequencyid FROM project AS p WHERE p.id = psr.projectid) = 3 THEN Datediff(day, Day(Eomonth(Dateadd(month, Datediff(month, -1, Getdate( ))-1, -1) )) + intervalenddate, Getdate()) WHEN (SELECT reportingfrequencyid FROM project AS p WHERE p.id = psr.projectid) = 4 THEN Datediff(day, 90 + intervalenddate, Getdate()) ELSE Datediff(day, 90 + intervalenddate, Getdate()) END ) AS duedaysforreport FROM project p left join projectstatusreport psr on p.LastUpdatedReportID=psr.ProjectStatusReportID WHERE p.status > 0 AND p.companyid = {CID} AND ({CONDITION})",
"project":"select {LISTCOUNT} id as projectid,lastupdatedreportid as reportid,projectname,description,problemstatement,projectboardid,scopedetail,projectstatus,driverforchange,budget,actualbudget, ytdbudget,start_date, end_date,actual_start_date,actual_end_date,forecast_start_date,forecast_end_date,totalftecount,projectbackground,stage as stagenumber, (select contents from bomstatus where lov_name = 'project_stage' and value=p.stage) as stage, closureworkflowstatus, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = p.manager_id) as projectmanager, manager_id, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = p.owner_id) as projectowner, owner_id, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = p.benefitsmanagerid) as benefitsmanager, benefitsmanagerid, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = p.projectdirector) as projectdirector, projectdirector, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = p.pmoresponsibleid) as projectpmo, pmoresponsibleid , (select email from user_loginusertable u where u.userid = p.manager_id) as projectmanageremail, (select email from user_loginusertable u where u.userid = p.owner_id) as projectowneremail, (select email from user_loginusertable u where u.userid = p.benefitsmanagerid) as benefitsmanageremail, (select email from user_loginusertable u where u.userid = p.projectdirector) as projectdirectoremail, (select email from user_loginusertable u where u.userid = p.pmoresponsibleid) as projectpmoemail, (select divisionname from division d where d.id = p.divisionid and status>0) as division, (select branchname from branch d where d.branchid = p.branchid and status>0) as branch, (select name from section s where s.id = p.sectionid and status>0) as section, (select name from projectconfiguration pc where pc.configurationtype = 'tier' and pc.id = p.projecttierid) as tier, isnull( ( select top 1 milestonename from projectmilestone pm where pm.status > 0 and pm.duedate>getdate() and pm.projectid = p.id order by pm.duedate ) ,'Not Available') as nextmilestone, isnull(convert(varchar(20),( select top 1 duedate from projectmilestone pm where pm.status > 0 and pm.duedate>getdate() and pm.projectid = p.id order by pm.duedate ),103) ,'Not Available') as nextmilestoneduedate, (select count(id) from project where projectBoardID = p.id and status>0 and entitytype=2 and companyid={CID} and (closureworkflowstatus is null or closureworkflowstatus!=4)) as projectinprogramcount, (select projectname from project pg where pg.id=p.projectboardid) as programname, (select count(id) from product where status>0 and percentage=100 and id in (select productid from projectproduct where projectid=p.id)) as completedproductcount, (select count(id) from product where id in (select productid from projectproduct where status>0 and projectid=p.id)) as productcount, (select count(EntityID) from riskregister rr where rr.entitytype = 2 and rr.status>0 and rr.riskstatus=1 and rr.EntityID = p.id) as riskcount, (select count(EntityID) from riskregister rr where rr.entitytype = 2 and rr.status>0 and rr.riskstatus=1 and rr.EntityID = p.id and rr.actualriskratingmatrixid in (select rm.id from RiskMatrix rm where rm.LevelName in ('HIGH'))) as highriskcount, (select count(EntityID) from riskregister rr where rr.entitytype = 2 and rr.riskstatus=1 and rr.status>0 and rr.EntityID = p.id and rr.actualriskratingmatrixid in (select rm.id from RiskMatrix rm where rm.LevelName in ('LOW'))) as lowriskcount, (select count(EntityID) from riskregister rr where rr.entitytype = 2 and rr.status>0 and rr.riskstatus=1 and rr.EntityID = p.id and rr.actualriskratingmatrixid in (select rm.id from RiskMatrix rm where rm.LevelName in ('EXTREME','VERY HIGH'))) as extremeriskcount, (select count(EntityID) from riskregister rr where rr.entitytype = 2 and rr.status>0 and rr.riskstatus=1 and rr.EntityID = p.id and rr.actualriskratingmatrixid in (select rm.id from RiskMatrix rm where rm.LevelName in ('MEDIUM','MODERATE'))) as mediumriskcount, (select count(EntityID) from issueregister ir where ir.entitytype = 2 and ir.status>0 and ir.Entityid=p.id) as issuecount, (select count(id) from mapping map where map.MappingType='ProjectDependency' and map.status = 1 and map.companyid={CID} and (map.EntityID=p.id or map.MappingEntityID=p.id) and map.entityid in (select p.id from project p where p.status>0 and p.companyid={CID}) and map.MappingEntityID in (select p.id from project p where p.status>0 and p.companyid={CID})) as dependentprojectcount from project p where p.status > 0 and p.companyid = {CID} and ({CONDITION})",
"report":"select projectid, projectstatusreportid, intervalstartdate,intervalenddate, programmanagername, nextactivityplanned, previousreportingachievements, overallstatus, overallstatussummary, financestatus, financestatussummary, schedulestatus, schedulestatussummary, scopestatus, scopestatussummary, resourcestatus,resourcestatussummary, riskstatus, riskstatussummary, issuestatus, issuestatussummary, reportstatus, (CASE WHEN (select ReportingFrequencyID from project as p where p.id=psr.ProjectID) = 1 THEN 7+IntervalEndDate WHEN (select ReportingFrequencyID from project as p where p.id=psr.ProjectID) = 2 THEN 14+IntervalEndDate WHEN (select ReportingFrequencyID from project as p where p.id=psr.ProjectID) = 3 THEN DAY(EOMONTH(DATEADD(MONTH, DATEDIFF(MONTH, -1, GETDATE())-1, -1)))+IntervalEndDate WHEN (select ReportingFrequencyID from project as p where p.id=psr.ProjectID) = 4 THEN 90+IntervalEndDate ELSE 90+IntervalEndDate END) AS reportduedate, (CASE WHEN (select ReportingFrequencyID from project as p where p.id=psr.ProjectID) = 1 THEN DATEDIFF(day,7+IntervalEndDate,GETDATE()) WHEN (select ReportingFrequencyID from project as p where p.id=psr.ProjectID) = 2 THEN DATEDIFF(day,14+IntervalEndDate,GETDATE()) WHEN (select ReportingFrequencyID from project as p where p.id=psr.ProjectID) = 3 THEN DATEDIFF(day,DAY(EOMONTH(DATEADD(MONTH, DATEDIFF(MONTH, -1, GETDATE())-1, -1)))+IntervalEndDate,GETDATE()) WHEN (select ReportingFrequencyID from project as p where p.id=psr.ProjectID) = 4 THEN DATEDIFF(day,90+IntervalEndDate,GETDATE()) ELSE DATEDIFF(day,90+IntervalEndDate,GETDATE()) END) AS duedaysforreport from projectstatusreport psr where psr.projectstatusreportid in ({LASTUPATEDREPORTIDLIST})",
"risk":"select rr.entityid as projectid, rr.riskregisterid, rr.risk, rr.treatment, rr.duedate, (select us.personfirstname+' '+us.personlastname from user_loginusertable us where us.userid = rr.owner) as riskowner, (select rm.consequencename from riskmatrix rm where rm.id=rr.actualriskratingmatrixid) as actualconsequence, ( select rm.levelname from riskmatrix rm where rm.id=rr.actualriskratingmatrixid) as actuallevel, ( select rm.likelihoodname from riskmatrix rm where rm.id=rr.actualriskratingmatrixid) as actuallikelihood, ( select rm.consequencename from riskmatrix rm where rm.id=rr.residualriskratingmatrixid) as residualconsequence,(select rm.levelname from riskmatrix rm where rm.id=rr.residualriskratingmatrixid) as residuallevel, (select rm.likelihoodname from riskmatrix rm where rm.id=rr.residualriskratingmatrixid) as residuallikelihood from riskregister rr where rr.entitytype = 2 and rr.status>0 and rr.riskstatus=1 and rr.entityid in ({PROJECTIDLIST})",
"product":"select id as productid, pp.projectid as projectid, productname, (select producttypename from producttype where producttypeid=type) as producttype, start_date, end_date, budgetcapex,budgetopex, (select percentagecompleted from productintervalreport as pir where pir.productid = pd.id and productintervalreportid in (select lastupdatedreportid from product where status>0 and companyid={CID}) ) as percentage, (select c.name from capability c where c.capabilityid = pd.capabilityid) as capabilityname, (select c.currentmaturity from capability c where c.capabilityid = pd.capabilityid) as currentmaturity, (select c.targetmaturity from capability c where c.capabilityid = pd.capabilityid) as targetmaturity, (select c.priorityid from capability c where c.capabilityid = pd.capabilityid) as capabilitypriority, (select top 1 entityid from mapping where MappingType like '%Project_ToOutput' and status = 1 and MappingEntityID=pd.id) as dependencymappingid from product as pd {CONDITION}",
"issue":"select entityid as projectid,issueregisterid, keyissue as issuename, duedate, CASE priority WHEN 1 THEN 'Low' WHEN 2 THEN 'Medium' WHEN 3 THEN 'High' END as priority, action, (select it.name from issuetype it where it.issuetypeid=iss.issuetypeid) as issuetype from issueregister iss where entitytype=2 and status>0 and entityid in ({PROJECTIDLIST})",
"capability":"select name as capabilityname,currentmaturity,targetmaturity,priorityid from capability where capabilityid in (select mappingentityid from mapping where mappingtype = 'project_to_capability' and entitytype = 2 and entityid in ({PROJECTID}))",
"statusHistory":"select projectid, intervalenddate as reportdate, isnull(overallstatus,0) as overallstatus, isnull(financestatus,0) as financestatus, isnull(schedulestatus,0) as schedulestatus, isnull(scopestatus,0) as scopestatus, isnull(resourcestatus,0) as resourcestatus, isnull(riskstatus,0) as riskstatus, isnull(issuestatus,0) as issuestatus from projectstatusreport where projectid in ({PROJECTID}) and companyid={CID} order by intervalstartdate",
"budgetHistory":"select (actualcapex+actualopex) as actual, (plannedcapex + plannedopex) as planned, (forecastcapex+forecastopex) as forecast, cast(cast(year as char(4)) + right('00' + ltrim(month), 2) + right('00' + ltrim(01), 2) as date) as budgetdate from (select monthlybudgetid, projectid, month, year, companyid, isnull(plannedcapex, 0) as plannedcapex, isnull(plannedopex, 0) as plannedopex, isnull(actualcapex, 0) as actualcapex, isnull(actualopex, 0) as actualopex, isnull(forecastcapex, 0) as forecastcapex, isnull(forecastopex, 0) as forecastopex, cast(cast(year as char(4)) + right('00' + ltrim(month), 2) + right('00' + ltrim(01), 2) as date) as budgetdate from projectmonthlybudget where status > 0 and version = 0 and companyid={CID} and projectid = {PROJECTID} and entitytype=2) as pmb order by budgetdate",
"divisions":"select ID as divisionid, divisionname, objectives, whatwedo, isbusinessplancreated, parentid, riskcontext, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = d.ownerid) as ownerName, ownerid, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = d.riskplanownerid) as riskplanownerName, riskplanownerid, (select count(id) from project p where divisionid = d.id and status>0 and companyid={CID} and (closureworkflowstatus!=4 or closureworkflowstatus is null)) as projectcount from division d where status>0 and companyid={CID} order by projectcount desc",
"userid":"select top 1 userid from user_loginusertable where companyid = {CID} and ({CONDITION})",
"dependentProjects":"select {LISTCOUNT} id as dependencymappingid, mapa.entityid as id, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = (select p.manager_id from project p where p.id = mapa.entityid)) as projectmanager, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = (select p.owner_id from project p where p.id = mapa.entityid)) as projectowner, (select email from user_loginusertable u where u.userid = (select p.manager_id from project p where p.id = mapa.entityid)) as projectmanageremail, (select email from user_loginusertable u where u.userid = (select p.owner_id from project p where p.id = mapa.entityid)) as projectowneremail, (select p.projectname from project p where p.id = mapa.entityid) as projectname, (select p.start_date from project p where p.id = mapa.entityid) as start_date, (select p.end_date from project p where p.id = mapa.entityid) as end_date, (select p.budget from project p where p.id = mapa.entityid) as budget, (select p.actualbudget from project p where p.id = mapa.entityid) as actualbudget, ( select Name from ProjectConfiguration where ConfigurationType='ImpactofDependency' and status = 1 and ProjectConfiguration.ID = ( select MappingEntityID from mapping mapb where mapb.entityid=mapa.ID and status = 1 and mapb.Mappingtype like'%Project_ToImpact' ) ) as dependencyimpact, ( select count(entityid) from mapping mapc where mapc.entityid = mapa.id and status = 1 and mapc.MappingType like '%Project_ToOutput' Group by EntityID ) as dependentoutput, 'Predecessor' as dependencylabel from mapping mapa where MappingType='ProjectDependency' and status = 1 and mappingentityid {PID} and mapa.entityid in (select id from project where status>0 and companyid={CID}) UNION ALL select id as dependencymappingid,mapa.MappingEntityID as projectid, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = (select p.manager_id from project p where p.id = mapa.MappingEntityID)) as projectmanager, (select Trim(personfirstname+' '+personlastname) from user_loginusertable u where u.userid = (select p.owner_id from project p where p.id = mapa.MappingEntityID)) as projectowner, (select email from user_loginusertable u where u.userid = (select p.manager_id from project p where p.id = mapa.MappingEntityID)) as projectmanageremail, (select email from user_loginusertable u where u.userid = (select p.owner_id from project p where p.id = mapa.MappingEntityID)) as projectowneremail, (select p.projectname from project p where p.id = mapa.MappingEntityID) as projectname, (select p.start_date from project p where p.id = mapa.MappingEntityID) as start_date, (select p.end_date from project p where p.id = mapa.MappingEntityID) as end_date, (select p.budget from project p where p.id = mapa.MappingEntityID) as budget, (select p.actualbudget from project p where p.id = mapa.MappingEntityID) as actualbudget, ( select Name from ProjectConfiguration where ConfigurationType='ImpactofDependency' and status = 1 and ProjectConfiguration.ID = ( select MappingEntityID from mapping mapb where mapb.entityid=mapa.ID and status = 1 and mapb.Mappingtype like'%Project_ToImpact' ) ) as dependencyimpact, ( select count(entityid) from mapping mapc where mapc.entityid = mapa.id and status = 1 and mapc.MappingType like '%Project_ToOutput' Group by EntityID ) as dependentoutput, 'Successor' as dependencylabel from mapping mapa where MappingType='ProjectDependency' and status = 1 and EntityID {PID} and mapa.MappingEntityID in (select id from project where status>0 and companyid={CID} and (closureworkflowstatus is null or closureworkflowstatus!=4))"
},
"conditionsForSQL" : {
"GetProjectByID":" p.id in ({PROJECTIDLIST})",
"GetPrograms":" entitytype=10",
"GetProgramsByName":"projectname like '%{NAME}%' and entitytype=10",
"GetProductByProject":"inner join (select projectid,productid,status as ppstatus from projectproduct where status>0 and companyid={CID}) as pp on pd.id = pp.productid and pp.ppstatus > 0 and projectid in ({PROJECTIDLIST})",
"GetProductByMappingID":"inner join (select projectid,productid,status as ppstatus from projectproduct where status>0 and companyid={CID}) as pp on pd.id = pp.productid and pp.ppstatus > 0 and pd.id in (select MappingEntityID from mapping where MappingType like '%Project_ToOutput' and status = 1 and Entityid in ({MAPPINGIDLIST}))"
}
}