|
@@ -85,4 +85,24 @@
|
|
|
where a.`STATUS`=1
|
|
|
<if test="tenantId != null and tenantId != ''">and a.TENANT_ID = #{tenantId}</if>
|
|
|
</select>
|
|
|
+ <select id="selectMapDataForSingleCompany" resultType="com.huaxu.dto.ComdisplayInfoDto">
|
|
|
+ select a.COMPANY_ORG_ID as 'companyOrgId',a.POINT_LEFT as 'pointLeft',
|
|
|
+ a.POINT_TOP as 'pointTop',e.meterReadingArrivalRate,e.receivableTotalAmount,
|
|
|
+ e.receivedTotalAmount,e.userMeterCount,e.waterUsage
|
|
|
+ from sms_comdisplay_map_location a
|
|
|
+ left join (select c.company_org_id,c.USER_METER_COUNT as 'userMeterCount',c.METER_READING_ARRIVAL_RATE as 'meterReadingArrivalRate',
|
|
|
+ c.RECEIVABLE_TOTAL_AMOUNT as 'receivableTotalAmount',c.RECEIVED_TOTAL_AMOUNT as 'receivedTotalAmount',
|
|
|
+ c.METER_READING_USAGE as 'waterUsage'
|
|
|
+ from sms_month_revenue c
|
|
|
+ inner join (select b.company_org_id,max(b.collect_date) as collect_date
|
|
|
+ from sms_month_revenue b
|
|
|
+ <if test="tenantId != null and tenantId != ''">where b.TENANT_ID = #{tenantId}</if>
|
|
|
+ group by b.company_org_id ) d
|
|
|
+ on c.company_org_id=d.company_org_id and c.collect_date=d.collect_date
|
|
|
+ <if test="tenantId != null and tenantId != ''">where c.TENANT_ID = #{tenantId}</if>
|
|
|
+ ) e on a.COMPANY_ORG_ID=e.company_org_id
|
|
|
+ where a.`STATUS`=1
|
|
|
+ <if test="tenantId != null and tenantId != ''">and a.TENANT_ID = #{tenantId}</if>
|
|
|
+ <if test="companyOrgId != null and companyOrgId != ''">and a.COMPANY_ORG_ID = #{companyOrgId}</if>
|
|
|
+ </select>
|
|
|
</mapper>
|