Commit b56faf09 authored by dahai's avatar dahai

修改查询XML分页查询总数量

修改查询EXCEL分页查询总数量
parent 71db789a
......@@ -174,14 +174,30 @@ public class ReadExcelApi {
* @return
*/
@RequestMapping("queryPersonPost")
public String queryPersonPost(@RequestParam("fileName") String fileName,@RequestParam("analysisState") String analysisState,@RequestParam("currPage") String currPage,@RequestParam("pageSize") String pageSize, HttpServletResponse resp) {
List<FileNameDicEntity> fileNameDicEntities = fileNameDicService.queryFileNameDic(fileName, Long.valueOf(analysisState), Long.valueOf(currPage), Long.valueOf(pageSize));
public String queryPersonPost(@RequestParam("fileName") String fileName,@RequestParam("analysisState") String analysisState,@RequestParam("uploadDate") String uploadDate, @RequestParam("currPage") String currPage,@RequestParam("pageSize") String pageSize, HttpServletResponse resp) {
List<FileNameDicEntity> fileNameDicEntities = fileNameDicService.queryFileNameDic(uploadDate,fileName, Long.valueOf(analysisState), Long.valueOf(currPage), Long.valueOf(pageSize));
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(fileNameDicEntities);
return yxjsonResponse.toJSONString();
}
/**
* 查询个人邮寄解析信息总数量
* @param fileName 文件名称
* @param analysisState 解析状态
* @param resp
* @return
*/
@RequestMapping("queryPersonPostCount")
public String queryPersonPostCount(@RequestParam("fileName") String fileName,@RequestParam("analysisState") String analysisState,@RequestParam("uploadDate") String uploadDate, HttpServletResponse resp) {
int i = fileNameDicService.queryFileNameDicCount(uploadDate, fileName, Long.valueOf(analysisState));
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(i+"");
return yxjsonResponse.toJSONString();
}
private String replaceDate(String str){
return str.replace("-","");
}
......
......@@ -127,16 +127,30 @@ public class ReadXmlApi {
/**
* 查询XML解析信息
* @param importDate 上传时间
* @param state 状态
* @param resp
* @return
*/
@RequestMapping("queryPersonXML")
public String queryPersonXMLCount(@RequestParam("importDate") String importDate,@RequestParam("currPage") String currPage,@RequestParam("pageSize") String pageSize, HttpServletResponse resp) {
List<CountDataEntity> countDataEntities = importXmlService.queryPersonXml(replaceDate(importDate),Long.valueOf(currPage)*Long.valueOf(pageSize) ,(Long.valueOf(currPage)-1)*Long.valueOf(pageSize)+1);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(countDataEntities);
return yxjsonResponse.toJSONString();
}
/**
* 查询XML解析信息总数量
* @param importDate 上传时间
* @param resp
* @return
*/
@RequestMapping("queryPersonXMLCount")
public String queryPersonXMLCount(@RequestParam("importDate") String importDate, HttpServletResponse resp) {
List<CountDataEntity> countDataEntities = importXmlService.queryPersonXmlCount(replaceDate(importDate));
int i = importXmlService.queryPersonXmlCount(replaceDate(importDate));
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(countDataEntities);
yxjsonResponse.outPutSuccess(i+"");
return yxjsonResponse.toJSONString();
}
......
......@@ -35,8 +35,6 @@ public interface FileNameDicMapper {
* 按条件查询个人邮寄字典表
* @param fileName 文件名称
* @param analysisState 解析状态
* @param currPage 当前页
* @param pageSize 每页数量
* @return
*/
@Select("select * from (select FILE_NAME_DIC.*,rownum rn from FILE_NAME_DIC " +
......@@ -44,10 +42,32 @@ public interface FileNameDicMapper {
"<if test='analysisState != -1' >" +
" and STATE =#{analysisState}" +
"</if>" +
"<if test='uploadDate !=null' >" +
" and to_char(UPLOAD_DATE,'yyyyMMdd') =#{uploadDate}" +
"</if>" +
"<if test='fileName != null ' >" +
" and FILE_NAME =#{fileName}" +
"</if> </where>" +
"and ROWNUM <= 40 ) where rn>= 21")
public List<FileNameDicEntity> queryFileNameDic(@Param("fileName") String fileName, @Param("analysisState") long analysisState, @Param("currPage") long currPage, @Param("pageSize") long pageSize);
"and ROWNUM <= #{maxNum} ) where rn>= #{minNum}")
public List<FileNameDicEntity> queryFileNameDic(@Param("uploadDate")String uploadDate,@Param("fileName") String fileName, @Param("analysisState") long analysisState, @Param("maxNum") long maxNum, @Param("minNum") long minNum);
/**
* 按条件查询个人邮寄字典表数量
* @param fileName 文件名称
* @param analysisState 解析状态
* @return
*/
@Select("select FILE_NAME_DIC.*,rownum rn from FILE_NAME_DIC " +
"<where> 1=1 " +
"<if test='analysisState != -1' >" +
" and STATE =#{analysisState}" +
"</if>" +
"<if test='uploadDate !=null' >" +
" and to_char(UPLOAD_DATE,'yyyyMMdd') =#{uploadDate}" +
"</if>" +
"<if test='fileName != null ' >" +
" and FILE_NAME =#{fileName}" +
"</if> </where>)")
public List<FileNameDicEntity> queryFileNameDicCount(@Param("uploadDate")String uploadDate,@Param("fileName") String fileName, @Param("analysisState") long analysisState);
}
......@@ -15,13 +15,27 @@ public interface FilesMapper {
public long insertFiles(FilesEntity filesEntity);
@Select("SELECT FILES.upload_date,count(PREPRO_PERSON.FILE_ID),count(prepro_person.JMSFZSLH) FROM PREPRO_PERSON\n" +
"left join FILES on PREPRO_PERSON.FILE_ID = FILES.ID\n" +
@Select("select * from (select upload_date upload_Date ,count(ID) package_Count,sum(sumCount) cardCount,sum(ordinaryCount) commonCardCount,sum(postCount) postCardCount ,rownum rn from (SELECT FILES.upload_date,FILES.ID,count(prepro_person.JMSFZSLH) as sumCount,\n" +
"sum(decode(PREPRO_PERSON.CARD_TYPE_ID,0,1,0)) as ordinaryCount ,sum(decode(PREPRO_PERSON.CARD_TYPE_ID,9,1,0)) as postCount\n" +
" FROM PREPRO_PERSON\n" +
"left join FILES on PREPRO_PERSON.FILE_ID = FILES.ID " +
"<where> 1=1" +
"<if test='importDate !=null'>" +
" and to_char(FILES.UPLOAD_DATE,'yyyyMMdd')= #{importDate}" +
"</if> </where>" +
"group by FILES.upload_date")
"group by FILES.upload_date,FILES.ID) where ROWNUM <= #{maxNum} group by upload_date" +
") where rn>= #{minNum}")
public List<CountDataEntity> selectFiles(@Param("importDate") String importDate,@Param("maxNum")long maxNum,@Param("minNum")long minNum);
@Select("select upload_date upload_Date ,count(ID) package_Count,sum(sumCount) cardCount,sum(ordinaryCount) commonCardCount,sum(postCount) postCardCount from (SELECT FILES.upload_date,FILES.ID,count(prepro_person.JMSFZSLH) as sumCount,\n" +
"sum(decode(PREPRO_PERSON.CARD_TYPE_ID,0,1,0)) as ordinaryCount ,sum(decode(PREPRO_PERSON.CARD_TYPE_ID,9,1,0)) as postCount\n" +
"FROM PREPRO_PERSON\n" +
"left join FILES on PREPRO_PERSON.FILE_ID = FILES.ID " +
"<where> 1=1" +
"<if test='importDate !=null'>" +
" and to_char(FILES.UPLOAD_DATE,'yyyyMMdd')= #{importDate}" +
"</if> </where>" +
"group by FILES.upload_date,FILES.ID) group by upload_date")
public List<CountDataEntity> selectFilesCount(@Param("importDate") String importDate);
}
......@@ -24,5 +24,12 @@ public interface FileNameDicService {
* @param pageSize 页面数量
* @return
*/
public List<FileNameDicEntity> queryFileNameDic(String fileName, long analysisState, long currPage, long pageSize);
public List<FileNameDicEntity> queryFileNameDic(String uploadDate,String fileName, long analysisState, long currPage, long pageSize);
/**
* 查询个人邮寄信息字典表数量
* @param fileName 文件名称
* @param analysisState 解析状态
* @return
*/
public int queryFileNameDicCount(String uploadDate,String fileName, long analysisState);
}
......@@ -14,5 +14,6 @@ public interface ImportXmlService {
public boolean importPersonXml(List<PreproPersonEntity> preproPersonEntities,FilesEntity filesEntity);
public List<CountDataEntity> queryPersonXmlCount(String importDate);
public List<CountDataEntity> queryPersonXml(String importDate, long maxNum, long minNum);
public int queryPersonXmlCount(String importDate);
}
......@@ -24,7 +24,12 @@ public class FileNameDicServiceImpl implements FileNameDicService {
}
@Override
public List<FileNameDicEntity> queryFileNameDic(String fileName, long analysisState, long currPage, long pageSize) {
return fileNameDicMapper.queryFileNameDic(fileName, analysisState, currPage, pageSize);
public List<FileNameDicEntity> queryFileNameDic(String uploadDate,String fileName, long analysisState, long currPage, long pageSize) {
return fileNameDicMapper.queryFileNameDic(uploadDate,fileName, analysisState, currPage*pageSize,(currPage-1)*pageSize+1 );
}
@Override
public int queryFileNameDicCount(String uploadDate,String fileName, long analysisState) {
return fileNameDicMapper.queryFileNameDicCount(uploadDate,fileName, analysisState ).size();
}
}
......@@ -39,8 +39,15 @@ public class ImportXmlServiceImpl implements ImportXmlService {
return true;
}
@Override
public List<CountDataEntity> queryPersonXmlCount(String importDate) {
return filesMapper.selectFilesCount(importDate);
public List<CountDataEntity> queryPersonXml(String importDate, long maxNum, long minNum) {
return filesMapper.selectFiles(importDate,maxNum,minNum);
}
@Override
public int queryPersonXmlCount(String importDate) {
return filesMapper.selectFilesCount(importDate).size();
}
}
......@@ -8,7 +8,10 @@ import com.yxproject.start.service.TaskListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.jws.Oneway;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class TaskListServiceImpl implements TaskListService {
......@@ -48,8 +51,9 @@ public class TaskListServiceImpl implements TaskListService {
@Override
public List<Object> selectByCountyAtACCU(String date) {
List<Object> objects = taskListMapper.selectByCountyAtACCU(date);
List<Map<String,Object>> list = new ArrayList<>();
for (Object o :objects){
//TODO 组合JSON
}
System.out.println(objects.toString()+"---------");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment