分享泛微公司OA系统用于二次开发的sql脚本
本单位用的oa系统就是泛微公司的oa协同办公平台,下面是我对他进行二次开发统计用到的写数据库脚本,只做开发参考使用,对于该系统的二次开发技术交流可以加我q:2050372586
【仪表盘】格式sql编写规则:
? 只支持select语句并且, Select的结果必须为四列一行,且没列值为数值,其中
? 第一个值为最小值
? 第二个值为最大值
? 第三个值为安全值
? 第四个值为当前值
例如 Select ,,,count(id) from hrmresource 【其他图形】格式sql编写规则(饼状、柱状、折线等等)
只支持select语句并且,select的结果必须为两列N(N>=)行,且第二列必须为数值,其中
第一列值为显示项目(分类)名称
第二列值为对应项目(分类)的值 例如 员工数机构 sql:
select top (select subcompanyname from hrmsubcompany where id=subCompanyId1),count(id) As cids from hrmresource group by subCompanyId1 order by cids desc
oracle:
select (select subcompanyname from hrmsubcompany where id=subCompanyId1),count(id) As cids from hrmresource group by subCompanyId1 order by cids desc 合同金额前十机构
select top (select subcompanyname from hrmsubcompany where id=subCompanyId1),floor(sum(price/)) As cids from CRM_Contract where subCompanyId1 is not null group by subCompanyId1 order by cids desc 销售机会金额前十机构
select top (select subcompanyname from hrmsubcompany where id=subCompanyId),floor(sum(preyield/)) As cids from CRM_SellChance group by subCompanyId order by cids desc 耗时前五长流程 sql:
select top (select workflowname from workflow_base where id=workflowid),*avg(convert(float,convert(datetime,lastoperatedate))-convert(float,convert(datetime,createdate))) cids from workflow_requestbase where workflowid> and workflowid!= group by workflowid order by cids desc oracle:
select (select workflowname from workflow_base where id=workflowid),avg(nvl(to_date(lastoperatedate,'yyyy-mm-dd'),to_date(to_char(sysdate,'YYYY-MM-DD'),'yyyy-mm-dd'))-
to_date(createdate,'yyyy-mm-dd')) as cids from workflow_requestbase where workflowid> and workflowid!= and rownum<= group by workflowid order by cids desc 销售机会前十机构
select top (select subcompanyname from hrmsubcompany where id=subCompanyId),count(id) As cids from CRM_SellChance group by subCompanyId order by cids desc 项目统计前十机构 select top (select subcompanyname from hrmsubcompany where id=hrmdepartment.subcompanyid1),count(*) as cid from Prj_ProjectInfo ,hrmdepartment where Prj_ProjectInfo.department=hrmdepartment.id group by hrmdepartment.subcompanyid1 order by cid desc 人员性别统计 select case sex when '' then '男' else '女' end, count(id) as cid from hrmresource group by sex 典型客户前十机构 select top (select provincename from hrmprovince where id=province) ,province,count(id) as cids from CRM_CustomerInfo
where status= and province> group by province order by cids desc 创建文挡前十名统计
sql:
select top (select lastname from hrmresource where id=doccreaterid) ,count(id) as cid from docdetail group by doccreaterid order by cid desc
oracle:
select (select lastname from hrmresource where id=doccreaterid) ,count(id) as cid from docdetail where rownum<= group by doccreaterid order by cid desc 待办事宜数量前十机构统计 slq:
select top (select subcompanyname from hrmsubcompany where id=subcompanyid1),count(requestid) as cid from workflow_currentoperator,hrmresource where hrmresource.id=workflow_currentoperator.userid and isremark in (,,,) and islasttimes= group by subcompanyid1 order by cid desc oracle:
select (select subcompanyname from hrmsubcompany where id=subcompanyid1),count(requestid) as cid from workflow_currentoperator,hrmresource where hrmresource.id=workflow_currentoperator.userid and isremark in (,,,) and islasttimes= and rownum<= group by subcompanyid1 order by cid desc 学历人员分布 oracle:
select (select name from hrmeducationlevel where id=educationlevel) as 学历,count(id) as 人数 from hrmresource where educationlevel != group by educationlevel order by educationlevel desc 办公地点人员分布 oracle:
select (select locationname from hrmlocations where id=locationid) as 办公地点,count(id) as 人数 from hrmresource group by locationid 年龄段人员分布 oracle:
select 年龄段,age1 from( select count(id) age1,'40后' 年龄段 from hrmresource t1 where t1.birthday between '1940-01-01' and '1949-12-31' union select count(id) age1,'50后' 年龄段 from hrmresource t1 where t1.birthday between '1950-01-01' and '1959-12-31' union select count(id) age1,'60后' 年龄段 from hrmresource t1 where t1.birthday between '1960-01-01' and '1969-12-31' union select count(id) age1,'70后' 年龄段 from hrmresource t1 where t1.birthday between '1970-01-01' and '1979-12-31' union select count(id) age1,'80后' 年龄段 from hrmresource t1 where t1.birthday between '1980-01-01' and '1989-12-31' union select count(id) age1,'90后' 年龄段 from hrmresource t1 where t1.birthday between '1990-01-01' and '1999-12-31') order by 年龄段 职务人员分布 sql:
select count(id) as 人数,'总裁' as 职务 from hrmresource where seclevel=
union all select count(id) as 人数,'中心领导' as 职务 from hrmresource where seclevel= or seclevel=
union all select count(id) as 人数,'经理' as 职务 from hrmresource where seclevel=
union all select count(id) as 人数,'副经理' as 职务 from hrmresource where seclevel=
union all select count(id) as 人数,'主管' as 职务 from hrmresource where seclevel=
union all select count(id) as 人数,'普通员工' as 职务 from hrmresource where seclevel=
union all select count(id) as 人数,'实习生' as 职务 from hrmresource where seclevel= oracle:
select 人数,职务 from( select count(id) as 人数,'总裁' as 职务 from hrmresource where seclevel= union all select count(id) as 人数,'中心领导' as 职务 from hrmresource where seclevel= or seclevel= union all select count(id) as 人数,'经理' as 职务 from hrmresource where seclevel= union all select count(id) as 人数,'副经理' as 职务 from hrmresource where seclevel= union all select count(id) as 人数,'主管' as 职务 from hrmresource where seclevel=
union all select count(id) as 人数,'普通员工' as 职务 from hrmresource where seclevel= union all select count(id) as 人数,'实习生' as 职务 from hrmresource where level= ) U8系统-主营业务收入期间图
select case b.iperiod when '' then '一月' when '' then '二月' when '' then '三月' when '' then '四月' when '' then '五月' when '' then '六月' when '' then '七月' when '' then '八月' when '' then '九月' when '' then '十月' when '' then '十一月' when '' then '十二月' end,sum(b.md) as 金额 from fitemss00 as a,GL_accass as b,code as c where a.citemcode=b.citem_id and b.ccode=c.ccode and c.ccode like '6001%' group by iperiod U8系统-主营业务成本期间图
select case b.iperiod when '' then '一月' when '' then '二月' when '' then '三月' when '' then '四月' when '' then '五月' when '' then '六月' when '' then '七月' when '' then '八月' when '' then '九月' when '' then '十月' when '' then '十一月' when '' then '十二月' end,sum(b.md) as 金额 from fitemss00 as a,GL_accass as b,code as c where a.citemcode=b.citem_id and b.ccode=c.ccode and c.ccode like '6401%' group by iperiod U8系统-主营业务利润
select '成本' as 项,sum(md) as 金额 from fitemss00 as a,GL_accass as b,code as c where a.citemcode=b.citem_id and b.ccode=c.ccode and c.ccode like '6401%'
union all
select '收入' as 项,sum(mc) as 金额 from fitemss00 as a,GL_accass as b,code as c where a.citemcode=b.citem_id and b.ccode=c.ccode and c.ccode like '6001%' U8系统-主营业务每月利润表
select '一月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '二月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '三月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '四月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '五月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '六月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '七月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '八月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '九月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '十月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '十一月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 union all select '十二月' as 月份,(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6001%' and iperiod='')-(select sum(b.md) from GL_accass as b,code as c where b.ccode=c.ccode and c.ccode like '6401%' and iperiod='') as 金额 fitemss00 产品
code 科目
fitemss00class 产品分类表
GL_accass 资金表 GL_CashTable 总账现金流量数据表
GL_accvouch 凭证及明细账
Code 会计科目档案
Department 部门基本信息
Person 职员档案
Customer 客户档案
CustomerClass 客户分类档案
Vendor 供应商档案
VendorClass 供应商分类档案
fitemss98 现金流量项目目录
fitemss98class 现金流量分类目录
|
序号 |
查询语句 |
功能 |
|
1 |
Select* from DocDetail where maincategory=17 |
查看通知 |
|
2 |
SELECT * from HrmResource |
查看个人信息 |
|
3 |
select * from workflow_requestbase |
流程申请表 |
|
select * from workflow_requestbase where status='提醒' |
查看会议提醒() |
|
|
4 |
Select * from workflow_currentoperator where userid=606 and isremark =0 (其中userid是用户信息表的账号) |
查看当前待办流程 |
|
select * from workflow_requestbase WHERE requestid in ( Select requestid from workflow_currentoperator where userid=10 and isremark =0 ) |
||
|
5 |
Update workflow_currentoperator |
|
|
6 |
select * from Meeting |
查看会议 |
|
7 |
select * from MeetingRoom |
会议室 |
|
8 |
SELECT a.name,b.lastname,c.lastname,d.name,a.begindate,a.begintime,a.enddate, a.endtime, a.createdate,a.createtime,a.totalmember,a.description,a.requestid FROM Meeting a LEFT JOIN HrmResource b ON a.caller=b.id LEFT JOIN HrmResource c ON a.contacter=c.id LEFT JOIN MeetingRoom d ON a.address=d.id where DateDiff(dd, begindate,getdate())<=14 ORDER BY begindate asc |
14天以后的会议详细查看 |
|
9 |
Where DateDiff(dd,a.createdate,getdate())=0 |
今天的所有数据 |
|
10 |
Where DateDiff(dd,a.createdate,getdate())=1 |
昨天 |
|
11 |
select * from Meeting where DateDiff(dd, begindate,getdate())<=14 ORDER BY begindate desc |
14天内 |
|
12 |
select * from Meeting where DateDiff(mm, createdate,getdate())=0 |
本月申报 |
|
13 |
select * from Meeting where DateDiff(yy, createdate,getdate())=0 |
本年申报 |
|
14 |
HrmDepartment 人力资源部门表 HrmJobGroups 人力资源职务类型表 HrmJobTitles 人力资源岗位表 |
|
|
15 |
select loginid as 工号,lastname as 姓名 from HrmResource where isnull(loginid,'')<>'' |
sql 查询账号不为空的: |
|
16 |
select * from workflow_billfield select * from workflow_base select * from workflow_selectitem |
一下三个表关联起来可以查询到选择项的对应流程 |
分享泛微公司OA系统用于二次开发的sql脚本的更多相关文章
- 泛微e-cology OA系统远程代码执行漏洞及其复现
泛微e-cology OA系统远程代码执行漏洞及其复现 2019年9月19日,泛微e-cology OA系统自带BeanShell组件被爆出存在远程代码执行漏洞.攻击者通过调用BeanShell组件中 ...
- 泛微ecology OA系统在数据库配置信息泄露
漏洞描述 攻击者可通过该漏洞页面直接获取到数据库配置信息,攻击者可通过访问存在漏洞的页面并解密从而获取数据库配置信息,如攻击者可直接访问数据库,则可直接获取用户数据,由于泛微e-cology默认数据库 ...
- 泛微ecology OA系统某接口存在数据库配置信息泄露漏洞
2漏洞详情 攻击者可通过该漏洞页面直接获取到数据库配置信息,攻击者可通过访问存在漏洞的页面并解密从而获取数据库配置信息,如攻击者可直接访问数据库,则可直接获取用户数据,由于泛微e-cology默认数据 ...
- 泛微e-cology OA系统某接口存在数据库配置信息泄露漏洞复现
1.简介(开场废话) 攻击者可通过存在漏洞的页面直接获取到数据库配置信息.如果攻击者可直接访问数据库,则可直接获取用户数据,甚至可以直接控制数据库服务器. 2.影响范围 漏洞涉及范围包括不限于8.0. ...
- 泛微 e-cology OA 前台SQL注入漏洞
0x00概述 该漏洞是由于OA系统的WorkflowCenterTreeData接口在收到用户输入的时候未进行安全过滤,oracle数据库传入恶意SQL语句,导致SQL漏洞. 0x01影响范围 使用o ...
- 泛微E-cology OA /weaver/ 代码执行漏洞
泛微E-cology OA /weaver/代码执行漏洞 泛微e-cology OA Beanshell组件远程代码执行 分析文章:https://dwz.cn/bYtnsKwa http://127 ...
- 【读书笔记】《基于UG NX系统的二次开发》笔记
我有几本二次开发的书,但是从头到尾读下来的却没有几本.有时候遇到困难发帖求助,好不容易得到答案.后来却发现在书上的前几章就有详细介绍.读书笔记不仅是一种记录,更是一种督促自己读书的方法.还有一个原因是 ...
- 泛微 e-cology OA 远程代码执行漏洞复现
0x00 前言 Poc已在github公开,由于环境搭建较为复杂,所以我在空间搜索引擎中找了国外的网站进行复现 如果有想自行搭建环境复现的可以在公众号内回复“泛微环境”即可获取源码及搭建方式 0x01 ...
- 泛微e-cology OA Beanshell组件远程代码执行漏洞复现CNNVD-201909-1041
靶机 影响版本 泛微e-cology<=9.0 https://github.com/jas502n/e-cology 部署 复现 /weaver/bsh.servlet.BshServlet ...
随机推荐
- POJ 1056
#include <iostream> #include <string> #define MAXN 50 using namespace std; struct node { ...
- gephi
http://pan.baidu.com/share/link?shareid=382396&uk=1696102437
- Centos 7 安装 Visual stdio Code
最近微软正式发布了.net code 和asp.net code.尝试了下在linux下.net code和asp.net code使用. 具体怎么使用.net code 和asp.net code ...
- Spring Security构建Rest服务-0100-前言
一.我的前言 这是看慕课网老师讲的SpringSecurity的学习笔记,老师讲的很好,开篇就说到了我的心里,老师说道: 有一定经验的程序员如何提升自己? 1,每天都很忙,但是感觉水平没有提升 2,不 ...
- 全网最详细使用Scrapy时遇到0: UserWarning: You do not have a working installation of the service_identity module: 'cannot import name 'opentype''. Please install it from ..的问题解决(图文详解)
不多说,直接上干货! 但是在运行爬虫程序的时候报错了,如下: D:\Code\PycharmProfessionalCode\study\python_spider\30HoursGetWebCraw ...
- 恶性bug解决,Encoding 1252 data could not be found. Make sure you have correct international codeset assembly installed and enabled
百度是没有的,google了下 这句话的意思是编码1252没找到,确保程序及是国际化格式 发生在我使用unity读取xlsx文件,在编辑器运行正常,但是发布出来不正常,报错 解决方案: 链接:http ...
- 剑指offer63:数据流中的中位数
题目描述: 如何得到一个数据流中的中位数?如果从数据流中读出奇数个数值,那么中位数就是所有数值排序之后位于中间的数值.如果从数据流中读出偶数个数值,那么中位数就是所有数值排序之后中间两个数的平均值. ...
- APP消息推送机制的实现(PUSH)
出于好奇,想了解一下消息推送机制,在网上搜索到了几篇文章,感觉还不错,粘贴下来,等真正用到的时候再仔细研究 以下两篇是关于ios的 1.http://blog.csdn.net/xyxjn/artic ...
- centos install 命令安装 mysql数据库
命令安装mysql就不需要自己去下载解压,超级方便 下载: wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm ...
- mysql中Access denied for user 'root'@'localhost' (using password:YES)错误
此错误主要是由于你的系统曾经装过MYSQL,在重装就会要求输入原来设定的密码 由于输入错误导致 解决办法见 上一篇博客 MYSQL安装时解决要输入current root passwo ...