소스 검색

add: 医生端手术信息列表和患者信息列表代码提交

wangzl 6 달 전
부모
커밋
96a1290c30
14개의 변경된 파일420개의 추가작업 그리고 43개의 파일을 삭제
  1. 43 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/ClinicRoomController.java
  2. 41 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/PatientInfoController.java
  3. 26 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/dto/WxDoctorClinicRoomDTO.java
  4. 24 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/dto/WxDoctorPatientInfoDTO.java
  5. 55 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/vo/WxDoctorClinicRoomVO.java
  6. 44 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/vo/WxDoctorPatientVO.java
  7. 4 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizClinicRoomRepository.java
  8. 9 1
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizPatientRepository.java
  9. 8 1
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizClinicRoomService.java
  10. 9 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizPatientService.java
  11. 71 40
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizClinicRoomServiceImpl.java
  12. 15 1
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizPatientServiceImpl.java
  13. 37 0
      tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizClinicRoomMapper.xml
  14. 34 0
      tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizPatientMapper.xml

+ 43 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/ClinicRoomController.java

@@ -0,0 +1,43 @@
+package cn.tr.module.smart.app.controller;
+
+import cn.tr.core.pojo.TableDataInfo;
+import cn.tr.module.smart.app.controller.dto.WxDoctorClinicRoomDTO;
+import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomVO;
+import cn.tr.module.smart.common.service.IBizClinicRoomService;
+import cn.tr.plugin.mybatis.base.BaseController;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/6/9 15:07
+ */
+@Api(tags = "医生端手术信息")
+@RestController
+@RequestMapping("/wx/doctor/clinic")
+@AllArgsConstructor
+//@SaCheckLogin(type = LoginTypeConstant.WX_APPLET)
+public class ClinicRoomController extends BaseController {
+    @Resource
+    private IBizClinicRoomService clinicRoomService;
+
+    @ApiOperationSupport(author = "wangzl", order = 1)
+    @ApiOperation(value = "根据条件查询手术信息列表", notes = "权限: 无")
+    @PostMapping("/query/page")
+    public TableDataInfo<WxDoctorClinicRoomVO> selectList(@RequestBody @Validated WxDoctorClinicRoomDTO query) {
+        startPage();
+        return getDataTable(clinicRoomService.selectByClinicRoomAndPatientList(query));
+    }
+
+
+}

+ 41 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/PatientInfoController.java

@@ -0,0 +1,41 @@
+package cn.tr.module.smart.app.controller;
+
+import cn.tr.core.pojo.TableDataInfo;
+import cn.tr.module.smart.app.controller.dto.WxDoctorPatientInfoDTO;
+import cn.tr.module.smart.app.controller.vo.WxDoctorPatientVO;
+import cn.tr.module.smart.common.service.IBizPatientService;
+import cn.tr.plugin.mybatis.base.BaseController;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/6/9 16:44
+ */
+@Api(tags = "医生端患者信息")
+@RestController
+@RequestMapping("/wx/doctor/patient")
+@AllArgsConstructor
+//@SaCheckLogin(type = LoginTypeConstant.WX_APPLET)
+public class PatientInfoController extends BaseController {
+    @Resource
+    private IBizPatientService bizPatientService;
+
+    @ApiOperationSupport(author = "wangzl",order = 1)
+    @ApiOperation(value="根据条件患者信息列表",notes = "权限: 无")
+    @PostMapping("/query/page")
+    public TableDataInfo<WxDoctorPatientVO> selectList(@RequestBody @Validated WxDoctorPatientInfoDTO query) {
+        startPage();
+        return getDataTable(bizPatientService.selectPatientList(query));
+    }
+}

+ 26 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/dto/WxDoctorClinicRoomDTO.java

@@ -0,0 +1,26 @@
+package cn.tr.module.smart.app.controller.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/6/9 15:42
+ */
+@Data
+@ApiModel("医生端手术信息列表查询参数")
+public class WxDoctorClinicRoomDTO implements Serializable {
+
+    @ApiModelProperty(value = "手术状态",position = 1)
+    @NotBlank(message = "手术状态不能为空,术前还是术后")
+    private String clinicStatus;
+
+    @ApiModelProperty(value = "检索条件",position = 2)
+    private String queryCondition;
+
+}

