| | |
| | | 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; |
| | |
| | | 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){ |
| | |
| | | |
| | | 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条,更新失败!"); |