zoukankan      html  css  js  c++  java
  • IBATIS 的动态SQL语句拼接

     <select id="Analysis" resultClass="stationGroupInfo" parameterclass="hashtable">

          select     

        <dynamic>      

          <!--> 注意这里的$ 如果字符串直接拼接要用$,#默认会在字符串变量前面加引号的 -->      

          <isNotEmpty property="AnalysiStr">         $AnalysiStr$               </isNotEmpty>    

        </dynamic>      

         <!--> left join 2 个表 是这样写的  -->      

         from dbo.stationInfo  a left join categoryInfo  b  on a.categoryId = b.cId left join countryInfo c on a.countryId = c.cId

            <dynamic prepend="where">

               <isNotEmpty prepend="and" property="yearType">          

           $yearType$=#yearValue#

               </isNotEmpty>        

         <isNotEmpty prepend="and" property="categoryId">、

                  categoryId=#categoryId#

               </isNotEmpty>

               <isNotEmpty prepend="and" property="countryId">

                  countryId=#countryId#

               </isNotEmpty>

             </dynamic>      

         <dynamic>        

          <isNotEmpty property="GroupByStr">

                   $GroupByStr$ order by Name asc

                </isNotEmpty>

             </dynamic>

      </select>

  • 相关阅读:
    urllib.request.urlretrieve()
    python2.X与python3.X爬虫常用的模块变化对应
    .net 发布程序时出现“类型ASP.global_asax同时存在于...”错误的解决办法
    批量引用iconfont字体图标到项目
    动态设置bootstrapswitch状态
    MD5加密过时方法替换
    SQL语句
    PHP中的闭包
    算法复杂度
    快速排序
  • 原文地址:https://www.cnblogs.com/oftenlin/p/2672261.html
Copyright © 2011-2022 走看看