码迷,mamicode.com
首页 > 数据库 > 详细

Sonar 数据库表关系整理一(续)

时间:2017-09-15 18:53:13      阅读:268      评论:0      收藏:0      [点我收藏+]

标签:网络   created   and   nbsp   sele   str   http   seve   ==   

简介:Sonar平台是目前较为流行的静态代码扫描平台,为了便于使用以及自己二次开发,有必要对它的数据库结构进行学习和理解。

如题,目前网络上搜不到相关内容,只能自己慢慢整理,作为资料,以备查询。

技术分享

 

=========================================================================================

查询某个月被扫描到的最多的规则:
SELECT i.rule_id,r.name AS rulename,COUNT(*) AS COUNT,FROM_UNIXTIME(i.created_at/1000) AS createtime,
r.Priority,i.severity,r.plugin_name FROM issues i
,rules r WHERE i.rule_id = r.id AND FROM_UNIXTIME(i.created_at/1000) <‘2017-09-01‘ AND FROM_UNIXTIME(i.created_at/1000)> ‘2017-08-01‘
GROUP BY i.rule_id ORDER BY COUNT DESC
=========================================================================================
查询所有项目:
SELECT NAME FROM projects WHERE scope=‘PRJ‘
=========================================================================================
查询当月所有问题以及对应的项目名、作者、rule id、严重级别等信息:
SELECT p.name AS projectname,i.rule_id,i.message,i.author_login,FROM_UNIXTIME(i.created_at/1000) AS createtime,
i.severity FROM issues i,projects p
WHERE p.project_uuid=i.project_uuid AND p.scope=‘PRJ‘
AND FROM_UNIXTIME(i.created_at/1000) <‘2017-09-01‘ AND FROM_UNIXTIME(i.created_at/1000)> ‘2017-08-01‘
ORDER BY rule_id DESC
=========================================================================================
作者原创技术文章,转载请注明出处
 

Sonar 数据库表关系整理一(续)

标签:网络   created   and   nbsp   sele   str   http   seve   ==   

原文地址:http://www.cnblogs.com/zishi/p/7527231.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!