List reportList = delegator.findByAnd("UiReport", condition, orderBy);
if ( !partyId.equals("-1")) {
condition = sectionId == null ? UtilMisc.toMap("partyId", partyId) : UtilMisc.toMap("sectionId", sectionId, "partyId", partyId);
EntityCondition c1 = new EntityConditionList( UtilMisc.toList( new EntityExpr("partyId", EntityOperator.EQUALS, partyId),
new EntityConditionList( UtilMisc.toList( new EntityExpr("partyId", EntityOperator.EQUALS, companyId),
new EntityExpr("publicFlag", EntityOperator.EQUALS, "Y")),
EntityOperator.AND)), EntityOperator.OR);
if ( sectionId != null )
c1 = new EntityConditionList( UtilMisc.toList( c1, new EntityExpr("sectionId", EntityOperator.EQUALS, sectionId)), EntityOperator.AND);
if ( reportList == null)
reportList = delegator.findByCondition("UiReport", c1, null, orderBy);
else
reportList.addAll(delegator.findByCondition("UiReport", c1, null, orderBy));