zouxuan 2 年 前
コミット
a4c2d1fe89

+ 5 - 1
mec-biz/src/main/resources/config/mybatis/DegreeRegistrationMapper.xml

@@ -328,7 +328,11 @@
     <select id="getUserLevelDegrees" resultMap="DegreeRegistration">
         select * from degree_registration
         where user_id_ = #{userId} and degree_id_ = #{degreeId} and type_ = #{type}
-          AND FIND_IN_SET(level_,#{levels}) AND subject_id_ = #{subjectId} AND status_ = 2 LIMIT 1
+          AND FIND_IN_SET(level_,#{levels}) AND status_ = 2
+        <if test="subjectId != null">
+            AND subject_id_ = #{subjectId}
+        </if>
+        LIMIT 1
     </select>
     <select id="getLockByOrderId" resultMap="DegreeRegistration">
         SELECT * FROM degree_registration WHERE order_no_ = #{orderNo} FOR UPDATE