Commit a2d3e0ae authored by suichenguang's avatar suichenguang

信息管理2.6

parent e86ddf00
......@@ -5,6 +5,7 @@ import com.yxproject.start.service.InfoManagementService;
import org.apache.ibatis.annotations.Param;
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 java.util.List;
......@@ -15,11 +16,21 @@ public class InfoManagementApi {
@Autowired
private InfoManagementService infoManagementService;
@RequestMapping("selectInfoManagement")
public List<NewFilesEntity>selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate){
List<NewFilesEntity> resultList = infoManagementService.selectInfoManagement(beginFileName, endFileName, gajgMc, replaceDate(beginDate), replaceDate(endDate));
public List<NewFilesEntity>selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate, @RequestParam("currPage")String currPage, @RequestParam("pageSize")String pageSize){
List<NewFilesEntity> resultList = infoManagementService.selectInfoManagement(beginFileName, endFileName, gajgMc, replaceDate(beginDate), replaceDate(endDate), Long.valueOf(currPage),Long.valueOf(pageSize));
return resultList;
}
@RequestMapping("selectCount")
public long selectCount(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate){
long count= infoManagementService.count(beginFileName,endFileName,gajgMc,beginDate,endDate);
return count;
}
/**
* 去除字符串中中线
* @param str
......
......@@ -11,8 +11,31 @@ import java.util.Map;
public interface InfoManagementMapper {
@Select( "SELECT * FROM " +
" ( " +
" SELECT A.*, ROWNUM RN " +
"<script> " +
"FROM (select * from new_files \n" +
"where 1=1\n" +
"<if test='beginFileName != \"\" '>" +
"and (NEW_FILE_NAME between(#{beginFileName})and (#{endFileName}))\n" +
"</if>" +
"<if test='gajgMc != \"\" '>" +
"and DWMC=#{gajgMc}\n" +
"</if>" +
"<if test='beginDate != \"\" '>" +
"and (subStr(CREATE_DATE,0,8) between(#{beginDate})and(#{endDate}))"+
"</if>" +
") " +
"A" +
")" +
"WHERE RN BETWEEN #{end} AND #{begin}" +
"</script>")
public List<NewFilesEntity> selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate, @Param("begin") long begin, @Param("end") long end);
@Select("<script> " +
"select * from new_files \n" +
"SELECT COUNT(*) FROM NEW_FILES \n" +
"where 1=1\n" +
"<if test='beginFileName != \"\" '>" +
"and (NEW_FILE_NAME between(#{beginFileName})and (#{endFileName}))\n" +
......@@ -24,5 +47,10 @@ public interface InfoManagementMapper {
"and (subStr(CREATE_DATE,0,8) between(#{beginDate})and(#{endDate}))"+
"</if>" +
"</script>")
public List<NewFilesEntity> selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
public long count(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
}
......@@ -6,5 +6,9 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface InfoManagementService {
public List<NewFilesEntity> selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
public List<NewFilesEntity> selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate,@Param("begin")long begin,@Param("end")long end);
public long count(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
}
......@@ -15,10 +15,16 @@ public class InfoManagementServiceImpl implements InfoManagementService {
@Override
public List<NewFilesEntity> selectInfoManagement(String beginFileName, String endFileName, String gajgMc, String beginDate, String endDate) {
public List<NewFilesEntity> selectInfoManagement(String beginFileName, String endFileName, String gajgMc, String beginDate, String endDate,long currPage,long pageSize) {
List<NewFilesEntity> newFilesEntities = infoManagementMapper.selectInfoManagement(beginFileName, endFileName, gajgMc, beginDate, endDate);
List<NewFilesEntity> newFilesEntities = infoManagementMapper.selectInfoManagement(beginFileName, endFileName, gajgMc, beginDate, endDate,currPage * pageSize,(currPage - 1) * pageSize + 1);
return newFilesEntities;
}
@Override
public long count(String beginFileName, String endFileName, String gajgMc, String beginDate, String endDate) {
long count= infoManagementMapper.count(beginFileName,endFileName,gajgMc,beginDate,endDate);
return count;
}
}
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