chenjiahe
2022-04-06 3295a41694171ab6695894887c3728efb094e5ad
优化
1个文件已修改
3 ■■■■■ 已修改文件
src/main/java/com/hx/mybatis/aes/springbean/InitMysqlData.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/hx/mybatis/aes/springbean/InitMysqlData.java
@@ -41,7 +41,6 @@
                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;
@@ -78,7 +77,6 @@
            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){
@@ -103,7 +101,6 @@
            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条,更新失败!");