博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
项目那点事
阅读量:4875 次
发布时间:2019-06-11

本文共 2755 字,大约阅读时间需要 9 分钟。

想说几点工作碰到的:

1.首先就是JSP文件中传回的值:""并不是为null。而至于怎么传回null值,还有待实验

2.就是mybatis中insert到数据库中null列值是必须注明jdbcType,比如:一个表的外键值有可能为空(即改表此时没有所关联的表的值)

方法:

#{branch,jdbcType=INTEGER}等等,注意大小写。

3.工数黑名单检查SQL代码:

1 -- -------------------------------------------------------------------------------- 2 -- Routine DDL 3 -- Note: comments before and after the routine body will not be stored by the server 4 -- -------------------------------------------------------------------------------- 5 DELIMITER $$ 6  7 CREATE DEFINER=`root`@`%` PROCEDURE `checkerror2`(startDate date,endDate date) 8 begin 9     declare done int default false;10     declare staffNum int;11     declare firstStaff int;12     13     14     declare curTemp cursor for15     select staffID from staff where position !='所长' and position !='董事长' and position !='本部长' and position !='经理' and position!='担当经理'and state=1 order by staffID;16     declare continue handler for not found set done =true;17     open curTemp;18     19     set firstStaff=(select staffID from staff where position !='所长' and position !='董事长' and position !='本部长' and position !='经理' and position!='担当经理' and state=120     order by staffID limit 1);21     22     truncate table temp;23     read_loop:loop24     fetch curTemp into staffNum;25     if done then26         leave read_loop;27     end if;28     if staffNum >= firstStaff then29         set staffNum=(select checkbystaffid(staffNum,startDate,endDate));30     end if;31     end loop;32 close curTemp;33     insert into temp (staffID,date,totalTimes) (select m.staffID,m.date,sum(m.times) as totalTimes 34     from manhour m,work_calendar wc,staff s35     where m.date between startDate and endDate and m.date = wc.date and wc.able=136     and s.staffID = m.staffID and s.state = 137     group by m.staffID ,m.date38     having sum(m.times) < 8 or sum(m.times)>24);39 end
checkerror2
1 CREATE DEFINER=`root`@`%` FUNCTION `checkbystaffid`(staffNum int,sdate date,edate date) RETURNS int(1) 2 begin 3  4 declare done int default false; 5 declare indexdate DATE; 6  7 declare cur1 cursor for   8 select date from work_calendar where date not in (select m.date as mDate  9 from manhour m10 where m.date between sdate and edate and m.staffID= staffNum11 group by m.date) and able =1 and date between sdate and edate;12 13 declare continue handler for not found set done =true;14 open cur1;15 16 17 set indexdate = sdate;18 read_loop:loop19     fetch cur1 into indexDate;20     if done then21         leave read_loop;22     end if;23     if indexDate >= sdate then24         insert into temp (staffID,date) values(staffNum,indexDate);25     end if;26 end loop;27 close cur1;28 return(staffNum);29 end
checkbystaffid

 

转载于:https://www.cnblogs.com/sevenology/archive/2013/05/16/3082204.html

你可能感兴趣的文章
AppCan调试问题
查看>>
AppCan模拟器调试
查看>>
JavaScript更改css样式
查看>>
按钮控制示例
查看>>
JavaScript处理股票数据
查看>>
新浪JavaScript库
查看>>
销毁定时器
查看>>
phpredis中文文档 [转]
查看>>
Linux MySQL基础
查看>>
常用JS验证
查看>>
基本算法个人PHP 实现(一)
查看>>
数据库三范式
查看>>
如何将 NavigationBar 的半透明效果关闭?
查看>>
全国高校绿色计算大赛 预赛第一阶段(C++)第4关:计算日期
查看>>
贪心算法实现霍夫曼编解码
查看>>
[Operating System] {ud923} P2L1: Processes and Process Management
查看>>
[ML] {ud120} Lesson 4: Decision Trees
查看>>
HDP-2.6.0.3
查看>>
世界上有10种软件公司:一种像工厂,另一种像电影摄制组
查看>>
[Noip2007] 字符串的展开
查看>>