+ 24 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/dto/WxDoctorPatientInfoDTO.java

@@ -0,0 +1,24 @@
+package cn.tr.module.smart.app.controller.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/6/10 10:27
+ */
+@Data
+@ApiModel("医生端患者信息列表查询参数")
+public class WxDoctorPatientInfoDTO {
+
+    @ApiModelProperty(value = "查询时间",position = 1)
+    private List<Date> queryTime;
+
+    @ApiModelProperty(value = "检索条件",position = 2)
+    private String queryCondition;
+}

+ 55 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/vo/WxDoctorClinicRoomVO.java

@@ -0,0 +1,55 @@
+package cn.tr.module.smart.app.controller.vo;
+
+import cn.tr.core.utils.AgeUtils;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/6/9 15:11
+ */
+@Data
+@ApiModel("医生端手术列表信息")
+public class WxDoctorClinicRoomVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("手术ID")
+    private String clinicRoomId;
+
+    @ApiModelProperty("手术名称")
+    private String clinicName;
+
+    @ApiModelProperty("手术开始时间")
+    private Date clinicStartTime;
+
+    @ApiModelProperty("科室名称")
+    private String deptName;
+
+    @ApiModelProperty("住院号")
+    private String patientCode;
+
+    @ApiModelProperty("患者姓名")
+    private String patientName;
+
+    @ApiModelProperty("患者生日")
+    @JsonIgnore
+    private Date patientBirthday;
+
+    @ApiModelProperty("患者性别")
+    private String patientGender;
+
+    @ApiModelProperty("患者身份证号")
+    @JsonIgnore
+    private String patientCardNo;
+
+    @ApiModelProperty("病人年龄")
+    public Integer getPatientAge(){
+        return AgeUtils.calculateAge(this.getPatientBirthday());
+    }
+}

+ 44 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/vo/WxDoctorPatientVO.java

@@ -0,0 +1,44 @@
+package cn.tr.module.smart.app.controller.vo;
+
+import cn.tr.core.utils.AgeUtils;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/6/10 10:35
+ */
+@Data
+@ApiModel("医生端患者列表信息")
+public class WxDoctorPatientVO {
+
+    @ApiModelProperty("住院号")
+    private String patientCode;
+
+    @ApiModelProperty("手术次数")
+    private Integer countResult;
+
+    @ApiModelProperty("患者姓名")
+    private String patientName;
+
+    @ApiModelProperty("患者生日")
+    @JsonIgnore
+    private Date patientBirthday;
+
+    @ApiModelProperty("患者性别")
+    private String patientGender;
+
+    @ApiModelProperty("患者身份证号")
+    @JsonIgnore
+    private String patientCardNo;
+
+    @ApiModelProperty("病人年龄")
+    public Integer getPatientAge(){
+        return AgeUtils.calculateAge(this.getPatientBirthday());
+    }
+}

+ 4 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizClinicRoomRepository.java

@@ -2,6 +2,8 @@ package cn.tr.module.smart.common.repository;
 
 import cn.tr.module.smart.wx.controller.vo.BizWxAppletClinicVO;
 import cn.tr.module.smart.wx.dto.BizWxAppletClinicQueryDTO;
+import cn.tr.module.smart.app.controller.dto.WxDoctorClinicRoomDTO;
+import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -20,4 +22,6 @@ import java.util.List;
 @Mapper
 public interface BizClinicRoomRepository extends BaseMapper<BizClinicRoomPO> {
     List<BizWxAppletClinicVO> stdSelectWxAppletClinicList(@Param("query") BizWxAppletClinicQueryDTO query);
+
+    List<WxDoctorClinicRoomVO> selectByClinicRoomAndPatientList(@Param("source") WxDoctorClinicRoomDTO source);
 }

+ 9 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizPatientRepository.java

@@ -1,9 +1,15 @@
 package cn.tr.module.smart.common.repository;
 
