MyBatis Plus——自定义配置——自定义属性——注入时间
生活随笔
收集整理的這篇文章主要介紹了
MyBatis Plus——自定义配置——自定义属性——注入时间
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
解決方案
// 自定義配置InjectionConfig cfg = new InjectionConfig() {@Overridepublic void initMap() {// to do nothingMap<String, Object> map = new HashMap<>();map.put("time", new SimpleDateFormat("HH:mm").format(new Date()));map.put("abc", this.getConfig().getGlobalConfig().getAuthor() + "-mp");this.setMap(map);}};mpg.setCfg(cfg);?
參考文章
https://mp.baomidou.com/guide/generator.html#自定義屬性注入
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的MyBatis Plus——自定义配置——自定义属性——注入时间的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MyBatis Plus——分页插件【P
- 下一篇: Velocity——模板中转换字符串首字