瀏覽代碼

满意度调查导出添加就诊科室

lighter 1 年之前
父節點
當前提交
f03dacc5af

+ 10 - 0
src/main/java/thyyxxk/webserver/dao/his/outpatient/interactive/ClinicSatisfiedDao.java

@@ -35,6 +35,16 @@ public interface ClinicSatisfiedDao {
     List<SatisfiedBody> selectAllSatisfiedBodies(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper,
                                                  @Param("table") String table);
 
+    @Select("select *,deptName=(select rtrim(d.name) from zd_unit_code d where d.code=a.dept_code) " +
+            "from t_clinic_satisfied_assessment a ${ew.customSqlSegment} order by id")
+    List<SatisfiedBody> selectAllOutpatientSatisfiedBodies(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
+
+
+    @Select("select *,deptName=(select rtrim(d.name) from zd_unit_code d where d.code=" +
+            "(select e.zk_ward from zy_inactpatient e where e.inpatient_no=a.inpatient_no and e.admiss_times=a.admiss_times)) " +
+            "from t_inpatient_satisfied_assessment a ${ew.customSqlSegment} order by id")
+    List<SatisfiedBody> selectAllInpatientSatisfiedBodies(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
+
     @Select("select count(1) from ${table} ${ew.customSqlSegment}")
     int selectUnsatisfiedCount(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper,
                                @Param("table") String table);

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/outpatient/interactive/clinicsatisfied/response/SatisfiedBody.java

@@ -113,6 +113,8 @@ public class SatisfiedBody {
     // (门诊)急诊标志(1-是,0-否)
     private Integer jzFlag;
     private String jzFlagLabel;
+    private String deptCode;
+    private String deptName;
 
     private Integer deleted;
     private Date createDatetime;

+ 7 - 3
src/main/java/thyyxxk/webserver/service/outpatient/interactive/clinicsatisfied/ClinicSatisfiedService.java

@@ -96,9 +96,13 @@ public class ClinicSatisfiedService {
 
     public ResultVo<List<SatisfiedBody>> getAllSatisfiedBodies(ClinicSatisfiedInquiry inquiry) {
         QueryWrapper<?> wrapper = makeQueryWrapper(inquiry);
-        String table = inquiry.getVisitType() == VisitType.INPATIENT ?
-                "t_inpatient_satisfied_assessment" : "t_clinic_satisfied_assessment";
-        List<SatisfiedBody> list = dao.selectAllSatisfiedBodies(wrapper, table);
+        List<SatisfiedBody> list;
+        if (inquiry.getVisitType() == VisitType.INPATIENT) {
+            list = dao.selectAllInpatientSatisfiedBodies(wrapper);
+        } else {
+            list = dao.selectAllOutpatientSatisfiedBodies(wrapper);
+        }
+
         if (list.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
         }