public R pageRequestParam MapString Object paramsZaixianzixunEntity zaixianzixun HttpServletRequest request String tableName = requestgetSessiongetAttributetableNametoString; iftableNameequalsyishe
public R page(@RequestParam Map<String, Object> params, ZaixianzixunEntity zaixianzixun, HttpServletRequest request){
//获取当前操作的表名
String tableName = request.getSession().getAttribute("tableName").toString();
//如果是医生表,则将医生账号添加到在线咨询实体中
if(tableName.equals("yisheng")) {
zaixianzixun.setYishengzhanghao((String)request.getSession().getAttribute("username"));
}
//如果是用户表,则将用户账号添加到在线咨询实体中
if(tableName.equals("yonghu")) {
zaixianzixun.setZhanghao((String)request.getSession().getAttribute("username"));
}
//构造查询条件
EntityWrapper
//返回结果
return R.ok().put("data", page);
原文地址: https://www.cveoy.top/t/topic/eFz4 著作权归作者所有。请勿转载和采集!