如题,数据库是oracle的,我在xml配置中写了个查询的代码
<select id="GetUserId" resultClass="int" parameterClass="User">
<![CDATA[
select
user_id,
user_name,
key,
from user
where user_name= #UserName# and key=#UserKey#
]]>
</select>然后我在去调用,但问题是,当user_name(字符串型)和key(字符串型)为空字符串时,他们的代码不是user_name= #UserName# and key=#UserKey#
而是
user_name is null and key is null
这样写才是可以的,
请问要怎么配置呢?
谢谢了
<select id="GetUserId" resultClass="int" parameterClass="User">
<![CDATA[
select
user_id,
user_name,
key,
from user
where user_name= #UserName# and key=#UserKey#
]]>
</select>然后我在去调用,但问题是,当user_name(字符串型)和key(字符串型)为空字符串时,他们的代码不是user_name= #UserName# and key=#UserKey#
而是
user_name is null and key is null
这样写才是可以的,
请问要怎么配置呢?
谢谢了
解决方案 »
- Gridview如何实现拖动改变列宽,并且在列变窄时隐藏列中多余的文字,就和其它第三方控件那样
- asp.net中关于web.config数据库的配置
- asp.net怎么实现这样执行存储过程: 'exec Proc_InsertShopCart '51','13','23','12.32'' ?
- 为什么VS2005只有发布才有DLL生成呀.编译就没有
- 困扰几天treeview的问题
- 求一简单存储过程用ASP。NET连oracle数据库(能执行,马上结帐)
- 关于用request.UserHostAddress获取客户端ip地址乱码问题,请给我大虾赐教,谢谢!
- ListBox的滚动显示问题???
- 关于DropDownList的数据绑定的菜问题,运行后在下拉列表中显示system.data.common.dbdatarecord,为什么?
- 关于checkboxlist的问题,紧急求助
- 点击按钮跳到页面的某个层的位置(锚点)急急
- 如何保存COOKIE值并且一直不失效,用于多账号一次登陆永久在线
<if test="UserName != null and UserName != '' ">
AND UserName =#{UserName}
</if>
<if test="UserKey != null and UserKey != '' ">
AND UserKey =#{UserKey}
</if>
</where>