朝朝-_-幸福

            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
          主站蜘蛛池模板: 三穗县| 天柱县| 奇台县| 增城市| 永安市| 岳普湖县| 滦平县| 博乐市| 胶南市| 巴东县| 巫山县| 砚山县| 丰都县| 五指山市| 玉门市| 仁布县| 仲巴县| 文昌市| 厦门市| 赤城县| 库车县| 黄龙县| 济宁市| 鹰潭市| 佛学| 莒南县| 镇赉县| 南充市| 娄烦县| 桂平市| 高邑县| 涡阳县| 平武县| 疏附县| 东光县| 固阳县| 化隆| 五峰| 察哈| 和政县| 景洪市|