mybatis传入多个参数

多参数

1.普通(按照顺序索引 从0开始)

1
2
3
4
5
Map selectManyParam(int uId,String content);

<select id="selectManyParam" resultType="map">
select * from blog where uId=#{0} and content=#{1}
</select>

2.注解

1
2
3
4
5
Map selectManyParam(@Param("id") int uId, @Param("ct") String content);

<select id="selectManyParam" resultType="map">
select * from blog where uId=#{id} and content=#{ct}
</select>