IDEA下 有很多 mybatis的外掛 如何判斷哪個最好用呢
那只有一個個試了
下面介紹下我一直在開發的MybatisCodeHelperPro外掛 外掛地址為: github.com/gejun123456…
外掛裡面大部分功能都是免費的 免費的功能可以一直使用下去 具體如下
功能點 | 未啟用版 | 啟用版 |
---|---|---|
介面與xml互相跳轉 高清圖示 可更換圖示 | ✔ | ✔ |
介面方法名重構 | ✔ | ✔ |
一鍵新增param註解 | ✔ | ✔ |
xml中的 param的自動提示 if test的自動提示 resultMap refid 等的自動提示 | ✔ | ✔ |
resultMap中的property的自動提示 | ✔ | ✔ |
檢測沒有使用的xml 可一鍵刪除 | ✔ | ✔ |
檢測mybatis介面中方法是否有實現,沒有則報紅 可建立一個空的xml方法塊 | ✔ | ✔ |
檢測resultmap的property是否有誤 | ✔ | ✔ |
支援spring 將mapper注入到spring中 intellij的spring注入不再報錯 支援springboot | ✔ | ✔ |
一鍵生成分頁查詢 | ✔ | ✔ |
一鍵新增resultMap中未被使用的屬性 | ✔ | ✔ |
一鍵生成mybatis介面的testcase | ✘ | ✔ |
通過方法名生成sql | ✘ | ✔ |
通過資料庫生成crud程式碼 | ✘ | ✔ |
通過java類生成crud程式碼 | ✘ | ✔ |
xml collection中的 param提示 | ✘ | ✔ |
識別mybatis的標籤 全自動sql補全 | ✘ | ✔ |
下面一一介紹下外掛的免費功能
介面與xml 互相跳轉 高清圖示 更改圖示 使用快捷鍵跳轉

介面方法名重構 resultMap重構 refid重構 等

一鍵新增param註解

xml中param的自動 提示 2.0.2版本支援新增jdbcType

if test的自動提示 對於每個param會提示是否等於null 對於string型別 會提示是否為null 是否為空串

resultMap中property的自動提示 refid 和 resultMap的自動提示

檢測 xml是否有對應介面 檢測介面方法是否有對應的xml

外掛 對spring 的支援
當沒有安裝外掛的時候 往一個 spring管理的物件中注入mybatis的介面 IDEA會標記這個mapper沒有找到 外掛新增了對mybatis @mapperScan註解 xml中MapperScannerConfigurer的支援 且支援萬用字元 * 和 **
對spring mapperScan的支援 MapperScannerConfigurer一樣的效果

對萬用字元的支援

一鍵生成查詢分頁操作 外掛依賴pageHelper 來做分頁處理

以上功能都是免費的
收費功能這裡就不介紹了 感興趣的可以看文件: gejun123456.github.io/MyBatisCode… 或者新增qq群:542735979