diff --git a/yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbExecuteImpl.java b/yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbExecuteImpl.java index 4e3a0206693de334d4b86acfd9bc9e579c17f9fe..6b5bc06095cfb8083bce15406689e072db7412d9 100644 --- a/yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbExecuteImpl.java +++ b/yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbExecuteImpl.java @@ -155,8 +155,9 @@ public class DbExecuteImpl implements DbExecute { */ private void executeSql(SqlInfo sqlInfo, DbSqlFunction<Ref<Integer>, Long> sqlFunction) { // 开始记录日志 - LogInfoVo log = aspectLogStart.requestLog(sqlInfo.getTargetClass(), "Sql", - String.format("%s:%s", sqlInfo.getTargetClass().getSimpleName(), sqlInfo.getSqlName()), sqlInfo, true); + String url = String.format("%s:%s", sqlInfo.getTargetClass().getSimpleName(), sqlInfo.getSqlName()); + String sqlText = DbPrintSqlDefault.getStringSql(sqlInfo.getSql(), sqlInfo.getParas()); + LogInfoVo log = aspectLogStart.requestLog(sqlInfo.getTargetClass(), "Sql", url, sqlText, true); // 开始时间 long start = System.currentTimeMillis(); Ref<Integer> row = new Ref<>(0); diff --git a/yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbPrintSqlDefault.java b/yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbPrintSqlDefault.java index 9f4640cc547275033a553778504c9036c96920ca..4e33b32e60f6b9063378170ded221759d8351348 100644 --- a/yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbPrintSqlDefault.java +++ b/yzg-util-db/src/main/java/com/yanzuoguang/db/impl/DbPrintSqlDefault.java @@ -28,7 +28,7 @@ public class DbPrintSqlDefault implements DbPrintSql { * @param paras å‚æ•° * @return ä¸å¸¦å‚æ•°çš„SQLè¯å¥ */ - public String getStringSql(String sql, Object... paras) { + public static String getStringSql(String sql, Object... paras) { StringBuilder sb = new StringBuilder(); // 进行SQLè¯å¥å‚数替æ¢,åŽé¢å¢žåŠ ä¸€ä¸ªç©ºæ ¼ï¼Œæ–¹ä¾¿åŽç»ç”¨æ£åˆ™è¡¨è¾¾å¼è¿›è¡Œæ›¿æ¢å¤„ç†