Browse Source

修改ids非空判定报错问题

dzx 1 year ago
parent
commit
31c59c5c60

+ 4 - 4
src/main/resources/mapper/student/BaseStudentBehaviorManageMapper.xml

@@ -35,7 +35,7 @@
         <if test="dto.endDate != null and dto.endDate != ''">
             and t.assessment_date &lt;= #{dto.endDate}
         </if>
-        <if test="dto.assessmentUserIds != null and dto.assessmentUserIds != ''">
+        <if test="dto.assessmentUserIds != null and dto.assessmentUserIds.size() > 0">
             AND t.assessment_user_id in
             <foreach item="userId" index="index" collection="dto.assessmentUserIds" open="(" close=")" separator=",">
                 #{userId}
@@ -77,19 +77,19 @@
         AND t5.class_id IN (
         SELECT id FROM base_class WHERE teacher_id = #{dto.teacherId}
         )
-        <if test="dto.gradeIds != null and dto.gradeIds != ''">
+        <if test="dto.gradeIds != null and dto.gradeIds.size() > 0">
             AND t5.grade_id in
             <foreach item="gradeId" index="index" collection="dto.gradeIds" open="(" close=")" separator=",">
                 #{gradeId}
             </foreach>
         </if>
-        <if test="dto.classIds != null and dto.classIds != ''">
+        <if test="dto.classIds != null and dto.classIds.size() > 0">
             AND t5.class_id in
             <foreach item="classId" index="index" collection="dto.classIds" open="(" close=")" separator=",">
                 #{classId}
             </foreach>
         </if>
-        <if test="dto.assessmentUserIds != null and dto.assessmentUserIds != ''">
+        <if test="dto.assessmentUserIds != null and dto.assessmentUserIds.size() > 0">
             AND t.assessment_user_id in
             <foreach item="assessmentUserId" index="index" collection="dto.assessmentUserIds" open="(" close=")" separator=",">
                 #{assessmentUserId}

+ 1 - 1
src/main/resources/mapper/student/BaseStudentPunishmentInfoMapper.xml

@@ -44,7 +44,7 @@
         LEFT JOIN base_class t5 ON t2.class_id = t5.id
         WHERE t1.status = 1 AND t1.delete_mark = 0 AND t3.delete_mark = 0 AND t2.delete_mark = 0
         AND t5.id IN (SELECT id  FROM base_class WHERE teacher_id  = #{dto.teacherId})
-        <if test="dto.punishmentTypeIds != null and dto.punishmentTypeIds != ''">
+        <if test="dto.punishmentTypeIds != null and dto.punishmentTypeIds.size() > 0">
             AND t4.id in
             <foreach item="punishmentTypeId" index="index" collection="dto.punishmentTypeIds" open="(" close=")" separator=",">
                 #{punishmentTypeId}