在对数据库进行select、update、insert、del的操作时?你对哪个表进行操作,语句里面就有,何必要SQL的返回消息.

解决方案 »

  1.   

    因为用的ibatis,
    sql语句都写在xml里了,比如:
    <select id="getAppLeasePriceInfo" resultMap="appLeasePrice" parameterClass="appTotalSearchInfo">
        <![CDATA[
    select  
    count(case when f.leaseprice>=300.00 and f.leaseprice<600.00 then f.id end) as appLeasePrice1,
    count(case when f.leaseprice>=600.00 and f.leaseprice<900.00 then f.id end) as appLeasePrice2,
    count(case when f.leaseprice>=900.00 and f.leaseprice<1200.00 then f.id end) as appLeasePrice3,
    count(case when f.leaseprice>=1200.00 then f.id end) as appLeasePrice4
    ]]>
        from familytable f
      
       <dynamic prepend="WHERE">
        <isNotEmpty prepend="AND" property="appUserFlag">
    f.sectionname in ('1001','1002','1003','1004','1005','1006','1007','1008')
    </isNotEmpty>
            <isNotEmpty prepend="AND" property="appSectionName">
          f.sectionname = #appSectionName# 
         </isNotEmpty> 
            <isNotEmpty prepend="AND" property="appUserFlag">
          f.userflag = #appUserFlag# 
         </isNotEmpty>        
         <isNotEmpty prepend="AND" property="appHandleDateBegin">
          <![CDATA[f.finaldate >= #appHandleDateBegin#  ]]>   
         </isNotEmpty> 
         <isNotEmpty prepend="AND" property="appHandleDateEnd">
         <![CDATA[f.finaldate <= #appHandleDateEnd# ]]>   
         </isNotEmpty>   
        </dynamic>
      </select>像这样的情况,我想在执行前拦截一下将要对哪些表的哪些列进行操作。有可能做到么?