`
- 浏览:
407692 次
- 性别:
- 来自:
北京
-
- -------------------------------------2008.7.23 四级疾病统计 -------------------------------------------------------
- select mc,sum(cou) as cous ,yiji from (
- select f.mc,i.cou,f.yiji
- from
- (select e.sanji,h.cou from csm_icd_jblx e,
- (select b.mc,count(a.zd) as cou,b.flid
- FROM ywb_mz_bingli a,csm_icd_10 b
- where a.zd=b.mc and a.siteid='4114210102'
- group by b.mc) h
- where e.id=h.flid) i,csm_icd_jblx f
- where substring(i.sanji,1,5)=f.yiji
- union all
- SELECT c.mc,count(a.zd),c.yiji
- FROM ywb_mz_bingli a,csm_icd_jblx c
- where a.zd=c.mc
- and c.yiji<>'' and c.yiji is not null and c.erji<>'' and c.erji is not null
- and c.sanji<>'' and c.sanji is not null
- group by c.mc
- union all
- select f.mc,h.cou,f.yiji
- from (
- SELECT c.mc,count(a.zd) as cou,substring(c.erji,1,5) as yiji
- FROM ywb_mz_bingli a,csm_icd_jblx c
- where a.zd=c.mc
- and c.erji<>'' and c.erji is not null
- and (c.sanji='' or c.sanji is null)
- group by c.mc) h,csm_icd_jblx f
- where h.yiji=f.yiji
- union all
- select f.mc,h.cou,f.yiji
- from (
- SELECT c.mc,count(a.zd) as cou,substring(c.sanji,1,5) as yiji
- FROM ywb_mz_bingli a,csm_icd_jblx c
- where a.zd=c.mc
- and c.sanji <>'' and c.sanji is not null
- group by c.mc) h,csm_icd_jblx f
- where h.yiji=f.yiji
- ) as t group by mc order by cous desc
- select mc,sum(cou) as cous ,erji from (
- select f.mc,i.cou,f.erji
- from
- (select e.sanji,h.cou
- from csm_icd_jblx e,(select b.mc,count(a.zd) as cou,b.flid
- FROM ywb_mz_bingli a,csm_icd_10 b
- where a.zd=b.mc and a.jzrq between '2008-01-01' and '2008-07-23' and a.siteid='4114210102'
- group by b.mc) h
- where e.id=h.flid) i,csm_icd_jblx f
- where substring(i.sanji,1,9)=f.erji
- union all
- SELECT c.mc,count(a.zd) as cou,c.erji
- FROM ywb_mz_bingli a,csm_icd_jblx c
- where a.zd=c.mc and a.jzrq between '2008-01-01' and '2008-07-23'
- and c.erji<>'' and c.erji is not null
- and (c.sanji='' or c.sanji is null)
- group by c.mc
- union all
- select f.mc,h.cou,f.erji
- from (
- SELECT c.mc,count(a.zd) as cou,substring(c.sanji,1,9) as erji
- FROM ywb_mz_bingli a,csm_icd_jblx c
- where a.zd=c.mc and a.jzrq between '2008-01-01' and '2008-07-23'
- and c.sanji <>'' and c.sanji is not null
- group by c.mc) h,csm_icd_jblx f
- where h.erji=f.erji
- )as t where substring(erji,1,5)='a0015' group by mc order by cous desc
- select mc,sum(cou) as cous ,sanji,id from (
- select e.mc,h.cou,e.sanji,e.id
- from csm_icd_jblx e,(select b.mc,count(a.zd) as cou,b.flid
- FROM ywb_mz_bingli a,csm_icd_10 b
- where a.zd=b.mc and a.jzrq between '2008-01-01' and '2008-07-23' and a.siteid='4114210102'
- group by b.mc) h
- where e.id=h.flid and substring(sanji,1,9)='a00150005'
- union all
- SELECT c.mc,count(a.zd) as cou,c.id,c.sanji
- FROM ywb_mz_bingli a,csm_icd_jblx c
- where a.zd=c.mc and a.jzrq between '2008-01-01' and '2008-07-23'
- and c.sanji <>'' and c.sanji is not null and substring(sanji,1,9)='a00150005'
- group by c.mc
- )
- as t group by mc order by cous desc
- SELECT b.mc,count(a.zd) as cou
- FROM ywb_mz_bingli a,csm_icd_10 b
- where a.zd=b.mc and a.jzrq between '2008-01-01' and '2008-07-23' and a.siteid='4114210102' and b.flid='141'
- group by b.mc
- order by cou desc
- ----------------------------------------------------------------------------------------------------------------------
- <1> DAO中使用return this.getSession().createSQLQuery(sql).list();方法执行纯sql,偶尔会有问题发生,type不支持,故改用JDBC方式统计数据,使用方法如下
-
- public ResultSet findDataByConditon(String sql){
- ResultSet rs=null;
- try {
- rs=this.getSession()
- .connection()
- .createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)
- .executeQuery(sql);
- } catch (DataAccessResourceFailureException e) {
- e.printStackTrace();
- } catch (HibernateException e) {
- e.printStackTrace();
- } catch (IllegalStateException e) {
- e.printStackTrace();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- return rs;
- }
- <2> 在新的集合中加入ResultSet中数据...(threesick_rs为ResultSet对象)
- new_list.add(new Object[]{threesick_rs.getString(1),threesick_rs.getString(2)});
- <3> 当使用纯sql查回数据带count,sum之类数据时,取其中的值...
- 页面中取:
- <c:forEach var="record" items="${jb_list}" varStatus="status">${record[0]}</forEach>
- 类中取:
- for(int i=0;i<jb_list.size();i++){
- String sums = ((Object [])jb_list.get(i))[1].toString();
- befsum+=Integer.parseInt(sums);
- }
- <4> 在统计图中使用下拉列表切换时: 使用js
- 先引入js:
- <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.2.6.pack.js"></script>
-
- <script type="text/javascript">
- function changeImageType()
- {
- var tjt=document.getElementById("tjtype").value;
- var tjlx=document.getElementById("tjlx").value;
- if(tjt=='zzt'){
- $.get("<%=request.getContextPath()%>/ajax/mytj/jb/search/fourdata.do?begindate=${param.begindate}&enddate=${param.enddate}&seltype=${seltype}",{},function(data){document.getElementById("chartPhoto").src="<%=request.getContextPath()%>/view/mztj/jb/image.do?method=fourSickBar&tjlx="+tjlx;});
- }
- if(tjt=='bzt'){
- $.get("<%=request.getContextPath()%>/ajax/mytj/jb/search/fourdata.do?begindate=${param.begindate}&enddate=${param.enddate}&seltype=${seltype}",{},function(data){document.getElementById("chartPhoto").src="<%=request.getContextPath()%>/view/mztj/jb/image.do?method=fourSickPie&tjlx="+tjlx;});
- }
- }
- </script>
- <5> 使用ResultSet数据时,如果使用两次,那么在第二次取数据之前一定要将游标指回,否则数据丢失.
- threesick_rs.beforeFirst();
-
- <6> c标签格式化日期
- <fmt:formatDate pattern="yyyy-MM-dd" value="${record.mzbl.jzrq}" />
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
This book is aimed at experienced application developers, data engineers, tech enthusiasts, and others who are seeking a well-rounded understanding of the modern database landscape. Prior database ...
on about future demand, rather than basing production on actual customer orders. This leads to increased inventory costs, storage space requirements, and potential obsolescence. By producing only what...
- at用于表示具体的时刻,例如:"at seven o'clock","at a quarter past four"。 - in用于不特指的早晨、下午和晚上,如:"in the morning","in the afternoon","in the evening"。 - on用于具体的某一天或...
Analytics is seen as an end-to-end process beginning with identifying the business problem to evaluating and drawing conclusions about the prescribed solution arrived at though the use of analytics ...
)它也可以作为动词使用,表示"工作",如:"She goes to work at six o'clock."(她六点钟去上班。) 6. **exercise的多义性**:了解"exercise"一词的不同含义和用法。作为动词,表示"锻炼",如:"His grandpa ...
例如,"I love playing basketball because it's good for teamwork and physical fitness." (我喜欢打篮球,因为它对团队合作和身体素质都有好处。) 3. 描述喜欢的明星:"Describe our favourite star"是指描述...
3. My mum usually went to work at half past seven.(过去时态,描述过去的习惯) 4. We are having a birthday now.(现在进行时,表示现在正在过生日) 5. Yesterday I saw a girl.(过去时态,描述过去发生的...
Finally, in Chapter 7, Handling Impure Functions, on page 139, we'll look at the concept that finishes this journey: how to work with impure functions. We'll explore the pros and cons of four ...
6. 动词短语:"I’m sure that they will begin the work at once after they make a decision about the plan." "make a decision"意为做决定,这里指的是在他们对计划做出决定之后,会立即开始工作。 7. 形容词...
- It was at 3 o'clock that they received the telephone.(强调句,他们在三点钟接到了电话。) 4. **no 比较级 than / not 比较级 than** - 这两个句型用来表达程度相当或者不及。 - 例句: - He works no ...
- "在七点钟吃早饭":具体时刻前用at,即have breakfast at seven o'clock。 - "在 6 岁时开始上学":表示年龄,用at,即start school at the age of 6。 - "告诉你关于我的生活情况":用介词about,即tell you ...
6. 在七年级一班:in Class 1, Grade 7 或 in Class One, Grade Seven 7. 热爱读书:love reading,例如喜爱踢足球:love playing football 8. 喜欢听音乐:like listening to the music 9. 喜爱玩电脑游戏:enjoy ...
8. 正确答案:John arrived at 7:00 and Tom arrived at 6:00. So Tom was the first to arrive. (根据时间判断,Tom先到) 9. 正确答案:What time is it by your watch? --- It's half past seven. (去掉a,half ...
正确的表达方式是:"Because he was ill yesterday, he didn't go to work." 或者 "He was ill yesterday, so he didn't go to work." 2. 动词与介词搭配:不及物动词如"move"后面接地点时,需加介词"to",如"The ...
The performers and staff at the Santa Fe Opera include professionals from top orchestras and operas across the nation, who take time off from their regular engagements to work there. They are drawn to...