mybatis常用写法-mapper xml传入多个参数

mybatis常用写法-mapper xml传入多个参数

mapper xml文件中:

1
2
3
4
5
6
7
8
9
10
<resultMap id="XxxResultMap" type="com.xxx.xxxx">
<id column="id" property="id" jdbcType="INTEGER" />
...
</resultMap>

<select id="selectXXXX" resultMap="XxxResultMap">
SELECT id, title, type, release_id , ...
FROM test
WHERE release_id = ${id} and type = ${type}
</select>  

mapper接口中:

1
xxx selectXXXX(@Param(value = "id") String id,@Param(value = "type") String type);

参考资料