| | |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | aa.unit_id, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | COALESCE ( MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ), null ) AS ${item.value}, |
| | | </foreach> |
| | |
| | | SELECT |
| | | ni.index_id, |
| | | ei."name" AS "index_name", |
| | | ei.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | |
| | | AND di.data_time >= #{beginTime} |
| | | AND di.data_time <= #{endTime} |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ei.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY aa.index_id, aa.index_name, aa.time_type, aa.order_num |
| | | ORDER BY aa.order_num ASC |
| | | GROUP BY aa.index_id, aa.index_name, aa.unit_id, aa.time_type, aa.order_num |
| | | ORDER BY aa.order_num ASC |
| | | </select> |
| | | |
| | | <select id="getListChart" resultMap="dataItemMap"> |