|
@@ -203,7 +203,8 @@ public class BusOrgDaoImpl extends GenericDaoImpl<BusOrg, Long>
|
|
|
// Float v = (float) (1+GR/100);
|
|
|
//通过sql查询增长比例
|
|
|
String v = " (select 1+(growth_ratio/100) from base_org_type o where o.org_type_id = b.org_type_id) ";
|
|
|
- String yearSql = "ROUND((ROUND(SUM(bm.`water`)/count(bm.`water`)) * 12 * "+v+")";
|
|
|
+ String s = " (select count(1) from bus_customer_meter c where c.`org_id` = b.`org_id` and c.`year` = b.`year`) ";
|
|
|
+ String yearSql = "ROUND((ROUND(SUM(bm.`water`)/count(bm.`water`)) * 12 * "+s+" * "+v+")";
|
|
|
String quarterSql = "ROUND("+yearSql+"/4)";
|
|
|
String montherSql = "ROUND("+yearSql+"/12)";
|
|
|
|
|
@@ -246,7 +247,8 @@ public class BusOrgDaoImpl extends GenericDaoImpl<BusOrg, Long>
|
|
|
Date eMonthEndTime) {
|
|
|
//通过sql查询增长比例
|
|
|
String v = " (select 1+(growth_ratio/100) from base_org_type o where o.org_type_id = b.org_type_id ) ";
|
|
|
- String yearSql = "ROUND((ROUND(SUM(bm.`water`)/count(bm.`water`)) * 12 * "+v+")";
|
|
|
+ String s = " (select count(1) from bus_customer_meter c where c.`org_id` = b.`org_id` and c.`year` = b.`year`) ";
|
|
|
+ String yearSql = "ROUND((ROUND(SUM(bm.`water`)/count(bm.`water`)) * 12 * "+s+" * "+v+")";
|
|
|
String quarterSql = "ROUND("+yearSql+"/4)";
|
|
|
String montherSql = "ROUND("+yearSql+"/12)";
|
|
|
String sql =" INSERT INTO `bus_month_assessment` "
|