diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java index e704003..7989a04 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -1179,11 +1179,37 @@ public class PatientController { public BaseResponse getPushVisitRecord(LymsPushVisitRecord visitRecord, int current, int size) { BaseResponse baseResponse = new BaseResponse(); try { - QueryWrapper query=new QueryWrapper(); - query.orderByDesc("createdtime"); - Page page= new Page<>(current,size); - Page visitRecordPage = lymsPushVisitRecordService.page(page,query); - baseResponse.setObject(visitRecordPage); + QueryWrapper query=new QueryWrapper(); + if(StringUtil.isNotEmpty(visitRecord.getStratTime())&&StringUtil.isNotEmpty(visitRecord.getEndTime())){ + query.apply("date_format(lpvr.createdtime,'%Y-%m-%d')>=date_format({0},'%Y-%m-%d')", visitRecord.getStratTime()); + query.apply("date_format(lpvr.createdtime,'%Y-%m-%d')<=date_format({0},'%Y-%m-%d')", visitRecord.getEndTime()); + } + if (null!=visitRecord.getHid()) { + query.eq("d.hid", visitRecord.getHid()); + } + if (null!=visitRecord.getDpid()) { + query.eq("d.dpid", visitRecord.getDpid()); + } + if (StringUtil.isNotEmpty(visitRecord.getPname())) { + query.like("lpvr.pname", visitRecord.getPname()); + } + if (StringUtil.isNotEmpty(visitRecord.getDname())) { + query.like("lpvr.dname", visitRecord.getDname()); + } + if (null!=visitRecord.getIid()) { + query.eq("lpvr.iid", visitRecord.getIid()); + } + if (null!=visitRecord.getState()) { + query.eq("lpvr.state", visitRecord.getState()); + } + if (null!=visitRecord.getType()) { + query.eq("lpvr.type", visitRecord.getType()); + } + query.orderByDesc("lpvr.createdtime"); + Page> page= new Page<>(current,size); + List> visitRecordList = lymsPushVisitRecordService.getPage(page,query); + page.setRecords(visitRecordList); + baseResponse.setObject(page); } catch (Exception e) { e.printStackTrace(); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPushVisitRecord.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPushVisitRecord.java index fbca1de..b24ad55 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPushVisitRecord.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPushVisitRecord.java @@ -9,7 +9,7 @@ import java.util.Date; import lombok.Data; /** - * + * 公众号推送 回访记录 * @TableName lyms_push_visit_record */ @TableName(value ="lyms_push_visit_record") @@ -93,6 +93,28 @@ public class LymsPushVisitRecord implements Serializable { @TableField(value = "update_time") private Date updateTime; + /** + * 医院id + */ + @TableField(exist = false) + private Integer hid; + /** + * 科室id + */ + @TableField(exist = false) + private Integer dpid; + /** + * 开始时间 + */ + @TableField(exist = false) + private String stratTime; + + /** + * 结束时间 + */ + @TableField(exist = false) + private String endTime; + @TableField(exist = false) private static final long serialVersionUID = 1L; diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPushVisitRecordMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPushVisitRecordMapper.java index 49e9e96..8337002 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPushVisitRecordMapper.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPushVisitRecordMapper.java @@ -1,13 +1,45 @@ package com.lyms.talkonlineweb.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.lyms.talkonlineweb.domain.LymsPushVisitRecord; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +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; /** * @Entity com.lyms.talkonlineweb.domain.LymsPushVisitRecord */ +@Mapper public interface LymsPushVisitRecordMapper extends BaseMapper { + @Select({""}) + List> getPage(Page> page,@Param(Constants.WRAPPER) QueryWrapper query); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPushVisitRecordService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPushVisitRecordService.java index b96cc60..1e867bb 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPushVisitRecordService.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPushVisitRecordService.java @@ -1,11 +1,17 @@ package com.lyms.talkonlineweb.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.lyms.talkonlineweb.domain.LymsPushVisitRecord; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; +import java.util.Map; + /** * */ public interface LymsPushVisitRecordService extends IService { + List> getPage(Page> page, QueryWrapper query); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPushVisitRecordServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPushVisitRecordServiceImpl.java index 5411e82..d2c9604 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPushVisitRecordServiceImpl.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPushVisitRecordServiceImpl.java @@ -1,18 +1,30 @@ package com.lyms.talkonlineweb.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.lyms.talkonlineweb.domain.LymsPushVisitRecord; import com.lyms.talkonlineweb.service.LymsPushVisitRecordService; import com.lyms.talkonlineweb.mapper.LymsPushVisitRecordMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; + /** * */ @Service public class LymsPushVisitRecordServiceImpl extends ServiceImpl implements LymsPushVisitRecordService{ + @Autowired + private LymsPushVisitRecordMapper lymsPushVisitRecordMapper; + @Override + public List> getPage(Page> page, QueryWrapper query) { + return lymsPushVisitRecordMapper.getPage(page,query); + } }