Kaynağa Gözat

年龄关联

zhoutg 5 yıl önce
ebeveyn
işleme
293aaf5ef8

+ 0 - 6
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -91,12 +91,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
         IPage<BehospitalInfoDTO> res = getPage(behospitalPageVO);
-        List<BehospitalInfoDTO> behospitalInfoDTOList = res.getRecords();
-        for (BehospitalInfoDTO behospitalInfo : behospitalInfoDTOList) {
-            if (behospitalInfo != null && behospitalInfo.getBirthday() != null) {
-                behospitalInfo.setAge(getAge(behospitalInfo.getBirthday()));
-            }
-        }
         return res;
     }
 

+ 4 - 1
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -32,8 +32,11 @@
     </resultMap>
 
     <select id="getPage" resultType="com.diagbot.dto.BehospitalInfoDTO">
-        select a.*, b.level, b.grade_type, b.score_res, b.gmt_create as grade_time from med_behospital_info a LEFT JOIN med_qcresult_info b
+        select a.*, b.level, b.grade_type, b.score_res, b.gmt_create as grade_time, c.age from med_behospital_info a
+        LEFT JOIN med_qcresult_info b
         on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
+        left join med_home_page c
+        on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
         where a.is_deleted = 'N'
         <if test="name != null and name != ''">
             and a.name like CONCAT('%',#{name},'%')