首页 > 其他分享 >根据多个字段进行分组

根据多个字段进行分组

时间:2022-09-20 15:47:31浏览次数:56  
标签:Ep 多个 根据 region collectTime mark 分组 null id

<select id="findAllEnergyConsumerStatistics" resultType="com.cars.ict.collector.entity.EnergyDailyStatistics">
SELECT
"" AS id,
IF ( e.device_type != "水表", "Ep", "Wu" ) AS mark,
e.device_type,
"" AS s_region,
sum( e.difference_Value ) AS each_total,
s_station_long_code AS DEPTCODE_KYZ
FROM energy_consumer_statistics e
LEFT JOIN b_station_dict b ON e.s_station_code = b.s_station_telecode
WHERE e.device_type != "水表"
GROUP BY e.device_type,e.s_station_code
</select>



[{id=, mark=Ep, deviceType=其他, region=null, eachTotal=155.91, deptcodeKyz=00N0000000000000000000000000000000BaDongBei007382, collectTime=null}, {id=, mark=Ep, deviceType=其他, region=null, eachTotal=74.2, deptcodeKyz=00N00000000000000000000000000000BaoKangXian007379, collectTime=null},
{id=, mark=Ep, deviceType=其他, region=null, eachTotal=28238.02, deptcodeKyz=00N00000000000000000000000000000000XingShan007381, collectTime=null}, {id=, mark=Ep, deviceType=其他, region=null, eachTotal=1668.18, deptcodeKyz=00N00000000000000000000000000000000NanZhang007378, collectTime=null}, {id=, mark=Ep, deviceType=其他, region=null, eachTotal=3395.72, deptcodeKyz=00N00000000000000000000000000000ShenNongJia007380, collectTime=null},
{id=, mark=Ep, deviceType=客服, region=null, eachTotal=80.24, deptcodeKyz=00N0000000000000000000000000000000BaDongBei007382, collectTime=null}, {id=, mark=Ep, deviceType=客服, region=null, eachTotal=12163.46, deptcodeKyz=00N00000000000000000000000000000BaoKangXian007379, collectTime=null}, {id=, mark=Ep, deviceType=客服, region=null, eachTotal=100.76, deptcodeKyz=00N00000000000000000000000000000000XingShan007381, collectTime=null},
 {id=, mark=Ep, deviceType=客服, region=null, eachTotal=20069.66, deptcodeKyz=00N00000000000000000000000000000000NanZhang007378, collectTime=null}, {id=, mark=Ep, deviceType=照明, region=null, eachTotal=492.2, deptcodeKyz=00N0000000000000000000000000000000BaDongBei007382, collectTime=null}, {id=, mark=Ep, deviceType=照明, region=null, eachTotal=3966.43, deptcodeKyz=00N00000000000000000000000000000BaoKangXian007379, collectTime=null},
 {id=, mark=Ep, deviceType=照明, region=null, eachTotal=6568.85, deptcodeKyz=00N00000000000000000000000000000000XingShan007381, collectTime=null}, {id=, mark=Ep, deviceType=照明, region=null, eachTotal=2694.88, deptcodeKyz=00N00000000000000000000000000000000NanZhang007378, collectTime=null}, {id=, mark=Ep, deviceType=照明, region=null, eachTotal=2994.23, deptcodeKyz=00N00000000000000000000000000000ShenNongJia007380, collectTime=null},
{id=, mark=Ep, deviceType=电梯, region=null, eachTotal=244.95, deptcodeKyz=00N0000000000000000000000000000000BaDongBei007382, collectTime=null}, {id=, mark=Ep, deviceType=电梯, region=null, eachTotal=1620.14, deptcodeKyz=00N00000000000000000000000000000BaoKangXian007379, collectTime=null}, {id=, mark=Ep, deviceType=电梯, region=null, eachTotal=3532.69, deptcodeKyz=00N00000000000000000000000000000000XingShan007381, collectTime=null},
{id=, mark=Ep, deviceType=电梯, region=null, eachTotal=848.42, deptcodeKyz=00N00000000000000000000000000000000NanZhang007378, collectTime=null}, {id=, mark=Ep, deviceType=电梯, region=null, eachTotal=600.86, deptcodeKyz=00N00000000000000000000000000000ShenNongJia007380, collectTime=null}, {id=, mark=Ep, deviceType=空调, region=null, eachTotal=2661.39, deptcodeKyz=00N0000000000000000000000000000000BaDongBei007382, collectTime=null},
{id=, mark=Ep, deviceType=空调, region=null, eachTotal=26539.12, deptcodeKyz=00N00000000000000000000000000000BaoKangXian007379, collectTime=null},
{id=, mark=Ep, deviceType=空调, region=null, eachTotal=125228.14, deptcodeKyz=00N00000000000000000000000000000000XingShan007381, collectTime=null},
{id=, mark=Ep, deviceType=空调, region=null, eachTotal=135609.52, deptcodeKyz=00N00000000000000000000000000000000NanZhang007378, collectTime=null},
{id=, mark=Ep, deviceType=空调, region=null, eachTotal=5605.5, deptcodeKyz=00N00000000000000000000000000000ShenNongJia007380, collectTime=null}]


标签:Ep,多个,根据,region,collectTime,mark,分组,null,id
From: https://www.cnblogs.com/sensenh/p/16711253.html

相关文章