@Select("SELECT FROM users") @Results({ @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) List<UserEntity> getAll(); @Select("SELECT FROM users WHERE id = #{id}")@Results({ @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) UserEntity getOne(Long id);如果我要寫多個方法是不是要有多個相同的Results(,如果在同一個類可以使用同一個Results(,那么我在不同的類是不是還要粘貼一樣的代碼,所以能不能將Results(注解放在結果類的上方
mybatis能否將results注解注釋在類的上方,而不是方法的上方?
呼如林
2018-07-22 09:04:10