Commit e4efc6e6 authored by dahai's avatar dahai

上传

parent f5165787
......@@ -37,7 +37,8 @@ public interface FileNameDicMapper {
* @param analysisState 解析状态
* @return
*/
@Select("select * from (select FILE_NAME_DIC.*,rownum rn from FILE_NAME_DIC " +
@Select("<script> " +
"select * from (select FILE_NAME_DIC.*,rownum rn from FILE_NAME_DIC " +
"<where> 1=1 " +
"<if test='analysisState != -1' >" +
" and STATE =#{analysisState}" +
......@@ -47,8 +48,10 @@ public interface FileNameDicMapper {
"</if>" +
"<if test='fileName != null ' >" +
" and FILE_NAME =#{fileName}" +
"</if> </where>" +
"and ROWNUM <= #{maxNum} ) where rn>= #{minNum}")
"</if>" +
" </where>" +
"and ROWNUM less then #{maxNum} ) where rn more then #{minNum} " +
"</script>")
public List<FileNameDicEntity> queryFileNameDic(@Param("uploadDate")String uploadDate,@Param("fileName") String fileName, @Param("analysisState") long analysisState, @Param("maxNum") long maxNum, @Param("minNum") long minNum);
/**
......@@ -57,7 +60,7 @@ public interface FileNameDicMapper {
* @param analysisState 解析状态
* @return
*/
@Select("select FILE_NAME_DIC.*,rownum rn from FILE_NAME_DIC " +
@Select("<script> select FILE_NAME_DIC.*,rownum rn from FILE_NAME_DIC " +
"<where> 1=1 " +
"<if test='analysisState != -1' >" +
" and STATE =#{analysisState}" +
......@@ -67,7 +70,7 @@ public interface FileNameDicMapper {
"</if>" +
"<if test='fileName != null ' >" +
" and FILE_NAME =#{fileName}" +
"</if> </where>)")
"</if> </where> </script>")
public List<FileNameDicEntity> queryFileNameDicCount(@Param("uploadDate")String uploadDate,@Param("fileName") String fileName, @Param("analysisState") long analysisState);
}
......@@ -15,27 +15,40 @@ public interface FilesMapper {
public long insertFiles(FilesEntity filesEntity);
@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,FILES.ID) where ROWNUM <= #{maxNum} group by upload_date" +
") where rn>= #{minNum}")
@Select("<script> " +
"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, " +
"sum(decode(PREPRO_PERSON.CARD_TYPE_ID,0,1,0)) as ordinaryCount ,sum(decode(PREPRO_PERSON.CARD_TYPE_ID,9,1,0)) as postCount " +
" FROM PREPRO_PERSON " +
"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> "+
"group by FILES.upload_date,FILES.ID) where ROWNUM less then #{maxNum} group by upload_date" +
") where rn more then #{minNum} </script>")
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")
@Select({"<script>"+
"select upload_date upload_Date," +
"count(ID) package_Count," +
"sum(sumCount) cardCount," +
"sum(ordinaryCount) commonCardCount," +
"sum(postCount) postCardCount " +
"FROM (SELECT FILES.upload_date upload_date,FILES.ID," +
"count(prepro_person.JMSFZSLH) as sumCount," +
"sum(decode(PREPRO_PERSON.CARD_TYPE_ID,0,1,0)) as ordinaryCount," +
"sum(decode(PREPRO_PERSON.CARD_TYPE_ID,9,1,0)) as postCount " +
"FROM PREPRO_PERSON " +
"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>"+
" group by FILES.upload_date,FILES.ID)a" +
" group by a.upload_date " +
"select * from PREPRO_PERSON"+
"</script>"})
public List<CountDataEntity> selectFilesCount(@Param("importDate") String importDate);
}
......@@ -6,6 +6,7 @@ import com.yxproject.start.entity.TaskList.TaskListEntity;
import org.apache.ibatis.annotations.*;
import java.util.List;
import java.util.Map;
/**
* @author Administrator
......@@ -39,7 +40,7 @@ public interface TaskListMapper {
"left join CARD_TYPE_DIC on PREPRO_PERSON.card_type_id = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"left join county_dic on substr(PREPRO_PERSON.JMSFZSLH,0,6)= county_dic.COUNTY_CODE\n" +
"where county_dic.COUNTY_CODE is not null and to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{submitDate}")
public List<Object> selectByCountyAtACCU(@Param("submitDate") String submitDate);
public List<Map<String,Object>> selectByCountyAtACCU(@Param("submitDate") String submitDate);
/**
......
......@@ -26,9 +26,11 @@ public class FileNameDicServiceImpl implements FileNameDicService {
@Override
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 );
// return null;
}
@Override
public int queryFileNameDicCount(String uploadDate,String fileName, long analysisState) {
// return 2;
return fileNameDicMapper.queryFileNameDicCount(uploadDate,fileName, analysisState ).size();
}
......
......@@ -43,11 +43,12 @@ public class ImportXmlServiceImpl implements ImportXmlService {
@Override
public List<CountDataEntity> queryPersonXml(String importDate, long maxNum, long minNum) {
return filesMapper.selectFiles(importDate,maxNum,minNum);
// return null;
}
@Override
public int queryPersonXmlCount(String importDate) {
// return 2;
return filesMapper.selectFilesCount(importDate).size();
}
}
......@@ -5,11 +5,13 @@ import com.yxproject.start.entity.TaskList.CountGajgEntity;
import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.mapper.TaskListMapper;
import com.yxproject.start.service.TaskListService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.jws.Oneway;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -50,14 +52,17 @@ public class TaskListServiceImpl implements TaskListService {
@Override
public List<Object> selectByCountyAtACCU(String date) {
List<Object> objects = taskListMapper.selectByCountyAtACCU(date);
List<Map<String, Object>> maps = taskListMapper.selectByCountyAtACCU(date);
List<Map<String,Object>> list = new ArrayList<>();
for (Object o :objects){
for (Map o :maps){
//TODO 组合JSON
Map<String,Object> countyMap = new LinkedHashMap<>();
countyMap.containsKey((Map<String,Object>)o);
}
System.out.println(objects.toString()+"---------");
System.out.println(maps.toString()+"---------");
return null;
......
......@@ -18,6 +18,6 @@ spring:
mybatis:
type-aliases-package: com.yxproject.start.entity
#加载Mybatis配置文件
mapper-locations: classpath:mapper/*Mapper.xml
mapper-locations: classpath:mapper/config/*Mapper.xml
config-location: classpath:mapper/config/mybatis-config.xml
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