1. 程式人生 > >springboot+vue+element:echarts開發遇見問題---後端sql(三)

springboot+vue+element:echarts開發遇見問題---後端sql(三)

<select id="getSumRequestRankingCount"
parameterType="java.lang.String"
resultType="com.linewell.zhzf.api.gateway.gateway.config.log.requestlog.bean.ServiceInvokeRankingDto">

select gs.serId,
gs.count,
gs1.name
<if test="rankingSelect=='request_count'">
from ( select sum(request_count) as count,
</if>
<if test="rankingSelect=='error_count'">
from ( select sum(error_count) as count,
</if>
<if test="rankingSelect=='circuit_count'">
from ( select sum(circuit_count) as count,
</if>
<if test="rankingSelect=='rate_limit_count'">
from ( select sum(rate_limit_count) as count,
</if>

service_id as serId from m_service_request_hour_report
<where>
<if test="rankingSelect=='request_count'">
and request_count !=''
and request_count is not null
and request_count !='0'
</if>
<if test="rankingSelect=='error_count'">
and error_count !=''
and error_count is not null
and error_count !='0'
</if>
<if test="rankingSelect=='circuit_count'">
and circuit_count !=''
and circuit_count is not null
and circuit_count !='0'
</if>
<if test="rankingSelect=='rate_limit_count'">
and rate_limit_count !=''
and rate_limit_count is not null
and rate_limit_count !='0'
</if>
and hour_timestamp &gt; #{beginTime} and hour_timestamp &lt; #{endTime}
</where>
group by service_id) gs
left join g_service_info as gs1 on gs.serId = gs1.id
order by gs.count
<if test="sortord=='asc'">
asc
</if>
<if test="sortord=='desc'">
desc
</if>
limit #{topRow}

</select>