Commit 1f6258b7 by zhangkb

修改文件管理加载可以根据多个机构编码加载数据

parent 4d923797
...@@ -59,10 +59,10 @@ public class UploadFileCtrl { ...@@ -59,10 +59,10 @@ public class UploadFileCtrl {
@ApiOperation(value = "根据条件加载下载文件信息", notes = "根据条件加载下载文件信息") @ApiOperation(value = "根据条件加载下载文件信息", notes = "根据条件加载下载文件信息")
@PostMapping(value = "/getByPageAndKeywordAndCode") @PostMapping(value = "/getByPageAndKeywordAndCode")
public Map<String,Object> getByPageAndKeywordAndCode(@RequestParam String code, public Map<String,Object> getByPageAndKeywordAndCode(@RequestParam List<String> codes,
@RequestParam(required = false)String keyword,@RequestParam(defaultValue = "0")int page, @RequestParam(required = false)String keyword,@RequestParam(defaultValue = "0")int page,
@RequestParam(defaultValue = "10")int rows)throws Exception{ @RequestParam(defaultValue = "10")int rows)throws Exception{
return uploadFileService.getByPageAndKeywordAndCode(code, keyword, page, rows); return uploadFileService.getByPageAndKeywordAndCodeIn(codes, keyword, page, rows);
} }
@ApiOperation(value = "批量删除文件信息", notes = "批量删除文件信息") @ApiOperation(value = "批量删除文件信息", notes = "批量删除文件信息")
......
...@@ -14,7 +14,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -14,7 +14,7 @@ import tk.mybatis.mapper.common.BaseMapper;
public interface UploadFileMapper extends BaseMapper<UploadFile>{ public interface UploadFileMapper extends BaseMapper<UploadFile>{
public int getByKeywordCount(Map<String,Object> param); public int getByKeywordCount(Map<String,Object> param);
public List<UploadFile> getPageByKeywordAndCode(Map<String,Object> param); public List<UploadFile> getPageByKeywordAndCodeIn(Map<String,Object> param);
public void deleteByIdIn(@Param("ids")List<Integer> ids); public void deleteByIdIn(@Param("ids")List<Integer> ids);
} }
...@@ -77,11 +77,11 @@ public class UploadFileService { ...@@ -77,11 +77,11 @@ public class UploadFileService {
} }
//加载上传文件列表 //加载上传文件列表
public Map<String,Object> getByPageAndKeywordAndCode(String code,String keyword, public Map<String,Object> getByPageAndKeywordAndCodeIn(List<String> codes,String keyword,
int page,int rows)throws Exception{ int page,int rows)throws Exception{
Map<String,Object> resultMap = new HashMap<>(); Map<String,Object> resultMap = new HashMap<>();
Map<String,Object> paramMap = new HashMap<>(); Map<String,Object> paramMap = new HashMap<>();
paramMap.put("code", code); paramMap.put("codes", codes);
if(StringUtils.isBlank(keyword)) { if(StringUtils.isBlank(keyword)) {
paramMap.put("keyword", null); paramMap.put("keyword", null);
}else { }else {
...@@ -93,7 +93,7 @@ public class UploadFileService { ...@@ -93,7 +93,7 @@ public class UploadFileService {
int start = page*rows; int start = page*rows;
paramMap.put("start", start); paramMap.put("start", start);
paramMap.put("end", rows); paramMap.put("end", rows);
List<UploadFile> resultList = uploadFileMapper.getPageByKeywordAndCode(paramMap); List<UploadFile> resultList = uploadFileMapper.getPageByKeywordAndCodeIn(paramMap);
resultMap.put("resultList", resultList); resultMap.put("resultList", resultList);
resultMap.put("total", count); resultMap.put("total", count);
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.keymobile.indicators.model.mapper.uploadfile.UploadFileMapper"> <mapper namespace="com.keymobile.indicators.model.mapper.uploadfile.UploadFileMapper">
<select id="getPageByKeywordAndCode" parameterType="map" resultType="com.keymobile.indicators.model.entity.uploadfile.UploadFile" > <select id="getPageByKeywordAndCodeIn" parameterType="map" resultType="com.keymobile.indicators.model.entity.uploadfile.UploadFile" >
select * select *
from indi_upload_file from indi_upload_file
where where
file_status="1" and file_status="1" and
code = #{code} code in
<if test="keyword!=null"> <foreach item="code" collection="codes" open="(" close=")" separator=",">
and file_name like #{keyword} #{code}
</if> </foreach>
<if test="keyword!=null">
and file_name like #{keyword}
</if>
order by upload_date desc order by upload_date desc
limit #{start},#{end} limit #{start},#{end}
</select> </select>
...@@ -19,7 +22,10 @@ ...@@ -19,7 +22,10 @@
from indi_upload_file from indi_upload_file
where where
file_status="1" and file_status="1" and
code = #{code} code in
<foreach item="code" collection="codes" open="(" close=")" separator=",">
#{code}
</foreach>
<if test="keyword!=null"> <if test="keyword!=null">
and file_name like #{keyword} and file_name like #{keyword}
</if> </if>
......
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