码迷,mamicode.com
首页 > 其他好文 > 详细

ibatis中的参数

时间:2019-05-27 19:34:15      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:code   map   不能   style   参数   select   value   row   str   

1.查看追踪的Sql问题:@param0没有被真是参数值替换掉

技术图片

2.c#的转义字符

转义字符    字符名称    
\    单引号    
\"    双引号    
\\    反斜杠    
\0    空字符    
\a    警报符    
\b    退格    
\f    换页    
\n    换行    
\r    回车    
\t    水平制表    
\v    垂直制表    

3.ibatis 中,不能直接使用非list的结构,例如

ReceiverList对应的Value
"{\"ReceiverList\":\"\‘cb51365b-f2c3-48d0-8a54-666af25ee9bc\‘,\‘b7761566-83c3-4650-b67a-5ca993c0aef7\‘\",\"page\":1,\"rows\":10}"

必须使用list结构:id

如果参数的类型是Array,则在使用时,collection属性要必须指定为 array

List<User> selectByIdSet(String[] idList);
 
<select id="selectByIdSet" resultMap="BaseResultMap">
    SELECT
    <include refid="Base_Column_List" />
    from t_user
    WHERE id IN
    <foreach collection="array" item="id" index="index" open="(" close=")" separator=",">
      #{id}
    </foreach>
</select>

 

ibatis中的参数

标签:code   map   不能   style   参数   select   value   row   str   

原文地址:https://www.cnblogs.com/gao109214/p/10932329.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!