朝朝-_-幸福

            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 小昭 閱讀(1124) 評論(0)  編輯  收藏 所屬分類: JAVA
          主站蜘蛛池模板: 浦县| 渑池县| 山阴县| 留坝县| 家居| 新绛县| 荣昌县| 江源县| 小金县| 陇川县| 维西| 华池县| 勃利县| 怀宁县| 新津县| 安塞县| 凤翔县| 博野县| 朝阳区| 呼图壁县| 桦川县| 邮箱| 宜良县| 禹州市| 呼伦贝尔市| 炎陵县| 阿城市| 宜宾县| 东明县| 木里| 慈利县| 平安县| 邳州市| 蓝山县| 当雄县| 高雄县| 舒兰市| 安阳县| 和硕县| 鄂尔多斯市| 汕头市|