+import cn.tr.module.smart.app.controller.dto.WxDoctorPatientInfoDTO;
+import cn.tr.module.smart.app.controller.vo.WxDoctorPatientVO;
+import cn.tr.module.smart.common.po.BizPatientPO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
-import cn.tr.module.smart.common.po.BizPatientPO;
+
+import java.util.List;
+
 /**
  * 患者信息Mapper接口
  *
@@ -13,4 +19,6 @@ import cn.tr.module.smart.common.po.BizPatientPO;
 @Repository
 @Mapper
 public interface BizPatientRepository extends BaseMapper<BizPatientPO> {
+
+    List<WxDoctorPatientVO> selectPatientList(@Param("query") WxDoctorPatientInfoDTO query);
 }

+ 8 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizClinicRoomService.java

@@ -1,5 +1,7 @@
 package cn.tr.module.smart.common.service;
 
+import cn.tr.module.smart.app.controller.dto.WxDoctorClinicRoomDTO;
+import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomVO;
 import cn.tr.module.smart.common.dto.BizClinicRoomDTO;
 import cn.tr.module.smart.common.dto.BizClinicRoomQueryDTO;
 import cn.tr.module.smart.wx.controller.vo.BizWxAppletClinicVO;
@@ -62,5 +64,10 @@ public interface IBizClinicRoomService{
      */
     int removeBizClinicRoomByIds(Collection<String> ids);
 
-
+    /**
+     * @description: 查询医生端手术信息列表
+     * @author wangzl
+     * @date 2025/6/10
+     */
+    List<WxDoctorClinicRoomVO> selectByClinicRoomAndPatientList(WxDoctorClinicRoomDTO source);
 }

+ 9 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizPatientService.java

@@ -1,5 +1,7 @@
 package cn.tr.module.smart.common.service;
 
+import cn.tr.module.smart.app.controller.dto.WxDoctorPatientInfoDTO;
+import cn.tr.module.smart.app.controller.vo.WxDoctorPatientVO;
 import cn.tr.module.smart.common.dto.BizPatientDTO;
 import cn.tr.module.smart.common.dto.BizPatientQueryDTO;
 import java.util.*;
@@ -51,4 +53,11 @@ public interface IBizPatientService{
      * @date    2025/06/09 15:58
      */
     int removeBizPatientByIds(Collection<String> ids);
+
+    /**
+     * @description: TODO
+     * @author wangzl
+     * @date 2025/6/10
+     */
+    List<WxDoctorPatientVO>  selectPatientList(WxDoctorPatientInfoDTO source);
 }

+ 71 - 40
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizClinicRoomServiceImpl.java

@@ -1,6 +1,9 @@
 package cn.tr.module.smart.common.service.impl;
 
+import cn.hutool.core.date.DateUtil;
 import cn.tr.core.exception.TRExcCode;
+import cn.tr.module.smart.app.controller.dto.WxDoctorClinicRoomDTO;
+import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomVO;
 import cn.tr.module.smart.wx.controller.vo.BizWxAppletClinicVO;
 import cn.tr.module.smart.wx.dto.BizWxAppletClinicQueryDTO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,14 +16,17 @@ import cn.tr.module.smart.common.repository.BizClinicRoomRepository;
 import cn.tr.module.smart.common.po.BizClinicRoomPO;
 import cn.tr.module.smart.common.dto.BizClinicRoomDTO;
 import cn.tr.module.smart.common.dto.BizClinicRoomQueryDTO;
+
 import java.util.*;
+
 import cn.tr.module.smart.common.service.IBizClinicRoomService;
 import cn.tr.module.smart.common.mapper.BizClinicRoomMapper;
