b
zhouxiang
2022-04-24 3261046de3da38bfc68d4bd8fa9140e0044d2715
b
2个文件已修改
14 ■■■■ 已修改文件
src/main/java/com/hx/mybatis/aes/springbean/InitMysqlData.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/hx/mybatis/aes/springbean/SqlUtils.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/hx/mybatis/aes/springbean/InitMysqlData.java
@@ -76,6 +76,8 @@
        for(String fieldName:fieldData.getEncrypFields()){
            selectField.append(","+fieldName);
        }
        pageNum = pageNum*pageSize;
        sqlSentence.sqlSentence("SELECT "+selectField.toString()+" FROM "+fieldData.getTableName()+" LIMIT "+pageNum+","+pageSize,values);
        List<Map<String,Object>> list = commonService.selectListMap(CommonMapper.class,sqlSentence);
src/main/java/com/hx/mybatis/aes/springbean/SqlUtils.java
@@ -42,7 +42,13 @@
        //解析select查询
        //SQLSelect sqlSelect = sqlStatement.getSelect()
        //获取sql查询块
        SQLSelectQueryBlock sqlSelectQuery = (SQLSelectQueryBlock)sqlStatement.getSelect().getQuery() ;
        SQLSelectQueryBlock sqlSelectQuery;
        try{
            sqlSelectQuery = (SQLSelectQueryBlock)sqlStatement.getSelect().getQuery() ;
        }catch (Exception e){
            return sql;
        }
        StringBuffer out = new StringBuffer() ;
        //创建sql解析的标准化输出
        SQLASTOutputVisitor sqlastOutputVisitor = SQLUtils.createFormatOutputVisitor(out , null , JdbcUtils.MYSQL) ;
@@ -415,7 +421,7 @@
            }
        }
        splicingSql.append(sqlWhere.toString());
        splicingSql.append(sqlWhere);
        return splicingSql.toString();
    }
@@ -493,7 +499,7 @@
            }
        }
        splicingSql.append(sqlWhere.toString());
        splicingSql.append(sqlWhere);
        return splicingSql.toString();
    }