数据问题fix

main
tamguo 7 years ago
parent 613cc21130
commit 684833087a

@ -1,16 +1,10 @@
package com.tamguo.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.tamguo.config.dao.SuperMapper;
import com.tamguo.model.ChapterEntity;
public interface ChapterMapper extends SuperMapper<ChapterEntity>{
List<ChapterEntity> queryList(Pagination questionPage);
Integer queryCount(@Param(value="uid")String uid);
}

@ -1,5 +1,6 @@
package com.tamguo.service.impl;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -12,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.Condition;
import com.baomidou.mybatisplus.plugins.Page;
import com.tamguo.dao.ChapterMapper;
import com.tamguo.dao.CourseMapper;
@ -48,13 +50,14 @@ public class ChapterService implements IChapterService{
@Autowired
private CrawlerChapterMapper crawlerChapterMapper;
@SuppressWarnings("unchecked")
@Override
public void modifyQuestionNum() {
int page = 1;
int pageSize = 100;
while(true) {
Page<ChapterEntity> chapterPage = new Page<ChapterEntity>(page , pageSize);
List<ChapterEntity> chapterList = chapterMapper.queryList(chapterPage);
Page<ChapterEntity> chapterPage = new Page<>(page, pageSize);
List<ChapterEntity> chapterList = chapterMapper.selectPage(chapterPage, Condition.create().orderAsc(Arrays.asList("id")));
for(int i=0 ;i<chapterList.size() ; i++) {
// 处理数据
ChapterEntity chapter = chapterList.get(i);

@ -0,0 +1 @@
/bin/

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tamguo-mms</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Loading…
Cancel
Save