ITeye博客

曾老师的博客

曾老师 · 共 73 篇文章

sql 中 exists 关键字的用法

好久没发表博客了,今日偶有闲暇 仔细研究了一遍oracle中exists 的用法,整理了在一起, 记录在itieye,以防后忘。。。。嘎嘎 1. 关于数据首先做好数据的初始化工作 -- Create table create table CUSTOMERS ( CID NUMBER not null, CNAME VARCHAR2(50) not null ) alter table CUSTOMERS add constraint CUSTOMERS_PK primary key (CID) using index tablespace USERS -- Create sequence c…

2013-05-30 20:59 · oracle · 评论(1)

今天要放假咯

今天要放假咯,放年假咯!!!嘎嘎嘎

2013-02-01 15:23 · 评论(0)

分页 连接查询

public PageObject bookList(PageParameter req, Map args) { String sql = " select BID as ID,BNAME,BREMARK,BCOVER,USERNAME as CREATEDID, TO_CHAR(CREATEDTIME,'YYYY-MM-DD HH24:MI:SS') as CREATEDTIME from tbbook b, tbuser u where b.CREATEDID = u.userid "; if (args.get("bname") != null && ObjectUtils.toSt…

2012-11-05 15:31 · 评论(0)

struts2标签的用法

set标签 set标签 用户将某个值 放入到指定的范围 <s:set value="#request.msgxxx" var="xxx"> <s:property value="#xxx"> </s:set> 解释set标签,通过这个ognl表达式#request.msgxxx把值取出来 使用var关键字,在把这个值放入到map栈中,给值起个名字,也就是key是“xxx”,所以我在取 值的时候用<s:property value="#xxx"> 值栈中的表现是 键是xxx 值是 msgxxx_request ------------------------------------------…

2012-10-22 09:35 · Struts2 · 评论(0)

ognl表达式标记符号的用法

“#”的用法 集合的投影(只输出部分属性)用法 collectionName.{expression}<br> <s:iterator value="#request.personList.{name}"> <s:property> </s:iterator> ---------------------------------------------- 用法2集合的过滤 "?#" 过滤所有符合条件的集合 "^#" 过滤第一个符合条件都元素 "$#" 过滤最后一个符合条件的元素 <s:iterator value="#request.personList.{?#this.age>25}" va…

2012-10-22 09:28 · Struts2 · 评论(0)

选择哪个题库的哪道题

select tt.total ,ts.SubjectID ,TS.SUBJECT,tu.userid,tu.username from tbSubjects ts inner join ( select count(TopicID) total ,subjectid from tbTopic GROUP BY SUBJECTID) tt on ts.SubjectID = tt.SubjectID inner join tbUser tu on ts.userid = tu.userid order by 1 按题型统计 这个sql查询,我吧 tbSubjects 题库表 和 试题表tbT…

2012-10-16 20:05 · 系统 · 评论(0)

spring注入通过注解方式实现

public class LoginForUserAction extends ActionSupportExtend { @Autowired private TbUserService tbUserService; } public interface TbUserService {} @Service public class TbUserServiceImpl implements TbUserService { @Autowired private TbuserDAO tbuserDAO; } public interface TbuserDAO {} @Repository pu…

2012-10-15 15:02 · Struts2 · web问题 · 评论(0)

测试在线考试系统

系统管理,有题型管理,岗位序列,和操作日志3个节点 ,其中题型管理有子个节点。 考试管理,有在线考试 和在线联系两个节点。 通过对在线考试的节点,可以完成对试卷的增删改查。 添加试卷,就是在在线考试这个节点中完成的。 在添加试卷时,试卷有效时间 往前推一天,才能在前台的我的考试,未完成的考试列表中看见。 也就是说,我今天刚生成的试卷,默认有效时间是2012-10-15 08:00到 2013-10-15 18:00。 我今天是2012-10-15 08:00,只有我定义是2012-10-14号的时候,才能在未完成考试列表中看到。 自测练习,添加的时候也同在线考试一样。 账户管理:可以添加用户…

2012-10-15 14:50 · 系统 · 评论(0)

把Object[ ]作为 参数为传递出去

Object[] args1 = { userName, _base_user_organid, RText.Md5(passWord), userAlias, sex, status, experience, "userAliasPY", joinWork, born, mobile, email, phone,CardID, perNo,workerSeriasNo,accountType,jobLevelID,"manualAddUser"}; userID = managerClerkService.add(args1); /** * 往Tbuser表中添加一个用户,参数是Objec…

2012-10-15 09:26 · web问题 · 评论(0)

oracle 分组 row_number()

create or replace view vw004_examineegrade as select "EGID","USERID","TPID","WLGID","EXTIMES","EXSTATE","EXB_TIME", "EXE_TIME","TESTTIME","OBJECTIVE","SUBJECTIVE",round(nvl(EXSCORE,0),1) as EXSCORE,"PFUSERID", "EXREMARK" from ( select tbexamineegrade.*, row_number() over(partition by userid,TpID or…

2012-10-10 19:26 · oracle · 评论(0)

查询数值 类型然后返回字符串

String sql = "select t.tpid,eg.egid,DATE_FORMAT(eg.exb_time,'%Y-%m-%d %H:%i') as EXB_TIME,t.papername,t.viewpaper," + "if(MINUTE(SEC_TO_TIME(eg.testtime))<>0,CONCAT(CONVERT(MINUTE(SEC_TO_TIME(eg.testtime)),char),'分',"+ convert(SECOND(SEC_TO_TIME(eg.testtime)),char),'秒'),CONCAT(CONVERT(SECOND(SEC_TO…

2012-09-28 16:31 · mysql · 评论(0)

复杂的decode()函数

select tt.ttid,tt.targettrain,DATE_FORMAT(tt.datecreated,'%Y-%m-%d %H:%i') datecreated, ifnull(ttcount,0) ttcount,ifnull(joincount,0) joincount,ifnull(passcount,0) passcount, round( ifnull(joincount,0)*100/( case ifnull(ttcount,0) when 0 then 1000 else ifnull(ttcount,0) end ) ,2 ) cyl, round(ifnull…

2012-09-27 16:41 · sql · 评论(0)

解决问题 贵在一剑封喉

Column 'ttid' in where clause is ambiguous 多半是因为多表查询的时候几个表中同时出现了某个相同的列名, 而在查询条件WHERE后面又没有指定是那个表, 而引起的又或者是查询结果里面有两个相同的列名,而没有指定是哪个表,使用的时候可以这样,查询前面加表名可避免出现错误 ambiguous 1. 含糊不清的 2. 引起歧义的 select distinct username,UserAlias,OrganName,OrganLevelName,jobname, DATE_FORMAT(StartDate,'%Y-%m-%d %H:%i') StartDa…

2012-09-27 15:13 · mysql · 评论(0)

在Action里往值栈中存放对象的方法

ActionContext.getContext().put("departmentList",departmentList); 是直接往 map栈中存放元素 Stack Context Key Value departmentList [cn.xiaoxian.domain.Department@8098] <s:iterator value="departmentList"> 注意没用# -------------------------------- ServletActionContext.getRequest().setAttribute("departmentList",depa…

2012-09-27 00:31 · Struts2 · 评论(0)

iterator 迭代标签 在迭代map的时候的巧妙使用

List<Map<String,Object>> maps = new ArrayList<Map<String,Object>>(); Map<String,Object> map1 = new HashMap<String,Object>(); Person person1 = new Person(); person1.setPid(1L); person1.serPname("person1") map1.put("m1",person1); ------------------------------------------------------- Map<String,Obje…

2012-09-26 23:55 · Struts2 · 评论(0)