朝朝-_-幸福

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  16 随笔 :: 34 文章 :: 6 评论 :: 0 Trackbacks
再写sql语句是如果输入中包含table的列表,就必须用
 <statement id="selectStatCard" resultClass="edu.hit.ice.ibatis.domain.StatCardOutput" parameterClass="edu.hit.ice.ibatis.domain.StatCardInput" cacheModel="StatCardCache">
     select * from (
   <dynamic prepend="">
     <iterate prepend="" property="tablename" conjunction="union"  open="(" close=")" > 
     
     (select HASH,CARD_ID,TOTAL_ACCOUNT,TOTAL_QQ,TOTAL_COUNT,TOTAL_TIME
        from $tablename[]$
       
       
     
             
         <isNotNull prepend="where" property="VALUE1">  
              <![CDATA[$ATTR1$>#VALUE1#]]>
             </isNotNull>
            
             <isNotNull prepend="and" property="VALUE2">  
              <![CDATA[$ATTR2$>#VALUE2#]]>
             </isNotNull>
            
             <isNotNull prepend="and" property="VALUE3">  
              <![CDATA[$ATTR3$>#VALUE3#]]>
             </isNotNull>
            
             <isNotNull prepend="and" property="VALUE4">  
              <![CDATA[$ATTR4$>#VALUE4#]]>
             </isNotNull>
            
             <isNotNull prepend="and" property="VALUE5">  
              <![CDATA[$ATTR5$>#VALUE5#]]>
             </isNotNull>
            
             <isNotNull prepend="and" property="VALUE6">  
              <![CDATA[$ATTR6$>#VALUE6#]]>
             </isNotNull>
            
             <isNotNull prepend="and" property="VALUE7">  
              <![CDATA[$ATTR7$>#VALUE7#]]>
             </isNotNull>
             )</iterate>
   </dynamic>
 
  ) as b  
            
    </statement>
   
posted on 2006-05-20 17:36 小昭 阅读(1112) 评论(0)  编辑  收藏 所属分类: JAVA

只有注册用户登录后才能发表评论。


网站导航: