Commit e4efc6e6 authored by dahai's avatar dahai

上传

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