-1. 前言
0. Utools应用安装
- 官网地址: https://u.tools/
- 插件名称: SqlConvert
- 如果遇到插件有问题,可以在gitee 提交Issue 或者在utools插件下提交评论
1. 安装运行
- 下载项目到本地
git clone git@gitee.com:chargeduck/utools_sql_convert_vue.git
- 使用
npm运行
npm install npm run dev
- 启动之后访问localhost:5173
2. 在Utools中调试
1. 创建插件信息
- 新建Utools项目

- 填写项目信息

- 选择
plugin.json,这个文件的位置在项目目录的utools文件夹下

2. 调试
1. 实时调试
- 进入到项目的
utools文件夹下 - 修改
plugin.json
{ "main": "http://localhost:5173/index.html", }
- 在刚才选择
plugin.json的地方,刷新一下 - 输入关键字激活
SqlConvert插件, 想要其他的可以在加
{ "cmds": [ "sql转换", "转换", "MybatisLogsFormat", "代码生成", "Mybatis" ] }
- 在
vscode或者WebStorm中更改代码,utools插件内就会自动更新
2. 打包测试
-
进入项目根目录
-
执行打包命令
npm run build
- 将生成的
dist目录,移动到utools文件夹下 - 修改
plugin.json
{ "main": "dist/index.html", }
- 刷新
utools中的plugin.json
3. 功能说明
1. 列转in
- 列转in语句

- 添加括号

2. 列转foreach
- 字段转foreach

- 批量删除或者只需要一个字段的场景

3. 批量插入

4. 批量更新

5. 代码生成
- 点击配置 添加配置信息

- 设置自定义的类型映射

- 查看模板

- 使用

6. MybaitsLogFormat
