- 浏览: 343413 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
longgol:
错误地写日志记录到表[orcl192.168.1.7etl]C ...
Job和Trans记录日志到数据表 -
longgol:
我试过java调用ETL执行可成功, kettle客户端配置日 ...
Job和Trans记录日志到数据表 -
longgol:
哥, 你这代码贴的时间够早了哈。
Job和Trans记录日志到数据表 -
cleaneyes:
flyingdonkey 写道cleaneyes 写道性能还不 ...
CAS稳定性测试异常 -
lsjinpeng:
太多了。。。
建议,插件的功能用红色标记下
收集一些基于jQuery框架开发的控件/jquery插件
CREATE OR REPLACE FUNCTION f_get_next_onduty /* 根据科室ID获取下一值班人 */ ( p_id NUMBER --科室ID ) RETURN VARCHAR2 IS l_return VARCHAR2(4000); l_tmp VARCHAR2(200); l_task_type trsdba.watch_monitorteam_record.task_type%TYPE; l_first_processor trsdba.watch_manage.first_processor%TYPE; l_second_processor trsdba.watch_manage.second_processor%TYPE; l_third_processor trsdba.watch_manage.third_processor%TYPE; l_first_processor_name trsdba.wcmuser.username%TYPE; l_second_processor_name trsdba.wcmuser.username%TYPE; l_third_processor_name trsdba.wcmuser.username%TYPE; l_watch_type trsdba.watch_manage.watch_type%TYPE; l_flag1 VARCHAR2(1):='N'; --为Y则代表满足条件 l_flag2 VARCHAR2(1):='N'; l_flag3 VARCHAR2(1):='N'; l_sql VARCHAR2(4000):=''; l_count NUMBER; l_cur_watch_date trsdba.watch_monitorteam_record.watch_date%TYPE; TYPE t_cur IS REF CURSOR; l_cur t_cur; CURSOR l_c IS SELECT NVL(t.first_processor,0), NVL(t.second_processor,0), NVL(t.third_processor,0), t.watch_type FROM trsdba.watch_manage t WHERE TO_DATE(TO_CHAR(t.watch_date,'yyyy-mm-dd')||' '||NVL(t.start_time,'00:00')||':00','yyyy-mm-dd hh24:mi:ss') <= SYSDATE AND TO_DATE(TO_CHAR(t.watch_date,'yyyy-mm-dd')||' '||NVL(t.end_time,'23:59')||':59','yyyy-mm-dd hh24:mi:ss') >= SYSDATE AND TO_CHAR(t.watch_date,'yyyy-mm-dd') = TO_CHAR(SYSDATE,'yyyy-mm-dd') AND t.watch_type <> 1 UNION ALL SELECT NVL(t.first_processor,0), NVL(t.second_processor,0), NVL(t.third_processor,0), t.watch_type FROM trsdba.watch_manage t WHERE TO_CHAR(t.watch_date,'yyyy-mm-dd') = TO_CHAR(SYSDATE,'yyyy-mm-dd') AND t.watch_type = 1; BEGIN IF p_id = 11 THEN --监控管理组 SELECT NVL(COUNT(*),0) INTO l_count FROM trsdba.watch_monitorteam_record t WHERE TO_DATE(TO_CHAR(t.watch_date,'yyyy-mm-dd')||' '||NVL(t.start_time,'00:00')||':00','yyyy-mm-dd hh24:mi:ss') <= SYSDATE AND TO_DATE(TO_CHAR(t.watch_date+decode(task_type,2,1,0),'yyyy-mm-dd')||' '||NVL(t.end_time,'23:59')||':59','yyyy-mm-dd hh24:mi:ss') >= SYSDATE; IF l_count <> 1 THEN l_return:=''; ELSE SELECT NVL(t.task_type,0) INTO l_task_type FROM trsdba.watch_monitorteam_record t WHERE TO_DATE(TO_CHAR(t.watch_date,'yyyy-mm-dd')||' '||NVL(t.start_time,'00:00')||':00','yyyy-mm-dd hh24:mi:ss') <= SYSDATE AND TO_DATE(TO_CHAR(t.watch_date+decode(task_type,2,1,0),'yyyy-mm-dd')||' '||NVL(t.end_time,'23:59')||':59','yyyy-mm-dd hh24:mi:ss') >= SYSDATE ; SELECT t.watch_date INTO l_cur_watch_date FROM trsdba.watch_monitorteam_record t WHERE TO_DATE(TO_CHAR(t.watch_date,'yyyy-mm-dd')||' '||NVL(t.start_time,'00:00')||':00','yyyy-mm-dd hh24:mi:ss') <= SYSDATE AND TO_DATE(TO_CHAR(t.watch_date+decode(task_type,2,1,0),'yyyy-mm-dd')||' '||NVL(t.end_time,'23:59')||':59','yyyy-mm-dd hh24:mi:ss') >= SYSDATE ; IF l_task_type = 0 THEN l_return:=''; ELSIF l_task_type = 1 THEN SELECT NVL(COUNT(*),0) INTO l_count FROM trsdba.watch_monitorteam_record t WHERE t.task_type = 2 AND TO_CHAR(t.watch_date,'yyyy-mm-dd') = TO_CHAR(l_cur_watch_date,'yyyy-mm-dd'); IF l_count = 1 THEN SELECT TO_CHAR(a.userid)||','||a.username INTO l_return FROM trsdba.wcmuser a, trsdba.watch_monitorteam_record b WHERE b.task_type = 2 AND a.userid = b.watch AND TO_CHAR(b.watch_date,'yyyy-mm-dd') = TO_CHAR(l_cur_watch_date,'yyyy-mm-dd'); ELSE l_return:=''; END IF; ELSIF l_task_type = 2 THEN SELECT NVL(COUNT(*),0) INTO l_count FROM trsdba.watch_monitorteam_record t WHERE t.task_type = 1 AND TO_CHAR(t.watch_date,'yyyy-mm-dd') = TO_CHAR(l_cur_watch_date+1,'yyyy-mm-dd'); IF l_count = 1 THEN SELECT TO_CHAR(a.userid)||','||a.username INTO l_return FROM trsdba.wcmuser a, trsdba.watch_monitorteam_record b WHERE b.task_type = 1 AND a.userid = b.watch AND TO_CHAR(b.watch_date,'yyyy-mm-dd') = TO_CHAR(l_cur_watch_date+1,'yyyy-mm-dd'); ELSE l_return:=''; END IF; END IF; END IF; ELSE OPEN l_c; LOOP FETCH l_c INTO l_first_processor,l_second_processor,l_third_processor,l_watch_type; EXIT WHEN l_c%NOTFOUND; IF l_first_processor <> 0 THEN SELECT NVL(COUNT(*),0) INTO l_count FROM trsdba.wcmgrpuser t, trsdba.wcmuser b WHERE t.userid = b.userid AND t.groupid = p_id AND t.userid = l_first_processor; IF l_count = 1 THEN l_flag1:='Y'; ELSE l_flag1:='N'; END IF; END IF; IF l_second_processor <> 0 THEN SELECT NVL(COUNT(*),0) INTO l_count FROM trsdba.wcmgrpuser t, trsdba.wcmuser b WHERE t.userid = b.userid AND t.groupid = p_id AND t.userid = l_second_processor; IF l_count = 1 THEN l_flag2:='Y'; ELSE l_flag2:='N'; END IF; END IF; IF l_third_processor <> 0 THEN SELECT NVL(COUNT(*),0) INTO l_count FROM trsdba.wcmgrpuser t, trsdba.wcmuser b WHERE t.userid = b.userid AND t.groupid = p_id AND t.userid = l_third_processor; IF l_count = 1 THEN l_flag3:='Y'; ELSE l_flag3:='N'; END IF; END IF; IF l_flag1 = 'Y' OR l_flag2 = 'Y' OR l_flag3 = 'Y' THEN IF l_watch_type = 1 THEN l_sql:=' SELECT t.first_processor, t.second_processor, t.third_processor FROM trsdba.watch_manage t WHERE t.watch_type = 1 AND TO_CHAR(t.watch_date,''yyyy-mm-dd'') = TO_CHAR(SYSDATE + 1,''yyyy-mm-dd'')'; ELSIF l_watch_type = 2 THEN l_sql:=' SELECT t.first_processor, t.second_processor, t.third_processor FROM trsdba.watch_manage t WHERE t.watch_type = 3 AND TO_CHAR(t.watch_date,''yyyy-mm-dd'') = TO_CHAR(SYSDATE,''yyyy-mm-dd'')'; ELSIF l_watch_type = 3 THEN l_sql:=' SELECT t.first_processor, t.second_processor, t.third_processor INTO l_first_processor, l_second_processor, l_third_processor FROM trsdba.watch_manage t WHERE t.watch_type = 4 AND TO_CHAR(t.watch_date,''yyyy-mm-dd'') = TO_CHAR(SYSDATE,''yyyy-mm-dd'')'; ELSIF l_watch_type = 4 THEN l_sql:=' SELECT t.first_processor, t.second_processor, t.third_processor INTO l_first_processor, l_second_processor, l_third_processor FROM trsdba.watch_manage t WHERE t.watch_type = 2 AND TO_CHAR(t.watch_date,''yyyy-mm-dd'') = TO_CHAR(SYSDATE + 1,''yyyy-mm-dd'')'; ELSE l_return:='null,null;null,null;null,null'; END IF; IF l_sql IS NOT NULL THEN OPEN l_cur FOR l_sql; LOOP FETCH l_cur INTO l_first_processor,l_second_processor,l_third_processor; EXIT WHEN l_cur%NOTFOUND; SELECT NVL(COUNT(*),'') INTO l_count FROM trsdba.wcmgrpuser t, trsdba.wcmuser b WHERE t.userid = b.userid AND t.groupid = p_id AND b.userid = l_first_processor; IF l_count = 1 THEN SELECT NVL(b.username,'') INTO l_first_processor_name FROM trsdba.wcmgrpuser t, trsdba.wcmuser b WHERE t.userid = b.userid AND t.groupid = p_id AND b.userid = l_first_processor; END IF; SELECT NVL(COUNT(*),'') INTO l_count FROM trsdba.wcmgrpuser t, trsdba.wcmuser b WHERE t.userid = b.userid AND t.groupid = p_id AND b.userid = l_second_processor; IF l_count = 1 THEN SELECT NVL(b.username,'') INTO l_second_processor_name FROM trsdba.wcmgrpuser t, trsdba.wcmuser b WHERE t.userid = b.userid AND t.groupid = p_id AND b.userid = l_second_processor; END IF; SELECT NVL(COUNT(*),'') INTO l_count FROM trsdba.wcmgrpuser t, trsdba.wcmuser b WHERE t.userid = b.userid AND t.groupid = p_id AND b.userid = l_third_processor; IF l_count = 1 THEN SELECT NVL(b.username,'') INTO l_third_processor_name FROM trsdba.wcmgrpuser t, trsdba.wcmuser b WHERE t.userid = b.userid AND t.groupid = p_id AND b.userid = l_third_processor; END IF; IF l_first_processor_name IS NOT NULL OR l_second_processor_name IS NOT NULL OR l_third_processor_name IS NOT NULL THEN SELECT NVL(TO_CHAR(l_first_processor),'null')||','||NVL(TO_CHAR(l_first_processor_name),'null')||';'|| NVL(TO_CHAR(l_second_processor),'null')||','||NVL(TO_CHAR(l_second_processor_name),'null')||';'|| NVL(TO_CHAR(l_third_processor),'null')||','||NVL(TO_CHAR(l_third_processor_name),'null')||';|' INTO l_tmp FROM dual; l_return:=l_return||l_tmp; END IF; END LOOP; CLOSE l_cur; IF l_return IS NOT NULL THEN l_return:=SUBSTR(l_return,1,LENGTH(l_return)-1); END IF; END IF; ELSE l_return:=''; END IF; END LOOP; CLOSE l_c; END IF; RETURN l_return; END;
发表评论
-
达梦数据库初试
2014-12-16 16:16 941达梦数据库安装文件:http://www.dameng.c ... -
PowerDesigner列名、注释内容互换[
2013-10-28 13:49 948在用PowerDesigner时,常常在NAME或Comm ... -
Oracle集群
2013-09-24 22:17 0(DESCRIPTION=(ADDRESS_LIST=(AD ... -
Oracle表空间查询
2012-03-15 14:10 1083表空间使用量 select a.tablespace_na ... -
Oracle表解锁
2011-04-21 15:41 1029哪些表被锁 select s.username, de ... -
sql查询性能小测试
2010-12-13 23:12 1309测试环境为oracle10g ... -
JDBC执行创建存储过程的语句,出现SQL-92错误
2010-12-10 11:56 2676JDBC执行创建存储过程的语句,出现SQL-92错误。 在网 ... -
Oracle数据库对象
2010-09-19 08:56 1142一、 drop 表 执 ... -
mongodb小结
2010-08-21 00:03 1419转自http://www.wentrue.net/bl ... -
Oracl树查询
2009-05-21 14:15 998//从底往上找祖父节点 select id,level fr ... -
备用SQL
2009-02-22 11:59 0UPDATE taskbusinesslog tSET t ... -
组映射关系
2008-12-08 17:28 1030select a.id, b.org_node_name it ... -
user同步
2008-11-20 17:41 1231insert into wcmuser(userid,user ... -
sql
2008-11-05 10:48 1112delete incident_bus_logwhere ti ... -
Oracle SQL雜記
2008-06-11 15:56 1025[code="sql"]S ... -
Oracle函數
2008-05-21 16:16 0TO_CHAR(sysdate,'D') 當天是一周中的第 ... -
PL/SQL
2008-05-21 15:20 0PL/SQL條件語句 IF .. THEN .. END I ... -
最高效刪除重復記錄的方法
2008-03-18 10:30 1232DELETE FROM MYORDER_ORDER e WH ...
相关推荐
### MATLAB的S-Function教程 #### S-Function概述 S-Function(系统函数)是MATLAB Simulink中一种强大的工具,它允许用户通过自定义的编程方式来扩展Simulink的功能。S-Function可以使用多种语言编写,包括MATLAB...
在MATLAB环境中,Simulink是用于系统建模和仿真的一种强大的工具,而S-function则是Simulink中的自定义功能模块,允许用户扩展Simulink的功能,以满足特定的计算需求。本篇将深入探讨S-function模块在蹦极系统案例中...
在MATLAB环境中,S-Function(System Function)是一种高级的编程接口,用于创建自定义的仿真组件,可以扩展Simulink的功能。S-Functions允许用户深入到Simulink的内部,构建自己的动态系统模型,满足特定的计算需求...
S-Function(系统函数)是Simulink中一个强大的功能,允许用户使用C、C++、Fortran或其他编程语言来编写自定义模块,以便在Simulink模型中使用。 1. S-Function概念及仿真原理: S-Function是Simulink中的一个模块...
在MATLAB的Simulink环境中,S-Function是一种强大的工具,允许用户自定义系统行为,以满足特定的仿真需求。本教程将详细讲解如何利用S-Function实现一个离散PID控制器,并建立相应的Simulink仿真模型。 首先,理解S...
S-Function 使用手册 S-Function 是 Simulink 中的一种自定义驱动库,允许用户创建自定义的模型和算法,以满足特定的仿真和设计需求。以下是 S-Function 使用手册的知识点总结: 一、S-Function 概念 * S-...
**VC6.0的__FUNCTION__宏支持** 在C++编程中,`__FUNCTION__`是一个预定义的宏,它代表了当前函数的名称。在Visual C++ 6.0(简称VC6.0)环境下,这个宏尤其有用,因为它可以帮助开发者在调试和日志记录时获取函数...
理解Javascript Function与Object 在JavaScript中,Function和Object是两个非常重要的概念,它们之间存在着紧密的关系。在这篇文章中,我们将深入探讨Function和Object的关系,了解它们之间的联系和区别。 ...
MATLAB的S-Function是一种强大的工具,用于在Simulink环境中创建自定义的动态系统模块。它允许用户利用C、C++或Fortran等底层语言的性能,来实现Simulink无法直接处理的复杂算法或特定硬件接口。这份《MATLAB的S-...
S-function分为两种主要类型:Legacy S-functions(旧版S-function)和Blockset S-functions(Blockset型S-function)。Legacy S-functions是基于M文件的,通常用C或C++编写,适用于MATLAB R2016b及更早版本。...
其中,`result`是接收function返回值的变量,`function_id`是被调用的function的名称,`expr1, expr2, ..., exprN`是传递给function的实际参数,必须按照function定义时声明输入参数的顺序来排列。 ### Function的...
### MATLAB的S-Function编写指导 #### 第一章:S-Function概述 S-Function(系统函数)是一种强大的工具,用于扩展Simulink的功能。它允许用户通过自定义的算法来增强模型的能力。本章首先介绍了S-Function的基本...
### S-Function编写指导 #### S-Function概述 **S-Function**(系统函数)是Simulink中一种强大的机制,允许用户通过自定义代码来扩展Simulink的功能。S-Function可以用来创建复杂的模块,这些模块能够实现...
### S-Function编写指导 #### 第一章:S-Function概述 **S-Function**(系统函数)是一种强大的工具,用于扩展Simulink®的功能。它允许用户自定义Simulink块的行为,从而实现更复杂的功能。本章节将详细介绍S-...
在MATLAB/Simulink环境中,S-Function(Simulink Function)是一种用户自定义的模块,用于扩展Simulink库的功能。S-Functions可以用多种编程语言编写,包括C语言,因为C语言具有高效和灵活性,是实现复杂计算逻辑的...
在MATLAB环境中,s-function(系统函数)是一种高级的编程工具,用于构建定制的Simulink模块,以处理复杂的系统模型或实现特定的算法。在本案例中,s-function被应用来解决一个倒立摆的非线性问题。倒立摆是一个经典...
《MATLAB的S-Function编写指导》是一本专为初学者设计的教程,旨在帮助读者掌握MATLAB环境下的S-Function编程技术。S-Function,全称为Simulink Simulation Function,是MATLAB Simulink仿真环境中的一种特殊模块,...
### S-Function 使用指导 #### S-Function 概述 S-Function,即系统函数(System Function),是Simulink环境中一种强大的工具,用于扩展Simulink的功能性。它允许用户自定义模型中的行为,实现Simulink本身不支持...