首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

ibatis的动态话语发布到tomcat中后丢失

2013-03-26 
ibatis的动态语句发布到tomcat中后丢失在项目中使用了ibatis的dynamic动态语句,如下select idgetRecomm

ibatis的动态语句发布到tomcat中后丢失
在项目中使用了ibatis的dynamic动态语句,如下
<select id="getRecommends" parameterClass="java.util.Map" resultClass="Long">
select hrp.product_id
 from HOT_RECOMMEND_PRODUCT hrp
 where hrp.category_id = #categoryId#
    and hrp.mc_site_id = #mcsiteId# 
   <![CDATA[
           and hrp.start_time >= trunc(sysdate)
           and hrp.end_time <= trunc(sysdate)
           ]]>
 <dynamic prepend="and">
 <isNotNull prepend="and" property="merchantId">
    hrp.merchant_id like '%' || #merchantId# || '%'
    </isNotNull>
           <isNotEqual prepend="and" property ="siteType" compareValue="0">
           hrp.site_type = #siteType#
           </isNotEqual>
           <isEqual prepend="or" property="siteType" compareValue="0">
           hrp.merchant_id is null
           </isEqual>
 </dynamic>
 order by hrp.PRIORITY_DISPLAY
</select>

本项目为一个maven项目,编译成功后,在target下找到对应的文件中的sql语句,是正常的(同上)。

但是部署到tomcat中后,再找到对应文件中的sql语句,就成了下面的这个样子了
<select id="getRecommends" parameterClass="java.util.Map" resultClass="Long">
select hrp.product_id
 from HOT_RECOMMEND_PRODUCT hrp
 where hrp.category_id = #categoryId#
    and hrp.merchant_id like '%' || #merchantId# || '%'
    and hrp.mc_site_id = #mcsiteId# 
           and hrp.start_time &lt;= trunc(sysdate)
           and hrp.end_time &gt;= trunc(sysdate)
 order by hrp.PRIORITY_DISPLAY
</select> tomcat ibatis maven sql dynamic
[解决办法]
动态生成的吧...你试试运行发出的对不对就好了呗...

热点排行