Commit 3e71410e0fecb6e1ca5b8e21c67497d6bf1114fc

Authored by shiyang
1 parent 8bb0170de8
Exists in master and in 1 other branch dev

PC-查看医生回访推送公众号记录,增加筛选

Showing 5 changed files with 104 additions and 6 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java View file @ 3e71410
... ... @@ -1179,11 +1179,37 @@
1179 1179 public BaseResponse getPushVisitRecord(LymsPushVisitRecord visitRecord, int current, int size) {
1180 1180 BaseResponse baseResponse = new BaseResponse();
1181 1181 try {
1182   - QueryWrapper<LymsPushVisitRecord> query=new QueryWrapper();
1183   - query.orderByDesc("createdtime");
1184   - Page<LymsPushVisitRecord> page= new Page<>(current,size);
1185   - Page<LymsPushVisitRecord> visitRecordPage = lymsPushVisitRecordService.page(page,query);
1186   - baseResponse.setObject(visitRecordPage);
  1182 + QueryWrapper query=new QueryWrapper();
  1183 + if(StringUtil.isNotEmpty(visitRecord.getStratTime())&&StringUtil.isNotEmpty(visitRecord.getEndTime())){
  1184 + query.apply("date_format(lpvr.createdtime,'%Y-%m-%d')>=date_format({0},'%Y-%m-%d')", visitRecord.getStratTime());
  1185 + query.apply("date_format(lpvr.createdtime,'%Y-%m-%d')<=date_format({0},'%Y-%m-%d')", visitRecord.getEndTime());
  1186 + }
  1187 + if (null!=visitRecord.getHid()) {
  1188 + query.eq("d.hid", visitRecord.getHid());
  1189 + }
  1190 + if (null!=visitRecord.getDpid()) {
  1191 + query.eq("d.dpid", visitRecord.getDpid());
  1192 + }
  1193 + if (StringUtil.isNotEmpty(visitRecord.getPname())) {
  1194 + query.like("lpvr.pname", visitRecord.getPname());
  1195 + }
  1196 + if (StringUtil.isNotEmpty(visitRecord.getDname())) {
  1197 + query.like("lpvr.dname", visitRecord.getDname());
  1198 + }
  1199 + if (null!=visitRecord.getIid()) {
  1200 + query.eq("lpvr.iid", visitRecord.getIid());
  1201 + }
  1202 + if (null!=visitRecord.getState()) {
  1203 + query.eq("lpvr.state", visitRecord.getState());
  1204 + }
  1205 + if (null!=visitRecord.getType()) {
  1206 + query.eq("lpvr.type", visitRecord.getType());
  1207 + }
  1208 + query.orderByDesc("lpvr.createdtime");
  1209 + Page<Map<String,Object>> page= new Page<>(current,size);
  1210 + List<Map<String,Object>> visitRecordList = lymsPushVisitRecordService.getPage(page,query);
  1211 + page.setRecords(visitRecordList);
  1212 + baseResponse.setObject(page);
1187 1213 } catch (Exception e) {
1188 1214 e.printStackTrace();
1189 1215 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPushVisitRecord.java View file @ 3e71410
... ... @@ -9,7 +9,7 @@
9 9 import lombok.Data;
10 10  
11 11 /**
12   - *
  12 + * 公众号推送 回访记录
13 13 * @TableName lyms_push_visit_record
14 14 */
15 15 @TableName(value ="lyms_push_visit_record")
... ... @@ -92,6 +92,28 @@
92 92 */
93 93 @TableField(value = "update_time")
94 94 private Date updateTime;
  95 +
  96 + /**
  97 + * 医院id
  98 + */
  99 + @TableField(exist = false)
  100 + private Integer hid;
  101 + /**
  102 + * 科室id
  103 + */
  104 + @TableField(exist = false)
  105 + private Integer dpid;
  106 + /**
  107 + * 开始时间
  108 + */
  109 + @TableField(exist = false)
  110 + private String stratTime;
  111 +
  112 + /**
  113 + * 结束时间
  114 + */
  115 + @TableField(exist = false)
  116 + private String endTime;
95 117  
96 118 @TableField(exist = false)
97 119 private static final long serialVersionUID = 1L;
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsPushVisitRecordMapper.java View file @ 3e71410
1 1 package com.lyms.talkonlineweb.mapper;
2 2  
  3 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Constants;
  5 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
3 6 import com.lyms.talkonlineweb.domain.LymsPushVisitRecord;
4 7 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  8 +import org.apache.ibatis.annotations.Mapper;
  9 +import org.apache.ibatis.annotations.Param;
  10 +import org.apache.ibatis.annotations.Select;
5 11  
  12 +import java.util.List;
  13 +import java.util.Map;
  14 +
6 15 /**
7 16 * @Entity com.lyms.talkonlineweb.domain.LymsPushVisitRecord
8 17 */
  18 +@Mapper
9 19 public interface LymsPushVisitRecordMapper extends BaseMapper<LymsPushVisitRecord> {
10 20  
  21 + @Select({"<script>",
  22 + "SELECT ",
  23 + "lpvr.id, ",
  24 + "lpvr.pid, ",
  25 + "lpvr.pname, ",
  26 + "lpvr.did, ",
  27 + "lpvr.dname, ",
  28 + "lpvr.iid, ",
  29 + "lpvr.iiname, ",
  30 + "lpvr.content, ",
  31 + "lpvr.type, ",
  32 + "lpvr.state, ",
  33 + "lpvr.remark, ",
  34 + "lpvr.createdtime, ",
  35 + "d.hid, ",
  36 + "d.dpid ",
  37 + "FROM ",
  38 + "(lyms_push_visit_record lpvr ",
  39 + "LEFT JOIN lyms_doctor d ON (d.did = lpvr.did) ) ",
  40 + "${ew.customSqlSegment}",
  41 + "</script>"})
  42 + List<Map<String, Object>> getPage(Page<Map<String, Object>> page,@Param(Constants.WRAPPER) QueryWrapper query);
11 43 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsPushVisitRecordService.java View file @ 3e71410
1 1 package com.lyms.talkonlineweb.service;
2 2  
  3 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  4 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
3 5 import com.lyms.talkonlineweb.domain.LymsPushVisitRecord;
4 6 import com.baomidou.mybatisplus.extension.service.IService;
5 7  
  8 +import java.util.List;
  9 +import java.util.Map;
  10 +
6 11 /**
7 12 *
8 13 */
9 14 public interface LymsPushVisitRecordService extends IService<LymsPushVisitRecord> {
10 15  
  16 + List<Map<String, Object>> getPage(Page<Map<String, Object>> page, QueryWrapper query);
11 17 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsPushVisitRecordServiceImpl.java View file @ 3e71410
1 1 package com.lyms.talkonlineweb.service.impl;
2 2  
  3 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  4 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
3 5 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 6 import com.lyms.talkonlineweb.domain.LymsPushVisitRecord;
5 7 import com.lyms.talkonlineweb.service.LymsPushVisitRecordService;
6 8 import com.lyms.talkonlineweb.mapper.LymsPushVisitRecordMapper;
  9 +import org.springframework.beans.factory.annotation.Autowired;
7 10 import org.springframework.stereotype.Service;
8 11  
  12 +import java.util.List;
  13 +import java.util.Map;
  14 +
9 15 /**
10 16 *
11 17 */
12 18 @Service
13 19 public class LymsPushVisitRecordServiceImpl extends ServiceImpl<LymsPushVisitRecordMapper, LymsPushVisitRecord>
14 20 implements LymsPushVisitRecordService{
  21 + @Autowired
  22 + private LymsPushVisitRecordMapper lymsPushVisitRecordMapper;
15 23  
  24 + @Override
  25 + public List<Map<String, Object>> getPage(Page<Map<String, Object>> page, QueryWrapper query) {
  26 + return lymsPushVisitRecordMapper.getPage(page,query);
  27 + }
16 28 }