|
@@ -97,4 +97,27 @@
|
|
|
order by company_org_id
|
|
|
</select>
|
|
|
|
|
|
+ <!--App总览-生产-售水量(本月,本年)-->
|
|
|
+ <select id="selectOverviewRevenue" resultType="com.huaxu.dto.MonthRevenueDto">
|
|
|
+ select date_format(t1.collect_date, '%Y-%m' ) collect_date_string,sum(METER_READING_USAGE) meter_reading_usage
|
|
|
+ from sms_month_revenue t1
|
|
|
+ where t1.collect_date>=date_sub(date_format(curdate(), '%y-%m-1' ), interval #{months}-1 month)
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and t1.tenant_id=#{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="companyOrgId != null and companyOrgId !=''">
|
|
|
+ and t1.company_org_id=#{companyOrgId}
|
|
|
+ </if>
|
|
|
+ <if test="userType!=null and userType!=-999 and userType!=-9999 and programItems != null and programItems.size() > 0">
|
|
|
+ <if test="permissonType == 5 or permissonType == 2 or permissonType == 1">
|
|
|
+ and t1.company_org_id in
|
|
|
+ <foreach collection="programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ group by collect_date_string
|
|
|
+ order by collect_date_string
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|