.Net编译好的的网站系统(买的,没有源代码),用到了ibatis,数据库查询语句全都写到了config文件里面,但是一直不能使用模糊查询,只能进行精确查询,网上搜索发现是#和$的使用问题,但是将#换成$还是不行,那么现在问题是:网站系统需要重新编译一下吗?
不需要的话,怎么解决模糊查询的问题
map.config文件中查询代码如下:
<select id="Gettop1byfilter" parameterClass="UserFilter" resultClass="User" cacheModel="c">
select top 1
* from [User]
<dynamic prepend="where">
<isNotNull prepend="and" property="Id">
Id=#Id#
</isNotNull>
<isNotNull prepend="and" property="Username">
Username=#Username#
</isNotNull>
<isNotNull prepend="and" property="Title">
Title like '%'+#Title#+'%'
</isNotNull>
<isNotNull prepend="and" property="Titles">
Title=#Titles#
</isNotNull>
<isNotNull prepend="and" property="Group_id">
Group_id=#Group_id#
</isNotNull>
<isNotNull prepend="and" property="Open">
[Open]=#Open#
</isNotNull>
<isNotNull prepend="and" property="Enable">
Enable=#Enable#
</isNotNull>
<isNotNull prepend="and" property="FromCreate_time">
<![CDATA[
Create_time>=#FromCreate_time#
]]>
</isNotNull>
<isNotNull prepend="and" property="ToCreate_time">
<![CDATA[
Create_time<=#ToCreate_time#
]]>
</isNotNull>
<isNotNull prepend="and" property="sale_id">
sale_id=#sale_id#
</isNotNull>
<isNotNull prepend="and" property="saleid">
saleid like '%'+#saleid#+'%'
</isNotNull>
</dynamic>
<isNotEmpty property="SortOrderString">
order by $SortOrderString$
</isNotEmpty>
<isNotNull prepend="and" property="City_id">
City_id = #City_id#
</isNotNull>
</select>
希望大神能指点一下!
浮云间
一只名叫tom的猫
翻过高山走不出你
12345678_0001
相关分类