select pr.*, coalesce("allUnits".count, 0) AS "countAllUnits", coalesce("vacantUnits".count, 0) AS "countVacantUnits"
from "Property" as pr
left join (
select "propertyId", COUNT(*) AS count from "Unit" where "propertyId" in (
select id from "Property" where "userId" in (
select id from "User" where "companyId" = 200001
)
) group by "propertyId"
) as "allUnits" ON pr."id" = "allUnits"."propertyId"
left join (
select "propertyId", COUNT(*) AS count from "Unit" where "propertyId" in (
select id from "Property" where "userId" in (
select id from "User" where "companyId" = 200001
)
) group by "propertyId"
) AS "vacantUnits" ON pr."id" = "vacantUnits"."propertyId"
where "userId" in (
select id from "User" where "companyId" = 200001
)
{this.props.imageUrls.map(imageUrl=>
<div key={imageUrl.toString()}
className="col-md-4 image-item backgrounded"
onLoad={this.handleImageChange}
onError={this.handleImageChange}
style ={ { backgroundImage: "url("+imageUrl+")" } }>
</div>
)}
<div key={imageUrl.toString()}
className="col-md-4 image-item backgrounded"
onLoad={this.handleImageChange}
onError={this.handleImageChange}
style ={ { backgroundImage: "url("+imageUrl+")" } }>
<Image key={imageUrl.toString()}
onLoad={this.handleImageChange}
onError={this.handleImageChange}
style ={ { backgroundImage: "url("+imageUrl+")" } }>
seconds=int((pages*s1*s2)/(s1+s2))