恩,好的。我可以给你描述的更加详细一点,举个具体的例子,例如如下代码:- var result = "";
- var datefrom = getItemValueAsDate("_日期从");
- var dateto = getItemValueAsDate("_日期到");
- if (datefrom != null && dateto != null) {
- var datef = format(datefrom, "yyyy-MM-dd");
- var datet = format(dateto, "yyyy-MM-dd");
- result = "call kq_checkinout_pkg.kq_report_day(String:" + datef
- + ",String:" + datet + ",out:package)";
- } else {
- result = "call kq_checkinout_pkg.kq_report_day(String:2018-10-01,String:2018-10-10,out:package)";
- }
- result;
复制代码 然后在存储过程kq_report_day中有一段如下代码:- procedure kq_report_day(p_date_from varchar2,
- p_date_to varchar2,
- c_ref out t_cursor) is
- begin
-
- open c_ref for
-
- select (select u.item_姓名
- from tlk_人员信息表单 u
- where u.item_员工编号 = v.item_员工编号) as item_姓名,
- (select u.item_部门
- from tlk_人员信息表单 u
- where u.item_员工编号 = v.item_员工编号) as item_部门,
- (select u.item_干员类别
- from tlk_人员信息表单 u
- where u.item_员工编号 = v.item_员工编号) as item_干员类别,
- p_date_to as item_日期,
- (select t1.item_早敬业
- from tlk_敬业过程表单 t1
- where t1.item_员工编号 = v.item_员工编号
- and to_char(t1.item_日期, 'YYYY-MM-DD') = p_date_to) as item_早敬业,
- (select t1.item_迟到
- from tlk_敬业过程表单 t1
- where t1.item_员工编号 = v.item_员工编号
- and to_char(t1.item_日期, 'YYYY-MM-DD') = p_date_to) as item_迟到,
- (select t1.item_晚敬业
- from tlk_敬业过程表单 t1
- where t1.item_员工编号 = v.item_员工编号
- and to_char(t1.item_日期, 'YYYY-MM-DD') = p_date_to) as item_晚敬业,
- (select t1.item_早退
- from tlk_敬业过程表单 t1
- where t1.item_员工编号 = v.item_员工编号
- and to_char(t1.item_日期, 'YYYY-MM-DD') = p_date_to) as item_早退,
- sum(nvl(v.ITEM_上午未打卡, 0)) as ITEM_上午未打卡,
- sum(nvl(v.ITEM_下午未打卡, 0)) as ITEM_下午未打卡,
- (select sum(nvl(tv.ITEM_出差, 0))
- from tlk_敬业过程表单 tv
- where to_char(tv.item_日期, 'YYYY-MM-DD') >= p_date_from
- and to_char(tv.item_日期, 'YYYY-MM-DD') <= p_date_to
- and tv.item_员工编号 = v.item_员工编号) as ITEM_出差,
- sum(nvl(v.ITEM_年休假, 0)) as ITEM_年休假,
- sum(nvl(v.ITEM_事假, 0)) as ITEM_事假,
- sum(nvl(v.ITEM_病假, 0)) as ITEM_病假,
- sum(nvl(v.ITEM_婚假, 0)) as ITEM_婚假,
- sum(nvl(v.ITEM_产前假, 0)) as ITEM_产前假,
- sum(nvl(v.ITEM_产假, 0)) as ITEM_产假,
- sum(nvl(v.ITEM_陪产假, 0)) as ITEM_陪产假,
- sum(nvl(v.ITEM_哺乳假, 0)) as ITEM_哺乳假,
- sum(nvl(v.ITEM_丧假, 0)) as ITEM_丧假,
- sum(nvl(v.ITEM_是否早迟, 0)) + sum(nvl(v.ITEM_是否早退, 0)) as ITEM_早迟,
- sum(decode(nvl(v.ITEM_上午扣50, 0) + nvl(v.ITEM_下午扣50, 0),
- 0,
- 0,
- 1)) as ITEM_扣50
-
- from (select *
- from tlk_敬业过程表单 t
- where to_char(t.item_日期, 'YYYY-MM-DD') >= p_date_from
- and to_char(t.item_日期, 'YYYY-MM-DD') <= p_date_to
- and t.item_工作日 = 'Y'
- and is_exception(t.id, p_date_to) = 1) v
- group by v.item_员工编号
- order by item_干员类别, item_部门;
-
- end kq_report_day;
复制代码 就这样返回了一个结果集。针对于这样你们分页的机制是怎样的? |