Commit 49a99085 authored by suichenguang's avatar suichenguang

新包日志查询

parent 19fbecc3
package com.yxproject.start.api;
import com.yxproject.start.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("LogApi")
public class LogApi {
@Autowired
private LogService logService;
@RequestMapping("createAnalysisLog")
public boolean createAnalysisLog(HttpServletResponse response) {
return true;
}
/**
* 查询新包生成日志
* @param newFileName 新文件名
* @param cardId 身份证号
* @param createDate 生成时间
* @param uploadCountyName 上传地区
* @param currPage 页数
* @param pageSize 行数
* @return
*/
@RequestMapping("selectNewFilesLog")
public List<Map<String,Object>> selectNewFilesLog (@RequestParam("newFileName")String newFileName, @RequestParam("cardId")String cardId, @RequestParam("createDate")String createDate, @RequestParam("uploadCountyName")String uploadCountyName, @RequestParam("currPage")String currPage, @RequestParam("pageSize")String pageSize){
List<Map<String,Object>> result = logService.selectNewFilesLog(newFileName,cardId,createDate,uploadCountyName, Long.valueOf(currPage),Long.valueOf(pageSize));
return result;
}
}
package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@Mapper
public interface LogMapper {
@Insert("")
public boolean insertAnalysisLog();
@Select("")
public List<Map<String,Object>> selectAnalysisLog(String fileName,String analysisDate);
@Select("<script> " +
"SELECT * FROM " +
" ( " +
" SELECT A.*, ROWNUM RN " +
" FROM (SELECT NEW_FILE_NAME,CREATE_DATE,RECORD_NUMBER,DWDM,DWMC FROM NEW_FILES " +
" LEFT JOIN PREPRO_PERSON ON NEW_FILES.ID = PREPRO_PERSON.NEW_FILE_ID" +
" where 1=1 " +
" <if test='newFileName !=\"\"' >" +
" and NEW_FILES.NEW_FILE_NAME=#{newFileName} " +
" </if>" +
" <if test='cardId !=\"\"' >" +
" and NEW_FILES.DWMC=#{cardId}" +
" </if>" +
" <if test='createDate !=\"\"' >" +
" and substr(NEW_FILES.CREATE_DATE,0,8)=#{createDate}" +
" </if>" +
" <if test='uploadCountyName !=\"\"' >" +
" and PREPRO_PERSON.GMSFHM=#{uploadCountyName} " +
" </if>" +
" ) " +
" A" +
" )" +
" WHERE RN BETWEEN #{end} AND #{begin}" +
"</script>")
public List<Map<String,Object>> selectNewFilesLog(@Param("newFileName") String newFileName, @Param("cardId") String cardId, @Param("createDate") String createDate,@Param("uploadCountyName") String uploadCountyName, @Param("begin") long begin, @Param("end") long end);
}
package com.yxproject.start.service;
import java.util.List;
import java.util.Map;
public interface LogService {
public List<Map<String,Object>> selectNewFilesLog(String newFileName,String cardId,String createDate,String uploadCountyName,long currPage,long pageSize);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.mapper.LogMapper;
import com.yxproject.start.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class LogServiceImpl implements LogService {
@Autowired
private LogMapper logMapper;
@Override
public List<Map<String, Object>> selectNewFilesLog(String newFileName, String cardId, String createDate, String uploadCountyName, long currPage, long pageSize) {
List<Map<String, Object>> resultMap= logMapper.selectNewFilesLog(newFileName,cardId,createDate,uploadCountyName,currPage * pageSize, (currPage - 1) * pageSize + 1);
return resultMap;
}
}
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