瀏覽代碼

添加代码

zhonghui 3 年之前
父節點
當前提交
0dd425b204

+ 5 - 2
boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoMapper.java

@@ -1,5 +1,6 @@
 package com.boman.web.core.mapper;
 
+import com.boman.common.datasource.annotation.Slave;
 import com.boman.web.core.domain.VaccineInfoOperation;
 
 import java.util.List;
@@ -31,8 +32,12 @@ public interface VaccineInfoMapper
     public List<VaccineInfoOperation> selectVaccineInfoList(VaccineInfoOperation vaccineInfo);
 
 
+    @Slave
     public List<VaccineInfoOperation> selectVaccineInfoListByPage(int startNum, int endNum);
 
+    @Slave
+    public int selectCount();
+
     /**
      * 新增疫苗信息
      * 
@@ -79,6 +84,4 @@ public interface VaccineInfoMapper
      * @return
      */
     public String selectSysDictDataByDictLabel(String vaccineName);
-
-    public int selectCount();
 }

+ 4 - 5
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java

@@ -43,16 +43,15 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     private VaccineInfoUserMapper vaccineInfoUserMapper;
 
     public void syncData() {
-        int count = vaccineInfoMapper.selectCount();
+        int count = 1;
+        int testcount = vaccineInfoMapper.selectCount();
+        System.out.println("testCount: " + testcount);
         int times = count / 1000;
         int startPage = 0;
         int endPage = 1000;
         for (int i = 0;i < times + 1;i++) {
             List<VaccineInfoOperation> list = vaccineInfoMapper.selectVaccineInfoListByPage(startPage, endPage);
-
-
-
-
+            this.save(list);
             startPage += 1000;
         }