Browse Source

学生档案优化

wangliang 3 years ago
parent
commit
97f0052b64

+ 6 - 0
themis-admin/src/main/java/com/qmth/themis/admin/api/TEStudentController.java

@@ -68,6 +68,12 @@ public class TEStudentController {
                 if (StringUtils.isNotBlank(dto.getBasePhotoPath())) {
                 if (StringUtils.isNotBlank(dto.getBasePhotoPath())) {
                     dto.setBasePhotoPath(ossUtil.getAliYunOssPublicDomain().getPublicUrl() + "/" + dto.getBasePhotoPath());
                     dto.setBasePhotoPath(ossUtil.getAliYunOssPublicDomain().getPublicUrl() + "/" + dto.getBasePhotoPath());
                 }
                 }
+                if (Objects.isNull(dto.getUpdateName())) {
+                    dto.setUpdateName(dto.getCreateName());
+                }
+                if (Objects.isNull(dto.getUpdateTime())) {
+                    dto.setUpdateTime(dto.getCreateTime());
+                }
             }
             }
         }
         }
         return ResultUtil.ok(teExamStudentIPage);
         return ResultUtil.ok(teExamStudentIPage);

+ 9 - 16
themis-business/src/main/resources/mapper/TEStudentMapper.xml

@@ -4,17 +4,6 @@
 
 
     <select id="studentQuery" resultType="com.qmth.themis.business.dto.response.TEStudentDto">
     <select id="studentQuery" resultType="com.qmth.themis.business.dto.response.TEStudentDto">
         select
         select
-        t.id,
-        t.name,
-        t.identity,
-        t.orgName,
-        t.enable,
-        t.basePhotoPath,
-        if(t.updateName is not null, t.updateName, t.createName) as updateName,
-        if(t.updateTime is not null, t.updateTime, t.createTime) as updateTime,
-        t.photo
-        from
-        (select
         tes.id,
         tes.id,
         tes.name,
         tes.name,
         tes.`identity`,
         tes.`identity`,
@@ -43,14 +32,18 @@
             <if test="orgId != null and orgId != ''">
             <if test="orgId != null and orgId != ''">
                 and tes.org_id = #{orgId}
                 and tes.org_id = #{orgId}
             </if>
             </if>
-        </where>
-        ) t
-        <where>
             <if test="photo != null and photo != '' or photo == 0">
             <if test="photo != null and photo != '' or photo == 0">
-                and t.photo = #{photo}
+                <choose>
+                    <when test="photo == true">
+                        and tes.base_photo_path is not null
+                    </when>
+                    <otherwise>
+                        and tes.base_photo_path is null
+                    </otherwise>
+                </choose>
             </if>
             </if>
         </where>
         </where>
-        order by t.id
+        order by tes.id
     </select>
     </select>
 
 
     <select id="studentExamRecordQuery" resultType="com.qmth.themis.business.dto.response.TEStudentExamRecordDto">
     <select id="studentExamRecordQuery" resultType="com.qmth.themis.business.dto.response.TEStudentExamRecordDto">