+
 /**
  * 诊疗室Service接口实现类
  *
  * @author lf
- * @date  2025/06/09 10:59
+ * @date 2025/06/09 10:59
  **/
 @Service
 public class BizClinicRoomServiceImpl implements IBizClinicRoomService {
@@ -34,66 +40,91 @@ public class BizClinicRoomServiceImpl implements IBizClinicRoomService {
     }
 
     /**
-    * 根据条件查询诊疗室
-    * @param    query 查询参数
-    * @author   lf
-    * @date      2025/06/09 10:59
-    */
+     * 根据条件查询诊疗室
+     *
+     * @param query 查询参数
+     * @author lf
+     * @date 2025/06/09 10:59
+     */
     @Override
-    public List<BizClinicRoomDTO> selectBizClinicRoomList(BizClinicRoomQueryDTO query){
+    public List<BizClinicRoomDTO> selectBizClinicRoomList(BizClinicRoomQueryDTO query) {
         return BizClinicRoomMapper.INSTANCE.convertDtoList(
                 baseRepository.selectList(new LambdaQueryWrapper<BizClinicRoomPO>()
                 )
         );
-    };
+    }
+
+    ;
 
     /**
-    * 根据id查询诊疗室
-    * @param    id 主键id
-    * @author   lf
-    * @date      2025/06/09 10:59
-    */
+     * 根据id查询诊疗室
+     *
+     * @param id 主键id
+     * @author lf
+     * @date 2025/06/09 10:59
+     */
     @Override
-    public BizClinicRoomDTO selectBizClinicRoomById(String id){
+    public BizClinicRoomDTO selectBizClinicRoomById(String id) {
         return BizClinicRoomMapper.INSTANCE.convertDto(baseRepository.selectById(id));
-    };
+    }
+
+    ;
 
     /**
-    * 编辑诊疗室
-    * @param   source 编辑实体类
-    * @author  lf
-    * @date     2025/06/09 10:59
-    */
+     * 编辑诊疗室
+     *
+     * @param source 编辑实体类
+     * @author lf
+     * @date 2025/06/09 10:59
+     */
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public boolean updateBizClinicRoomById(BizClinicRoomDTO source){
-            return baseRepository.updateById(BizClinicRoomMapper.INSTANCE.convertPO(source))!=0;
-    };
+    public boolean updateBizClinicRoomById(BizClinicRoomDTO source) {
+        return baseRepository.updateById(BizClinicRoomMapper.INSTANCE.convertPO(source)) != 0;
+    }
+
+    ;
 
     /**
-    * 新增诊疗室
-    * @param   source 新增实体类
-    * @author lf
-    * @date  2025/06/09 10:59
-    */
+     * 新增诊疗室
+     *
+     * @param source 新增实体类
+     * @author lf
+     * @date 2025/06/09 10:59
+     */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public boolean insertBizClinicRoom(BizClinicRoomDTO source){
-        return baseRepository.insert(BizClinicRoomMapper.INSTANCE.convertPO(source))!=0;
-    };
+    public boolean insertBizClinicRoom(BizClinicRoomDTO source) {
+        return baseRepository.insert(BizClinicRoomMapper.INSTANCE.convertPO(source)) != 0;
+    }
+
+    ;
 
     /**
-    * 删除诊疗室详情
-    * @param  ids 删除主键集合
-    * @author lf
-    * @date    2025/06/09 10:59
-    */
+     * 删除诊疗室详情
+     *
+     * @param ids 删除主键集合
+     * @author lf
+     * @date 2025/06/09 10:59
+     */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public int removeBizClinicRoomByIds(Collection<String> ids){
-        if(CollectionUtil.isEmpty(ids)){
-            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"请选择要删除的数据");
+    public int removeBizClinicRoomByIds(Collection<String> ids) {
+        if (CollectionUtil.isEmpty(ids)) {
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "请选择要删除的数据");
         }
         return baseRepository.deleteBatchIds(ids);
-    };
+    }
+
+    /**
+     * @param source 查询参数
+     * @description: 查询医生端手术信息列表
+     * @author wangzl
+     * @date 2025/6/10
+     */
+    @Override
+    public List<WxDoctorClinicRoomVO> selectByClinicRoomAndPatientList(WxDoctorClinicRoomDTO source) {
+        return baseRepository.selectByClinicRoomAndPatientList(source);
+    }
+
 }

+ 15 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizPatientServiceImpl.java

@@ -1,6 +1,8 @@
 package cn.tr.module.smart.common.service.impl;
 
 import cn.tr.core.exception.TRExcCode;
