@Autowired注入靜態mapper

以前寫一個工具類,須要在static方法中讀取db數據進行判斷,但發現靜態mapper按照正常的寫法是沒法注入的,最後Google後解決問題,代碼以下:web @Service public class TestUtil { private static UserMapper userMapper; @Autowired public void setUserMappe
相關文章
相關標籤/搜索