<isNotNull prepend="AND" property="exetimestart"> <![CDATA[EXE_TIME >= #exetimestart#]]> </isNotNull> <isNotNull prepend="AND" property="exetimeend"> <![CDATA[ EXE_TIME <= #exetimeend# ]]> </isNotNull> <isNotEmpty prepend="AND" property="sql"> (SQL like '%'||#sql#||'%' or PARSED_SQL like '%'||#sql#||'%' ) </isNotEmpty> </dynamic> <dynamic prepend="HAVING"> <isNotEmpty property="countfrom"> <![CDATA[ COUNT(*) >= #countfrom# ]]> </isNotEmpty> <isNotEmpty prepend="AND" property="countto"> <![CDATA[ COUNT(*) <= #countto# ]]> </isNotEmpty> </dynamic> GROUP by PARSED_SQL <![CDATA[ ) order by cnt desc ) w_o_l_f_w WHERE ROWNUM < #__EndPoint#) WHERE (count_row_num >= #__StartPoint#) ]]> </dynamic-mapped-statement> [/code] 以上的就是一个动态的sql,看起来可能比较难看,但是他管用。 这样,程序里就简单了,在action里,我们把提交的数据简单的处理一下: |
正在阅读:iBATIS step by step 2iBATIS step by step 2
2004-04-08 14:38
出处:matrix.org.cn
责任编辑:sdq
键盘也能翻页,试试“← →”键