+import cn.tr.module.smart.app.controller.dto.WxDoctorPatientInfoDTO;
+import cn.tr.module.smart.app.controller.vo.WxDoctorPatientVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import cn.hutool.core.collection.CollectionUtil;
@@ -88,5 +90,17 @@ public class BizPatientServiceImpl implements IBizPatientService {
             throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"请选择要删除的数据");
         }
         return baseRepository.deleteBatchIds(ids);
-    };
+    }
+
+    /**
+     * @param source
+     * @description: TODO
+     * @author wangzl
+     * @date 2025/6/10
+     */
+    @Override
+    public List<WxDoctorPatientVO> selectPatientList(WxDoctorPatientInfoDTO source) {
+        return baseRepository.selectPatientList(source);
+    }
+
 }

+ 37 - 0
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizClinicRoomMapper.xml

@@ -18,7 +18,44 @@
         <result property="care" column="care"/>
     </resultMap>
 
+    <resultMap id="RoomAndPatient" type="cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomVO">
+        <result property="clinicRoomId" column="id"/>
+        <result property="clinicName" column="clinic_name"/>
+        <result property="clinicStartTime" column="clinic_start_time"/>
+        <result property="deptName" column="dept_name"/>
+        <result property="patientCode" column="patient_code"/>
+        <result property="patientName" column="name"/>
+        <result property="patientBirthday" column="birthday"/>
+        <result property="patientGender" column="gender"/>
+        <result property="patientCardNo" column="card_no"/>
+    </resultMap>
+
     <select id="stdSelectWxAppletClinicList" resultMap="stdWxAppletResult">
 
     </select>
+
+
+    <select id="selectByClinicRoomAndPatientList" resultMap="RoomAndPatient">
+        SELECT bcr.id,
+        bcr.clinic_name,
+        bcr.clinic_start_time,
+        bcr.dept_name,
+        bcr.patient_code,
+        bp.name,
+        bp.birthday,
+        bp.gender,
+        bp.card_no
+        FROM biz_clinic_room bcr
+        join biz_patient bp
+        on bcr.patient_id = bp.id
+        <where>
+            <if test="source.clinicStatus != null and source.clinicStatus != ''">
+                and bcr.clinic_status = #{source.clinicStatus ,jdbcType=VARCHAR}
+            </if>
+            <if test="source.queryCondition != null and source.queryCondition != ''">
+                and bcr.patient_code LIKE concat('%',#{source.queryCondition,jdbcType=VARCHAR},'%')
+                or bp.name like concat('%',#{source.queryCondition,jdbcType=VARCHAR},'%')
+            </if>
+        </where>
+    </select>
 </mapper>

+ 34 - 0
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizPatientMapper.xml

@@ -0,0 +1,34 @@
+<?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">
+<mapper namespace="cn.tr.module.smart.common.repository.BizPatientRepository">
+
+    <resultMap id="PatientAndClinicResult" type="cn.tr.module.smart.app.controller.vo.WxDoctorPatientVO">
+        <result property="patientCode" column="patient_code"/>
+        <result property="countResult" column="countResult"/>
+        <result property="patientName" column="name"/>
+        <result property="patientBirthday" column="birthday"/>
+        <result property="patientGender" column="gender"/>
+        <result property="patientCardNo" column="card_no"/>
+    </resultMap>
+
+    <select id="selectPatientList" resultMap="PatientAndClinicResult">
+        SELECT queryResult.patient_code,
+        queryResult.countResult,
+        bp.name,
+        bp.birthday,
+        bp.gender,
+        bp.card_no
+        FROM ( (SELECT patient_id, patient_code, COUNT(1) AS countResult
+        FROM biz_clinic_room
+        GROUP BY patient_code, patient_id)) AS queryResult
+        JOIN biz_patient AS bp ON queryResult.patient_id = bp.id
+        <where>
+            <if test="query.queryCondition != null and query.queryCondition != ''">
+                and queryResult.patient_code LIKE concat('%',#{query.queryCondition,jdbcType=VARCHAR},'%')
+                or bp.name like concat('%',#{query.queryCondition,jdbcType=VARCHAR},'%')
+            </if>
+        </where>
+    </select>
+</mapper>