0
我寫了一個查詢幫助: -的MyBatis/ibatis的: - 關於ibatis的/ MyBatis的查詢
<select id="fetchEndPointArn" parameterType="map" resultType="com.rohit.service.model.UserActive">
select userid,endpointarns from t_user_actives where sid=#{sid}
and (userid in
<foreach item="userid" index="index" collection="userid" open="(" separator="," close=")">
#{userid}
</foreach>
)
</select>
我DaoImpl: -
@Override
public List<UserActive> fetchEndPointArn(Map<String,String> map) {
List<UserActive> userActive=sqlSession.selectList("fetchEndPointArn",map);
return userActive;
}
地圖,我傳遞包含: -
sid=10,userid=t10,t12
我收到一個例外說: -
Error evaluating expression 'userid'. Return value (t10,t12) was not iterable
試圖爲'item'和'collection'使用不同的參數名稱。 – Blank