使用sql语句进行分类统计查询示例:
SELECT COUNT(PageName) AS value,
CASE PageNameWHEN '用户登陆' THEN '用户登陆'
WHEN '用户退出' THEN '用户退出 '
WHEN '查看' THEN '查看'
ELSE '其他' END name
FROM t_ba_systemloginfo
WHERE 1=1
<if test="startDate != null" >
And OperationTime <![CDATA[>=]]> #{startDate ,jdbcType=VARCHAR}
</if>
<if test="endDate != null" >
And OperationTime <![CDATA[<=]]> #{endDate,jdbcType=VARCHAR}
</if>
GROUP BY CASE PageName
WHEN '用户登陆' THEN '用户登陆'
WHEN '用户退出' THEN '用户退出 '
WHEN '查看' THEN '查看'
ELSE '其他' END
ORDER BY value DESC