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>

转载于:https://www.cnblogs.com/WYTYL/p/10030707.html

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值