|
@@ -423,10 +423,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
<select id="getIsPassedStudentsPage" resultType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO">
|
|
|
SELECT
|
|
|
a.*,
|
|
|
-
|
|
|
+ CASE
|
|
|
+ WHEN COALESCE(MAX(r.select_type), 0) = 2 THEN 2
|
|
|
+ WHEN COALESCE(MAX(r.select_type), 0) = 1 THEN 1
|
|
|
+ ELSE 0
|
|
|
+ END AS selectStatus,
|
|
|
|
|
|
COALESCE(system_dept.name, "测绘学院") AS deptName,
|
|
|
supervisor_user.nickname AS supervisor,
|
|
@@ -459,20 +464,19 @@
|
|
|
<if test="reqVO.userType != null">
|
|
|
AND a.user_type = #{reqVO.userType}
|
|
|
</if>
|
|
|
-
|
|
|
- <if test="reqVO.grade != null and reqVO.grade != ''">
|
|
|
- AND a.grade =#{reqVO.grade}
|
|
|
+ <if test="reqVO.grade != '' and reqVO.grade != null ">
|
|
|
+ AND a.grade = #{reqVO.grade}
|
|
|
</if>
|
|
|
- <if test="reqVO.supervisorId != null">
|
|
|
+ <if test="reqVO.supervisorId != null and reqVO.supervisorId != '' ">
|
|
|
AND a.supervisor_id = #{reqVO.supervisorId}
|
|
|
</if>
|
|
|
- <if test="reqVO.major != null">
|
|
|
+ <if test="reqVO.major != null and reqVO.major != '' ">
|
|
|
AND a.major = #{reqVO.major}
|
|
|
</if>
|
|
|
- <if test="reqVO.masterType != null">
|
|
|
+ <if test="reqVO.masterType != null and reqVO.masterType != '' ">
|
|
|
AND a.masterType = #{reqVO.masterType}
|
|
|
</if>
|
|
|
- <if test="reqVO.status != null">
|
|
|
+ <if test="reqVO.status != null and reqVO.status != '' ">
|
|
|
AND a.status = #{reqVO.status}
|
|
|
</if>
|
|
|
AND a.deleted = 0
|
|
@@ -480,12 +484,23 @@
|
|
|
a.id
|
|
|
|
|
|
<!-- 合并 HAVING 子句 -->
|
|
|
-
|
|
|
+ HAVING
|
|
|
+ CASE
|
|
|
+ WHEN COALESCE(MAX(r.select_type), 0) = 2 THEN 2
|
|
|
+ WHEN COALESCE(MAX(r.select_type), 0) = 1 THEN 1
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ <choose>
|
|
|
+ <when test="isPassed == 0">IN (0, 1)</when>
|
|
|
+ <when test="isPassed == 1">= 2</when>
|
|
|
+ </choose>
|
|
|
|
|
|
ORDER BY
|
|
|
a.id DESC
|
|
|
|
|
|
-
|
|
|
+ <if test="offset != -1">
|
|
|
+ LIMIT #{offset}, #{reqVO.pageSize}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getIsPassedStudentsPageCount" resultType="Long">
|
|
@@ -518,16 +533,16 @@
|
|
|
<if test="reqVO.grade != '' and reqVO.grade != null ">
|
|
|
AND a.grade = #{reqVO.grade}
|
|
|
</if>
|
|
|
- <if test="reqVO.supervisorId != null">
|
|
|
+ <if test="reqVO.supervisorId != null and reqVO.supervisorId != '' ">
|
|
|
AND a.supervisor_id = #{reqVO.supervisorId}
|
|
|
</if>
|
|
|
- <if test="reqVO.major != null">
|
|
|
+ <if test="reqVO.major != null and reqVO.major != '' ">
|
|
|
AND a.major = #{reqVO.major}
|
|
|
</if>
|
|
|
- <if test="reqVO.masterType != null">
|
|
|
+ <if test="reqVO.masterType != null and reqVO.masterType != '' ">
|
|
|
AND a.masterType = #{reqVO.masterType}
|
|
|
</if>
|
|
|
- <if test="reqVO.status != null">
|
|
|
+ <if test="reqVO.status != null and reqVO.status != '' ">
|
|
|
AND a.status = #{reqVO.status}
|
|
|
</if>
|
|
|
AND a.deleted = 0
|