From a48817ffcb840ed803c813c010f3730eb7e9cb87 Mon Sep 17 00:00:00 2001
From: chenjiahe <763432473@qq.com>
Date: 星期三, 06 四月 2022 15:52:01 +0800
Subject: [PATCH] 优化

---
 src/main/java/com/hx/mybatis/aes/springbean/InitMysqlData.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/hx/mybatis/aes/springbean/InitMysqlData.java b/src/main/java/com/hx/mybatis/aes/springbean/InitMysqlData.java
index d1648b3..6e6b5fc 100644
--- a/src/main/java/com/hx/mybatis/aes/springbean/InitMysqlData.java
+++ b/src/main/java/com/hx/mybatis/aes/springbean/InitMysqlData.java
@@ -3,7 +3,7 @@
 import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
 import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
 import com.hx.common.annotations.MysqlHexAes;
-import com.hx.common.dao.CommonMapper;
+import com.hx.common.dao.mapper.CommonMapper;
 import com.hx.common.service.CommonService;
 import com.hx.exception.ServiceException;
 import com.hx.mybatisTool.SqlSentence;
@@ -41,6 +41,7 @@
                 for(FieldData fieldData:fieldDatas){
                     //鑾峰彇鏉℃暟
                     sqlSentence.sqlSentence("SELECT COUNT(0) FROM "+fieldData.getTableName(),values);
+                    System.out.println("sqlSentence3:"+sqlSentence.getSqlSentence());
                     int total = commonService.selectCountSql(sqlSentence);
                     if(total ==0 ){
                         continue;
@@ -77,6 +78,7 @@
             selectField.append(","+fieldName);
         }
         sqlSentence.sqlSentence("SELECT "+selectField.toString()+" FROM "+fieldData.getTableName()+" LIMIT "+pageNum+","+pageSize,values);
+        System.out.println("sqlSentence:"+sqlSentence.getSqlSentence());
         List<Map<String,Object>> list = commonService.selectListMap(CommonMapper.class,sqlSentence);
 
         for (Map<String,Object> map:list){
@@ -101,6 +103,8 @@
 
             values = map;
             sqlSentence.sqlSentence("UPDATE "+fieldData.getTableName()+" SET "+setField.toString()+" WHERE "+fieldData.getId()+" = #{m."+fieldData.getId()+"}",values);
+            System.out.println("sqlSentence2:"+sqlSentence.getSqlSentence());
+
             if(commonService.updateSentence(sqlSentence)!=1){
                 throw new ServiceException("鏇存柊瓒呰繃1鏉★紝鏇存柊澶辫触锛�");
             }

--
Gitblit v1.8.0