@Select("<script> select * from user where userId=#{user.userId} <if test="user.userName != null"> and userName = #{user.userName}</if> </script>")
@Results({
@Result(property = "userId",column = "userId"),
@Result(property = "userName",column = "userName"),
@Result(property = "msg",column = "msg"),
@Result(property = "telephones", javaType = List.class, column = "{userId=userId, shardName=shardName}", many = @Many(select = "com.limz.mysql.dsmysql.Dao.TelephoneDao.findTelephoneByUserId"))})
List<User> query(@Param("user") User user, @Param("shardName") String shardName);
@Select("select * from telephone where userId = #{userId}")
List<Telephone> findTelephoneByUserId(String shardName, String userId);
请问此处, 如何将主查询中的参数 shardName 传递到调用的@Many查询中
在主查询中,添加一列结果 #{shardName} as shardName ,在调用的查询中获取此参数