微调
This commit is contained in:
@@ -105,12 +105,35 @@
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="selectBySubstationPage" resultType="com.njcn.device.pq.pojo.dto.PollutionGridDiagramDTO">
|
||||
SELECT
|
||||
<!-- SELECT-->
|
||||
<!-- substation_id as id,-->
|
||||
<!-- IF(`pollution_type`=#{typeMapId.I,javaType=string},value,3.14159) as `data`,-->
|
||||
<!-- IF(`pollution_type`=#{typeMapId.V,javaType=string},value,3.14159) as `dataV`-->
|
||||
<!-- FROM-->
|
||||
<!-- r_stat_pollution_substation_m-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="ids != null and ids.size > 0">-->
|
||||
<!-- AND substation_id IN-->
|
||||
<!-- <foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="startTime != null and startTime !=''">-->
|
||||
<!-- AND data_date >= #{startTime}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="endTime != null and endTime != ''">-->
|
||||
<!-- AND data_date <= #{endTime}-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- GROUP BY-->
|
||||
<!-- substation_id-->
|
||||
<!-- ORDER BY `data` DESC,dataV DESC-->
|
||||
select
|
||||
substation_id as id,
|
||||
IF(`pollution_type`=#{typeMapId.I,javaType=string},value,3.14159) as `data`,
|
||||
IF(`pollution_type`=#{typeMapId.V,javaType=string},value,3.14159) as `dataV`
|
||||
FROM
|
||||
r_stat_pollution_substation_m
|
||||
SUM(case when pollution_type = #{typeMapId.I,javaType=string} then value else null end) as data ,
|
||||
SUM(case when pollution_type = #{typeMapId.V,javaType=string} then value else null end) as dataV
|
||||
from
|
||||
r_stat_pollution_substation_m
|
||||
<where>
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND substation_id IN
|
||||
@@ -125,10 +148,7 @@
|
||||
AND data_date <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
group by
|
||||
substation_id
|
||||
ORDER BY `data` DESC,dataV DESC
|
||||
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user