文档库--代替标准分页
This commit is contained in:
+16
@@ -77,6 +77,22 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 代替标准分页列表查询
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "代替标准分页列表查询")
|
||||
@ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询")
|
||||
@PostMapping(value = "/replacePageInfo")
|
||||
@ResponseBody
|
||||
public JSONObject replacePageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.replacePageInfo(parameter);
|
||||
Result<IPage> ok = Result.OK(infoPage);
|
||||
JSONObject jsonResult = JSONObject.fromObject(ok);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
|
||||
+18
@@ -17,9 +17,27 @@ public interface BussDocumentLibraryEOMapper extends BaseMapper<BussDocumentLibr
|
||||
int insertInfo(@Param("insertField") String insertField,
|
||||
@Param("insertValue") String insertValue);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page
|
||||
* @param field
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
IPage getInfoPage(@Param("page") IPage page,
|
||||
@Param("field") String field,
|
||||
@Param("condition") String condition);
|
||||
|
||||
/**
|
||||
* 代替标准分页
|
||||
* @param page
|
||||
* @param field
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
IPage replacePageInfo(@Param("page") IPage page,
|
||||
@Param("field") String field,
|
||||
@Param("condition") String condition);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -44,5 +44,10 @@
|
||||
select ${field} from buss_document_library
|
||||
${condition}
|
||||
</select>
|
||||
<!--代替标准分页-->
|
||||
<select id="replacePageInfo" resultType="java.util.LinkedHashMap">
|
||||
select ${field} from buss_document_library
|
||||
${condition}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
+7
@@ -100,5 +100,12 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
|
||||
*/
|
||||
IPage getInfoPage(Map<String,Object> parameter);
|
||||
|
||||
/**
|
||||
* 代替标准分页
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
IPage replacePageInfo(Map<String,Object> parameter);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+50
@@ -485,6 +485,56 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
return mustValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 代替标准分页
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
public IPage replacePageInfo(Map<String, Object> parameter) {
|
||||
//查询内容
|
||||
String field = " id,serial_number,title,state";
|
||||
|
||||
//查询条件
|
||||
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
|
||||
|
||||
//编码
|
||||
String serialNumber = (String) parameter.get("serial_number");
|
||||
|
||||
//标题
|
||||
String title = (String) parameter.get("title");
|
||||
if(StringUtils.isNotBlank(serialNumber)){
|
||||
conditionSb.append(" and " + "serial_number" + " like concat(concat('%','" + serialNumber + "'),'%')");
|
||||
}
|
||||
if(StringUtils.isNotBlank(title)){
|
||||
conditionSb.append(" and " + "title" + " like concat(concat('%','" + title + "'),'%')");
|
||||
}
|
||||
|
||||
conditionSb.append(" order by create_time desc");
|
||||
int pageNo = Integer.parseInt(parameter.get("pageNo").toString());
|
||||
int pageSize = Integer.parseInt(parameter.get("pageSize").toString());
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
|
||||
IPage infoPage = bussDocumentLibraryEOMapper.replacePageInfo(page, field, conditionSb.toString());
|
||||
|
||||
//数据字典
|
||||
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||
//下拉选处理数据字典
|
||||
List records = infoPage.getRecords();
|
||||
for (Object record : records) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||
if("state".equals(entry.getKey())){
|
||||
//状态数据字典
|
||||
List<SysDictItem> stateList = sysDictItems.stream().filter(e -> e.getDictCode().equals("state")).collect(Collectors.toList());
|
||||
List<SysDictItem> state = stateList.stream().filter(e -> e.getItemValue().equals(entry.getValue())).collect(Collectors.toList());
|
||||
entry.setValue(state.get(0).getItemText());
|
||||
}
|
||||
}
|
||||
}
|
||||
return infoPage;
|
||||
}
|
||||
|
||||
|
||||
public IPage getInfoPage(Map<String, Object> parameter) {
|
||||
//需要查询的字段
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
|
||||
|
||||
Reference in New Issue
Block a user