/// <summary> /// 添加免考核记录 /// </summary> /// <param name="re">免考核记录实体类</param> public void AddRemitExamine(RemitExamine re) { if (re == null) throw new ArgumentNullException("添加的免考核记录不能为空"); if (IsExists(re)) throw new BllException("该时段已经存在免考核申请"); reDal.AddRemitExamine(re); }
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
代码
///
<summary>
///
添加免考核记录
///
</summary>
///
<param name="re">
免考核记录实体类
</param>
public
void
AddRemitExamine(RemitExamine re)
{
if
(re
==
null
)
throw
new
ArgumentNullException(
"
添加的免考核记录不能为空
"
);
if
(IsExists(re))
throw
new
BllException(
"
该时段已经存在免考核申请
"
);
reDal.AddRemitExamine(re);
}
/*------------------------------------------
over子句只能用于select和order by 查询阶段,且只能和聚合函数和排名函数(譬如row_number(),dense_rank()) 配合使用
over子句中只包含两种语法,over(partition by userid order by userid),partition by 和order by
partition by 用于分组,具体用法见下面的例子
order by 用于和排名函数配合使用时,按照什么排名顺序来进行分配序号
------------------------------------------*/
---用于聚合函数
select userid,deptid,remitspan,askspan,outspan,(remitspan+askspan+outspan) as totalvalue
,sum(remitspan+askspan+outspan) over(partition by deptid) as teamvalue
,sum(remitspan+askspan+outspan) over() as alltotal
from overtest
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
/*
------------------------------------------
over子句只能用于select和order by 查询阶段,且只能和聚合函数和排名函数(譬如row_number(),dense_rank()) 配合使用
over子句中只包含两种语法,over(partition by userid order by userid),partition by 和order by
partition by 用于分组,具体用法见下面的例子
order by 用于和排名函数配合使用时,按照什么排名顺序来进行分配序号
------------------------------------------ */
-- -用于聚合函数
select userid,deptid,remitspan,askspan,outspan,(remitspan + askspan + outspan) as totalvalue
, sum (remitspan + askspan + outspan) over (partition by deptid) as teamvalue
, sum (remitspan + askspan + outspan) over () as alltotal
from overtest
over子句只能用于select和order by 查询阶段,且只能和聚合函数和排名函数(譬如row_number(),dense_rank()) 配合使用
over子句中只包含两种语法,over(partition by userid order by userid),partition by 和order by
partition by 用于分组,具体用法见下面的例子
order by 用于和排名函数配合使用时,按照什么排名顺序来进行分配序号
------------------------------------------ */
-- -用于聚合函数
select userid,deptid,remitspan,askspan,outspan,(remitspan + askspan + outspan) as totalvalue
, sum (remitspan + askspan + outspan) over (partition by deptid) as teamvalue
, sum (remitspan + askspan + outspan) over () as alltotal
from overtest