# mybatis-sql-spring-boot-starter **Repository Path**: xsxgit/mybatis-sql-spring-boot-starter ## Basic Information - **Project Name**: mybatis-sql-spring-boot-starter - **Description**: mybatis完整SQL语句插件 - **Primary Language**: Java - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 4 - **Created**: 2020-11-02 - **Last Updated**: 2023-03-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mybatis-sql-spring-boot-starter

star

### 介绍 Mybatis完整SQL插件 ### 当前版本 *1.0.1* (已提交中央仓库) ### 安装教程 ``` mvn clean install ``` ### 使用说明 #### 一、准备工作 1. 添加依赖: ``` wiki.xsx mybatis-sql-spring-boot-starter 1.0.1 ``` 2. 开启日志: yml方式: ```yaml logging: level: wiki.xsx.core: debug ``` properties方式: ```properties logging.level.wiki.xsx.core=debug ``` #### 二、效果演示(与mybatis原始sql对比) ``` 2020-11-05 00:00:22.018 INFO 6596 --- [ main] wiki.xsx.learn.LearnApplication : ======================insert====================== 2020-11-05 00:00:22.182 DEBUG 6596 --- [ main] w.x.core.mybatis.MybatisSqlInterceptor : ==> MySQL: INSERT INTO test ( id,name,age,birthday,create_time ) VALUES( null,'张三',30,'1990-01-01','2020-11-05 00:00:22' ) 2020-11-05 00:00:22.184 DEBUG 6596 --- [ main] wiki.xsx.learn.TestDao.insert : ==> Preparing: INSERT INTO test ( id,name,age,birthday,create_time ) VALUES( ?,?,?,?,? ) 2020-11-05 00:00:22.227 DEBUG 6596 --- [ main] wiki.xsx.learn.TestDao.insert : ==> Parameters: null, 张三(String), 30(Integer), 1990-01-01(String), 2020-11-05 00:00:22.018(Timestamp) 2020-11-05 00:00:22.234 DEBUG 6596 --- [ main] wiki.xsx.learn.TestDao.insert : <== Updates: 1 2020-11-05 00:00:22.236 INFO 6596 --- [ main] wiki.xsx.learn.LearnApplication : ======================insert====================== 2020-11-05 00:00:22.237 INFO 6596 --- [ main] wiki.xsx.learn.LearnApplication : ======================update====================== 2020-11-05 00:00:22.238 DEBUG 6596 --- [ main] w.x.core.mybatis.MybatisSqlInterceptor : ==> MySQL: UPDATE test SET name = '张三',age = 32,birthday = '1990-01-01',create_time = '2020-11-05 00:00:22' WHERE id = 1 2020-11-05 00:00:22.238 DEBUG 6596 --- [ main] w.xsx.learn.TestDao.updateByPrimaryKey : ==> Preparing: UPDATE test SET name = ?,age = ?,birthday = ?,create_time = ? WHERE id = ? 2020-11-05 00:00:22.239 DEBUG 6596 --- [ main] w.xsx.learn.TestDao.updateByPrimaryKey : ==> Parameters: 张三(String), 32(Integer), 1990-01-01(String), 2020-11-05 00:00:22.237(Timestamp), 1(Integer) 2020-11-05 00:00:22.243 DEBUG 6596 --- [ main] w.xsx.learn.TestDao.updateByPrimaryKey : <== Updates: 1 2020-11-05 00:00:22.244 INFO 6596 --- [ main] wiki.xsx.learn.LearnApplication : ======================update====================== 2020-11-05 00:00:22.244 INFO 6596 --- [ main] wiki.xsx.learn.LearnApplication : ======================select====================== 2020-11-05 00:00:22.250 DEBUG 6596 --- [ main] w.x.core.mybatis.MybatisSqlInterceptor : ==> MySQL: SELECT id,name,age,birthday,create_time FROM test WHERE id = 1 AND name = '张三' AND age = 32 AND birthday = '1990-01-01' 2020-11-05 00:00:22.250 DEBUG 6596 --- [ main] wiki.xsx.learn.TestDao.select : ==> Preparing: SELECT id,name,age,birthday,create_time FROM test WHERE id = ? AND name = ? AND age = ? AND birthday = ? 2020-11-05 00:00:22.251 DEBUG 6596 --- [ main] wiki.xsx.learn.TestDao.select : ==> Parameters: 1(Integer), 张三(String), 32(Integer), 1990-01-01(String) 2020-11-05 00:00:22.271 DEBUG 6596 --- [ main] wiki.xsx.learn.TestDao.select : <== Total: 1 2020-11-05 00:00:22.272 INFO 6596 --- [ main] wiki.xsx.learn.LearnApplication : ======================select====================== 2020-11-05 00:00:22.272 INFO 6596 --- [ main] wiki.xsx.learn.LearnApplication : ======================delete====================== 2020-11-05 00:00:22.274 DEBUG 6596 --- [ main] w.x.core.mybatis.MybatisSqlInterceptor : ==> MySQL: DELETE FROM test WHERE id = 1 AND name = '张三' AND age = 30 AND birthday = '1990-01-01' AND create_time = '2020-11-05 00:00:22' 2020-11-05 00:00:22.274 DEBUG 6596 --- [ main] wiki.xsx.learn.TestDao.delete : ==> Preparing: DELETE FROM test WHERE id = ? AND name = ? AND age = ? AND birthday = ? AND create_time = ? 2020-11-05 00:00:22.275 DEBUG 6596 --- [ main] wiki.xsx.learn.TestDao.delete : ==> Parameters: 1(Integer), 张三(String), 30(Integer), 1990-01-01(String), 2020-11-05 00:00:22.272(Timestamp) 2020-11-05 00:00:22.277 DEBUG 6596 --- [ main] wiki.xsx.learn.TestDao.delete : <== Updates: 0 2020-11-05 00:00:22.277 INFO 6596 --- [ main] wiki.xsx.learn.LearnApplication : ======================delete====================== ```