SELECT sum(item_value) as 'value' , data_time as 'date' FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{startDate} and data_time <= #{endDate}
IFNULL(( SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{startDate} and data_time <= #{endDate}),0) as 'value',
IFNULL(( SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{lastMonthStartDate} and data_time <= #{lastMonthEndDate}),0) as 'valueTb',
IFNULL(( SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{lastYearStartDate} and data_time <= #{lastYearEndDate} ),0) as 'valueHb'
IFNULL(( SELECT avg(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{startDate} and data_time <= #{endDate}),0) as 'value',
IFNULL(( SELECT avg(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{lastMonthStartDate} and data_time <= #{lastMonthEndDate}),0) as 'valueTb',
IFNULL(( SELECT avg(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{lastYearStartDate} and data_time <= #{lastYearEndDate} ),0) as 'valueHb'