@@ -0,0 +1,1870 @@
+package org.orienteer.bpm.camunda.handler;%0A%0Aimport com.orientechnologies.orient.core.metadata.schema.OType;%0Aimport org.camunda.bpm.engine.impl.db.ListQueryParameterObject;%0Aimport org.camunda.bpm.engine.impl.persistence.entity.MeterLogEntity;%0Aimport org.orienteer.bpm.camunda.OPersistenceSession;%0Aimport org.orienteer.core.util.OSchemaHelper;%0A%0Aimport java.util.Date;%0Aimport java.util.Map;%0A%0A/**%0A * Created by kir on 11.07.16.%0A */%0Apublic class MeterLogEntityHandler extends AbstractEntityHandler%3CMeterLogEntity%3E %7B%0A%0A    public MeterLogEntityHandler() %7B%0A        super(%22BPMMeterLog%22);%0A    %7D%0A%0A    @Override%0A    public void applySchema(OSchemaHelper helper) %7B%0A        super.applySchema(helper);%0A%0A        helper.oProperty(%22name%22, OType.STRING, 10)%0A                .oProperty(%22reporter%22, OType.STRING, 20)%0A                .oProperty(%22value%22, OType.INTEGER, 30)%0A                .oProperty(%22timestamp%22, OType.DATETIME, 40);%0A    %7D%0A%0A    @Statement%0A    public Long selectMeterLogSum(OPersistenceSession session, final ListQueryParameterObject params) %7B%0A        Map%3CString, Object%3E map = (Map%3CString, Object%3E) params.getParameter();%0A        String query = %22select SUM(value) from %22 + getSchemaClass() + %22 where%22;%0A        if (map.containsKey(%22name%22) && map.get(%22name%22) != null)%0A            query += %22 and name = %22 + map.get(%22name%22).toString();%0A        if (map.containsKey(%22reporter%22) && map.get(%22reporter%22) != null)%0A            query += %22 and reporter = %22 + map.get(%22reporter%22).toString();%0A        if (map.containsKey(%22startDate%22) && map.get(%22startDate%22) != null)%0A            query += %22 and timestamp %3E %22 + new Date(map.get(%22startDate%22).toString());%0A        if (map.containsKey(%22endDate%22) && map.get(%22endDate%22) != null)%0A            query += %22 and timestamp %3C %22 + new Date(map.get(%22endDate%22).toString());%0A%0A        return Long.valueOf(queryList(session, query).get(0).toString());%0A    %7D%0A%7D%0A

add meter log handler