Browse Source

sql优化

zouxuan 11 months ago
parent
commit
db258f0be7
33 changed files with 221 additions and 233 deletions
  1. 1 1
      cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml
  2. 1 1
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml
  3. 4 4
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  4. 3 3
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  5. 3 3
      mec-biz/src/main/resources/config/mybatis/CloudTeacherMapper.xml
  6. 2 2
      mec-biz/src/main/resources/config/mybatis/CloudTeacherOrderMapper.xml
  7. 1 1
      mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml
  8. 1 1
      mec-biz/src/main/resources/config/mybatis/CourseHomeworkTemplateMapper.xml
  9. 1 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleConvert.xml
  10. 11 11
      mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml
  11. 47 48
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  12. 5 5
      mec-biz/src/main/resources/config/mybatis/CourseScheduleReviewMapper.xml
  13. 7 7
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml
  14. 15 15
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  15. 1 1
      mec-biz/src/main/resources/config/mybatis/DemoGroupMapper.xml
  16. 5 5
      mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml
  17. 54 65
      mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
  18. 2 2
      mec-biz/src/main/resources/config/mybatis/IndexErrDataRecordMapper.xml
  19. 2 2
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  20. 2 2
      mec-biz/src/main/resources/config/mybatis/MusicGroupTrainPlanMapper.xml
  21. 2 2
      mec-biz/src/main/resources/config/mybatis/OperatingReportNewMapper.xml
  22. 3 3
      mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml
  23. 1 1
      mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml
  24. 1 1
      mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml
  25. 2 2
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  26. 19 19
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  27. 2 2
      mec-biz/src/main/resources/config/mybatis/StudentRepairMapper.xml
  28. 1 1
      mec-biz/src/main/resources/config/mybatis/SysEmployeePositionMapper.xml
  29. 3 3
      mec-biz/src/main/resources/config/mybatis/SysMusicCompareRecordMapper.xml
  30. 5 5
      mec-biz/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml
  31. 11 11
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  32. 1 1
      mec-biz/src/main/resources/config/mybatis/TempTestMapper.xml
  33. 2 2
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

+ 1 - 1
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -321,7 +321,7 @@
 		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_ AND cssp.user_id_ = sa.user_id_
 		LEFT JOIN teacher_attendance ta on ta.course_schedule_id_ = cs.id_
 		LEFT JOIN course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
-		where cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND csts.user_id_ = #{userId} AND cs.status_ = 'OVER' AND cs.class_date_ BETWEEN #{startTime} AND DATE(NOW())
+		where cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND csts.user_id_ = #{userId} AND cs.status_ = 'OVER' AND cs.class_date_ BETWEEN #{startTime} AND DATE(NOW())
 		AND (sa.id_ IS NULL OR (sa.status_ = 'TRUANT' AND sa.visit_flag_ = 0))
 		AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cssp.id_ IS NOT NULL

+ 1 - 1
mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -243,7 +243,7 @@
         from employee e
         left join sys_user su on su.id_ = e.user_id_
         <where>
-            su.del_flag_ = 0
+            su.del_flag_ = '0'
             <if test="createStartDate != null and createStartDate != ''">
                 and #{createStartDate} &lt;= e.update_time_
             </if>

+ 4 - 4
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -710,7 +710,7 @@
             csts.user_id_ = #{teacherId} AND cs.pre_course_flag_ != 1
             AND cg.group_type_='MUSIC'
             AND cg.del_flag_ = 0
-            AND cs.del_flag_ = 0
+            AND cs.del_flag_ = '0'
             AND mg.status_ = 'PROGRESS'
             <if test="groupName!=null and groupName!=''">
                 AND mg.name_ LIKE CONCAT('%', #{groupName}, '%')
@@ -857,7 +857,7 @@
 
     <sql id="queryMusicGroupCourseScheduleSql">
         <where>
-            cs.group_type_ = 'MUSIC' AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+            cs.group_type_ = 'MUSIC' AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
             <if test="startTime != null">
                 AND cs.class_date_ &gt;= #{startTime}
             </if>
@@ -875,7 +875,7 @@
 
     <sql id="queryMusicGroupCourseScheduleDetailSql">
         <where>
-            (ta.teacher_id_ = cs.actual_teacher_id_ OR ta.id_ IS NULL) AND cs.group_type_ = 'MUSIC' AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+            (ta.teacher_id_ = cs.actual_teacher_id_ OR ta.id_ IS NULL) AND cs.group_type_ = 'MUSIC' AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
             <if test="classScheduleType != null">
                 AND cs.type_ = #{classScheduleType}
             </if>
@@ -1645,7 +1645,7 @@
         <foreach collection="classIdList" separator="," open="(" close=")" item="id">
             #{id}
         </foreach>
-        AND cs.convert_flag_ = 1 AND cs.status_ = 'NOT_START' AND cs.del_flag_ = 0 AND cs.is_lock_ = 0
+        AND cs.convert_flag_ = 1 AND cs.status_ = 'NOT_START' AND cs.del_flag_ = '0' AND cs.is_lock_ = 0
     </select>
 
     <select id="queryByIds" resultType="com.ym.mec.biz.dal.entity.ClassGroup">

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -320,7 +320,7 @@
         FROM
             class_group_student_mapper cgsm
             LEFT JOIN course_schedule cs ON cgsm.class_group_id_=cs.class_group_id_
-            WHERE cgsm.user_id_=#{userId} AND cs.del_flag_ = 0
+            WHERE cgsm.user_id_=#{userId} AND cs.del_flag_ = '0'
             AND cs.class_date_ = DATE_FORMAT(#{data},'%Y-%m-%d')
             AND cgsm.status_=#{status}
     </select>
@@ -458,7 +458,7 @@
     <select id="queryNewStudentListByCourseScheduleId" resultMap="ClassGroupStudentMapper">
       	SELECT cgsm.* FROM class_group_student_mapper cgsm LEFT JOIN course_schedule cs ON cgsm.class_group_id_= cs.class_group_id_
 		LEFT JOIN course_schedule_student_payment cssp on cssp.course_schedule_id_ = cs.id_ and cssp.user_id_ = cgsm.user_id_
-		WHERE cssp.id_ IS NULL AND cgsm.status_ != 'QUIT' and cs.id_ = #{courseScheduleId} AND cs.del_flag_ = 0
+		WHERE cssp.id_ IS NULL AND cgsm.status_ != 'QUIT' and cs.id_ = #{courseScheduleId} AND cs.del_flag_ = '0'
     </select>
     <select id="findByGroups" resultMap="ClassGroupStudentMapper">
       SELECT
@@ -646,7 +646,7 @@
         WHERE
         cg.type_ IN ('HIGH', 'HIGH_ONLINE')
         AND mg.status_ = 'PROGRESS' AND cg.del_flag_ = 0
-        AND cs.del_flag_=0
+        AND cs.del_flag_ = '0'
         AND cs.status_='NOT_START'
         AND ( cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_ )
         <if test="hasDesc != null and hasDesc == true">

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/CloudTeacherMapper.xml

@@ -85,7 +85,7 @@
         SELECT COUNT(DISTINCT cto.student_id_)
         FROM cloud_teacher_order cto
             LEFT JOIN sys_user su ON cto.student_id_=su.id_
-        WHERE su.del_flag_=0 AND cto.status_ IN (1,2) AND su.organ_id_=#{organId}
+        WHERE su.del_flag_='0' AND cto.status_ IN (1,2) AND su.organ_id_=#{organId}
     </select>
 
     <select id="getOrgansTotalVipStudentNum" resultType="int">
@@ -95,7 +95,7 @@
 		union
 		SELECT cto.`student_id_`  FROM `cloud_teacher_order` cto WHERE cto.`status_` = 1
 		) a LEFT JOIN sys_user su ON a.user_id_=su.id_
-        WHERE su.del_flag_=0 
+        WHERE su.del_flag_='0'
         <if test="organIds!=null and organIds.size()>0">
             AND su.organ_id_ IN
             <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
@@ -110,7 +110,7 @@
             COUNT(DISTINCT cto.student_id_) 'value'
         FROM cloud_teacher_order cto
                  LEFT JOIN sys_user su ON cto.student_id_=su.id_
-        WHERE su.del_flag_=0 AND cto.status_ IN (1,2)
+        WHERE su.del_flag_='0' AND cto.status_ IN (1,2)
         <if test="organIds!=null and organIds.size()>0">
             AND su.organ_id_ IN
             <foreach collection="organIds" item="organId" open="(" close=")" separator=",">

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/CloudTeacherOrderMapper.xml

@@ -126,7 +126,7 @@
     <select id="findByPlatformOrderId" resultMap="CloudTeacherOrder">
         select * from cloud_teacher_order cto
         left join sys_user su on cto.student_id_ = su.id_
-        where cto.platform_order_id_ = #{platformOrderId} and su.del_flag_ = 0
+        where cto.platform_order_id_ = #{platformOrderId} and su.del_flag_ = '0'
     </select>
 
     <resultMap type="com.ym.mec.biz.dal.dto.Mapper" id="mapper">
@@ -136,7 +136,7 @@
     <select id="findUserNameByOrderId" resultMap="mapper">
         select su.id_ as userId, su.phone_ as phone from cloud_teacher_order cto
         left join sys_user su on cto.student_id_ = su.id_
-        where platform_order_id_ = #{platformOrderId} and su.del_flag_ = 0
+        where platform_order_id_ = #{platformOrderId} and su.del_flag_ = '0'
     </select>
 
     <update id="updateOrderStatusOK">

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

@@ -270,7 +270,7 @@
 	<select id="queryTeacerNoReplyNum" resultMap="Mapper">
 		select cs.actual_teacher_id_ key_,count(1) value_ from student_course_homework sch
 		left join course_schedule cs on sch.course_schedule_id_ = cs.id_
-		where cs.del_flag_ = 0 AND cs.actual_teacher_id_ IS NOT NULL
+		where cs.del_flag_ = '0' AND cs.actual_teacher_id_ IS NOT NULL
 		AND sch.is_replied_ = 0 group by cs.actual_teacher_id_
 	</select>
 

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

@@ -117,7 +117,7 @@
 		FROM
 			course_schedule cs
 		LEFT JOIN class_group cg ON cs.class_group_id_=cg.id_
-		WHERE cs.id_=#{courseScheduleID}  AND cs.del_flag_ = 0
+		WHERE cs.id_=#{courseScheduleID}  AND cs.del_flag_ = '0'
 	</select>
 
 </mapper>

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

@@ -9,7 +9,7 @@
     <select id="countLegalCourse" resultType="java.lang.Integer">
         SELECT COUNT(cs.id_) FROM course_schedule cs
         WHERE status_ = 'NOT_START' AND (cs.type_ IN ('SINGLE','TRAINING_SINGLE') OR cs.convert_flag_ = 1)
-        AND cs.is_lock_ = 0 AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND cs.new_course_id_ IS NULL
+        AND cs.is_lock_ = 0 AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND cs.new_course_id_ IS NULL
         AND cs.id_ IN
         <foreach collection="courseIdList" item="id" open="(" close=")" separator=",">
             #{id}

+ 11 - 11
mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml

@@ -174,7 +174,7 @@
                  LEFT JOIN practice_group pg ON cs.music_group_id_ = pg.id_
         WHERE cs.group_type_ = 'PRACTICE'
           AND cs.status_ != 'NOT_START'
-          AND cs.del_flag_ = 0
+          AND cs.del_flag_ = '0'
           AND pg.type_='FREE'
           AND pg.group_status_ != 'LOCK'
           and cs.tenant_id_ = #{tenantId}
@@ -361,7 +361,7 @@
                  LEFT JOIN student s ON s.user_id_ = cssp.user_id_
         WHERE cs.id_ >= 1
           AND vg.id_ >= 1
-          AND (cs.is_lock_ IS NULL OR cs.is_lock_ = 0)
+          AND cs.is_lock_ = 0
           AND s.operating_tag_ = 0
           and cssp.tenant_id_ = #{tenantId}
         GROUP BY vg.organ_id_
@@ -377,7 +377,7 @@
         WHERE pg.group_status_ IN ('NORMAL', 'FINISH')
           AND pg.buy_months_ >= 1
           AND cs.id_ >= 1
-          AND (cs.is_lock_ IS NULL OR cs.is_lock_ = 0)
+          AND cs.is_lock_ = 0
           AND s.operating_tag_ = 0
           and pg.tenant_id_ = #{tenantId}
         GROUP BY pg.organ_id_
@@ -393,8 +393,8 @@
             <![CDATA[AND CONCAT(cs.class_date_, ' ', cs.end_class_time_) < #{endDate}]]>
         </if>
         AND cs.teach_mode_ = 'ONLINE'
-        AND (cs.is_lock_ IS NULL OR cs.is_lock_=0)
-        AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
+        AND cs.is_lock_ = 0
+        AND cs.del_flag_ = '0'
           and cssp.tenant_id_ = #{tenantId}
         GROUP BY su.organ_id_
     </select>
@@ -407,8 +407,8 @@
         WHERE pg.id_ >= 1
         AND pg.group_status_ IN ('NORMAL', 'FINISH')
         AND cs.id_ >=1
-        AND (cs.is_lock_ IS NULL OR cs.is_lock_=0)
-        AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
+        AND cs.is_lock_ = 0
+        AND cs.del_flag_ = '0'
         AND CONCAT(cs.class_date_, ' ', cs.end_class_time_) >= #{classDate}
         <if test="endDate != null">
             <![CDATA[AND CONCAT(cs.class_date_, ' ', cs.end_class_time_) < #{endDate}]]>
@@ -429,10 +429,10 @@
         WHERE pg.group_status_ IN ('NORMAL', 'FINISH')
         AND vcs.id_ >=1
         AND pcs.id_ >= 1
-        AND (vcs.is_lock_ IS NULL OR vcs.is_lock_=0)
-        AND (vcs.del_flag_ IS NULL OR vcs.del_flag_=0)
-        AND (pcs.is_lock_ IS NULL OR pcs.is_lock_=0)
-        AND (pcs.del_flag_ IS NULL OR pcs.del_flag_=0)
+        AND vcs.is_lock_=0
+        AND vcs.del_flag_ = '0'
+        AND pcs.is_lock_=0
+        AND pcs.del_flag_ = '0'
         AND CONCAT(vcs.class_date_, ' ', vcs.end_class_time_) >= #{classDate}
         AND CONCAT(pcs.class_date_, ' ', pcs.end_class_time_) >= #{classDate}
         <if test="endDate != null">

+ 47 - 48
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -199,7 +199,7 @@
     </sql>
 
     <sql id="courseIgnore">
-        AND cs.del_flag_ = 0 AND cs.is_lock_ = 0 and cs.pre_course_flag_ != 1
+        AND cs.del_flag_ = '0' AND cs.is_lock_ = 0 and cs.pre_course_flag_ != 1
         AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
     </sql>
 
@@ -1152,7 +1152,7 @@
         <where>
             cssp.user_id_=#{userId}
             AND cs.status_ != 'NOT_START'
-            AND cs.del_flag_ = 0
+            AND cs.del_flag_ = '0'
             AND (cs.is_lock_=0 OR cs.is_lock_ IS NULL) AND cs.pre_course_flag_ != 1
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
             <if test="teachMode!=null and teachMode!=''">
@@ -1897,7 +1897,7 @@
         </foreach>
         )
         and cs.tenant_id_ = #{tenantId}
-        AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
+        AND cs.del_flag_ = '0'
         AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
     </select>
     <select id="findByClassDateAndStu" resultMap="CourseSchedule">
@@ -1921,7 +1921,7 @@
         </foreach>
         )
         and cs.tenant_id_ = #{tenantId} AND cssp.user_id_ = #{userId}
-        AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
+        AND cs.del_flag_ = '0'
         AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
     </select>
 
@@ -2012,7 +2012,7 @@
             AND cs.class_date_ BETWEEN #{startDate} AND #{endDate}
           AND cs.group_type_ = 'MUSIC'
           and cs.tenant_id_ = #{tenantId}
-          AND (cs.del_flag_ IS NULL OR cs.del_flag_ = 0) AND cs.pre_course_flag_ != 1
+          AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
     </select>
 
     <select id="findByClassGroup" resultMap="CourseSchedule">
@@ -2224,7 +2224,7 @@
         WHERE cs.music_group_id_ = #{musicGroupId}
           and cs.group_type_ = 'MUSIC'
           and cs.status_ != 'OVER'
-          AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+          AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
         LIMIT 1
     </select>
     <select id="findClassGroupCourseSchedules" resultMap="CourseSchedule">
@@ -2252,7 +2252,7 @@
                cs.schoole_id_
         FROM course_schedule cs
         WHERE cs.class_group_id_ = #{classGroupId}
-          AND (cs.del_flag_ = 0 OR cs.del_flag_ IS NULL) AND cs.pre_course_flag_ != 1
+          AND (cs.del_flag_ = '0' OR cs.del_flag_ IS NULL) AND cs.pre_course_flag_ != 1
     </select>
     <select id="countVipGroupCourses" resultType="int">
         SELECT count(cs.id_)
@@ -2294,21 +2294,21 @@
         <foreach collection="vipGroupIds" open="(" close=")" separator="," item="item">
             #{item}
         </foreach>
-        AND cs.group_type_ = #{groupType} AND cs.del_flag_ = 0
+        AND cs.group_type_ = #{groupType} AND cs.del_flag_ = '0'
         GROUP BY cs.music_group_id_
     </select>
     <select id="countTotalCourseScheduleNumWithGroup" resultType="int">
         SELECT COUNT(cs.id_)
         FROM course_schedule cs
         WHERE cs.music_group_id_ = #{groupId}
-        AND cs.group_type_ = #{groupType} AND cs.del_flag_ = 0
+        AND cs.group_type_ = #{groupType} AND cs.del_flag_ = '0'
     </select>
     <select id="countCourseScheduleNum" resultType="java.util.Map">
         SELECT cs.music_group_id_ 'key',COUNT(cs.id_) 'value' FROM course_schedule cs WHERE cs.music_group_id_ IN
         <foreach collection="vipGroupIds" open="(" close=")" separator="," item="item">
             #{item}
         </foreach>
-        AND cs.group_type_ = #{groupType} AND cs.status_ != 'NOT_START' AND cs.del_flag_ = 0
+        AND cs.group_type_ = #{groupType} AND cs.status_ != 'NOT_START' AND cs.del_flag_ = '0'
         GROUP BY cs.music_group_id_
     </select>
     <select id="countTotalNumByClassGroupId" resultType="java.util.Map">
@@ -2323,7 +2323,7 @@
         <if test="preCourseFlag != null">
             AND cs.pre_course_flag_ = #{preCourseFlag}
         </if>
-        AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+        AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
         GROUP BY cs.class_group_id_
     </select>
     <select id="countPreTotalNumByClassGroupId" resultType="java.util.Map">
@@ -2332,7 +2332,7 @@
         <foreach collection="classGroupIds" item="item" separator="," open="(" close=")">
             #{item}
         </foreach>
-        AND cs.del_flag_ = 0 AND cs.pre_course_flag_ = 1
+        AND cs.del_flag_ = '0' AND cs.pre_course_flag_ = 1
         GROUP BY cs.class_group_id_
     </select>
     <select id="countTotalNumByClassGroupIds" resultType="java.util.Map">
@@ -2347,7 +2347,7 @@
         <if test="endClassDate != null">
             AND cs.class_date_ &lt;= DATE_FORMAT(#{endClassDate}, '%Y%m%d')
         </if>
-        AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
+        AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
         GROUP BY cs.class_group_id_
     </select>
     <select id="queryCourseTypeByClassGroupIds" resultType="java.lang.String">
@@ -2360,7 +2360,7 @@
         <if test="dto.endSchoolTerm != null">
             AND cs.class_date_ &lt;= DATE_FORMAT(#{dto.endSchoolTerm}, '%Y%m%d')
         </if>
-        AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
+        AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
         UNION ALL
         SELECT DISTINCT tp.course_type_ type_ FROM music_group_train_plan tp
         WHERE tp.class_group_id_ = #{dto.classGroupId}
@@ -2380,7 +2380,7 @@
         <if test="teacherId != null">
             AND cs.actual_teacher_id_ = #{teacherId}
         </if>
-        AND cs.status_ = 'NOT_START' AND cs.del_flag_ = 0 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cs.pre_course_flag_ != 1
+        AND cs.status_ = 'NOT_START' AND cs.del_flag_ = '0' AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cs.pre_course_flag_ != 1
         GROUP BY cs.class_group_id_
     </select>
     <select id="countCurrentNumByClassId" resultType="java.lang.Integer">
@@ -2389,7 +2389,7 @@
         <if test="teacherId != null">
             AND cs.actual_teacher_id_ = #{teacherId}
         </if>
-        AND cs.status_ = 'NOT_START' AND cs.del_flag_ = 0 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cs.pre_course_flag_ != 1
+        AND cs.status_ = 'NOT_START' AND cs.del_flag_ = '0' AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cs.pre_course_flag_ != 1
     </select>
 
     <select id="countExpendNumByClassGroupId" resultType="java.util.Map">
@@ -2398,7 +2398,7 @@
         <foreach collection="classGroupIds" item="item" separator="," open="(" close=")">
             #{item}
         </foreach>
-        AND cs.status_ != 'NOT_START' AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+        AND cs.status_ != 'NOT_START' AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
         GROUP BY cs.class_group_id_
     </select>
     <select id="countExpendNumByClassGroupIds" resultType="java.util.Map">
@@ -2413,7 +2413,7 @@
         <if test="endClassDate != null">
             AND cs.class_date_ &lt;= DATE_FORMAT(#{endClassDate}, '%Y%m%d')
         </if>
-        AND cs.status_ != 'NOT_START' AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
+        AND cs.status_ != 'NOT_START' AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
         GROUP BY cs.class_group_id_
     </select>
 
@@ -2508,7 +2508,7 @@
 
     <sql id="endFindCourseSchedulesCondition">
         <where>
-            cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 and cs.tenant_id_ = #{tenantId}
+            cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 and cs.tenant_id_ = #{tenantId}
             <include refid="queryVipCourseScheduleIds"/>
         </where>
     </sql>
@@ -2579,7 +2579,7 @@
         WHERE FIND_IN_SET(cs.class_group_id_, #{classGroupIds})
           AND cs.status_ = 'NOT_START'
           AND cs.class_date_ &gt;= DATE_FORMAT(#{fromDate}, "%Y-%m-%d")
-          AND (cs.del_flag_ IS NULL OR cs.del_flag_ = 0) AND cs.pre_course_flag_ != 1
+          AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
     </select>
 
     <select id="findGroupCourseStartTime" resultType="java.util.Date">
@@ -3018,7 +3018,7 @@
                 AND del_flag_ = 0) c
         WHERE cs.class_group_id_ = c.class_group_id_
           AND CONCAT(cs.class_date_, " ", cs.start_class_time_) &lt;= c.class_date_
-          AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+          AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
     </select>
     <select id="findCourseSchedulesByClassGroups" resultMap="CourseSchedule">
         SELECT
@@ -3077,7 +3077,7 @@
         FROM course_schedule cs
         WHERE cs.group_type_ = #{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
           AND cs.music_group_id_ = #{groupId}
-            AND cs.del_flag_ = 0
+            AND cs.del_flag_ = '0'
         ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_)
         LIMIT 1
     </select>
@@ -3274,14 +3274,14 @@
         FROM course_schedule cs
         WHERE cs.music_group_id_ = #{groupId}
           AND cs.group_type_ = #{groupType}
-          AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+          AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
     </select>
     <select id="findCourseByGroupIds" resultMap="CourseSchedule">
         SELECT
         <include refid="resultSql"></include>
         FROM course_schedule cs
         WHERE cs.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        AND cs.del_flag_ = 0
+        AND cs.del_flag_ = '0'
         AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = 0) AND cs.pre_course_flag_ != 1
         AND cs.music_group_id_ IN
             <foreach collection="groupIds" item="groupId" open="(" close=")" separator=",">
@@ -3346,8 +3346,8 @@
         <if test="status != null">
             AND cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         </if>
-        AND (cs.is_lock_ IS NULL OR cs.is_lock_ =0)
-        AND (cs.del_flag_ IS NULL OR cs.del_flag_ =0)
+        AND cs.is_lock_ =0
+        AND cs.del_flag_ = '0'
         GROUP BY cssp.user_id_
     </select>
 
@@ -3380,8 +3380,8 @@
             #{studentId}
         </foreach>
         AND cssp.group_type_ = #{groupType}
-        AND (cs.is_lock_ IS NULL OR cs.is_lock_ =0)
-        AND (cs.del_flag_ IS NULL OR cs.del_flag_ =0)
+        AND cs.is_lock_ =0
+        AND cs.del_flag_ = '0'
         GROUP BY cssp.user_id_;
     </select>
 
@@ -3399,8 +3399,8 @@
         </foreach>
         AND cssp.group_type_ = 'VIP'
         AND vg.group_status_!=3
-        AND (cs.is_lock_ IS NULL OR cs.is_lock_ =0)
-        AND (cs.del_flag_ IS NULL OR cs.del_flag_ =0)
+        AND cs.is_lock_ =0
+        AND cs.del_flag_ = '0'
         GROUP BY cssp.user_id_;
     </select>
 
@@ -3441,12 +3441,12 @@
     <select id="getLastTime" resultType="java.util.Date">
         SELECT MAX(CONCAT(cs.class_date_," ",cs.end_class_time_))
         FROM course_schedule cs
-        WHERE cs.music_group_id_ = #{practiceGroupId} AND cs.del_flag_ = 0 AND cs.group_type_ = #{groupType};
+        WHERE cs.music_group_id_ = #{practiceGroupId} AND cs.del_flag_ = '0' AND cs.group_type_ = #{groupType};
     </select>
     <select id="getFirstTime" resultType="java.util.Date">
         SELECT MIN(CONCAT(cs.class_date_," ",cs.end_class_time_))
         FROM course_schedule cs
-        WHERE cs.music_group_id_ = #{practiceGroupId} AND cs.del_flag_ = 0 AND cs.group_type_ = #{groupType};
+        WHERE cs.music_group_id_ = #{practiceGroupId} AND cs.del_flag_ = '0' AND cs.group_type_ = #{groupType};
     </select>
     <select id="countStudentVipCoursesWithDate" resultType="map">
         SELECT
@@ -3527,13 +3527,13 @@
                cs.organ_id_ FROM course_schedule cs
         LEFT JOIN course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
         WHERE FIND_IN_SET(cs.class_group_id_,#{classGroupIds}) AND csts.teacher_role_ = #{teacherRole}
-        AND csts.user_id_ = #{teacherId} AND CONCAT(cs.class_date_,' ',cs.start_class_time_) > NOW() AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+        AND csts.user_id_ = #{teacherId} AND CONCAT(cs.class_date_,' ',cs.start_class_time_) > NOW() AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
     </select>
     <select id="queryHasReatClass" resultType="java.util.Map">
         SELECT cgtm.class_group_id_ 'key',CASE WHEN COUNT(cs.id_) > 0 THEN 1 ELSE 0 END 'value'
         FROM class_group_teacher_mapper cgtm
         LEFT JOIN course_schedule cs ON cs.class_group_id_ = cgtm.class_group_id_
-        AND CONCAT(cs.class_date_,' ',cs.start_class_time_) > NOW() AND cs.del_flag_ = 0
+        AND CONCAT(cs.class_date_,' ',cs.start_class_time_) > NOW() AND cs.del_flag_ = '0'
         WHERE cgtm.user_id_ = #{teacherId} AND cgtm.group_type_ = 'MUSIC' AND cs.pre_course_flag_ != 1 AND cgtm.class_group_id_ IN
         <foreach collection="classGroupIds" item="classGroupId" separator="," open="(" close=")">
             #{classGroupId}
@@ -3644,7 +3644,7 @@
             LEFT JOIN course_schedule_student_payment cssp ON cs.id_=cssp.course_schedule_id_
             LEFT JOIN course_schedule_teacher_salary csts ON cs.id_=csts.course_schedule_id_
             LEFT JOIN organization o ON cs.organ_id_=o.id_
-        WHERE cs.organ_id_!=41 AND cs.del_flag_=0 AND cs.class_date_ >= '2020-11-01'
+        WHERE cs.organ_id_!=41 AND cs.del_flag_ = '0' AND cs.class_date_ >= '2020-11-01'
     </select>
 
     <select id="countCourseMergeTime" resultType="int">
@@ -3852,9 +3852,8 @@
             course_schedule cs
             LEFT JOIN course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
             LEFT JOIN school s ON cs.schoole_id_=s.id_
-        WHERE
-            ( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
-            AND (cs.is_lock_=0 OR cs.is_lock_ IS NULL)
+        WHERE cs.del_flag_ = '0'
+            AND cs.is_lock_=0
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
             AND csts.user_id_ = #{teacherId} AND cs.pre_course_flag_ != 1
             <if test="startDay!=null and startDay!=''">
@@ -3873,8 +3872,8 @@
 
     <sql id="queryTeacherCourseCondition">
         <where>
-            ( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
-            AND (cs.is_lock_=0 OR cs.is_lock_ IS NULL)
+            cs.del_flag_ = '0'
+            AND cs.is_lock_=0
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
             AND cs.class_date_ &gt;= "2021-03-01" AND cs.pre_course_flag_ != 1
             <if test="teacherId!=null">
@@ -3981,7 +3980,7 @@
         SELECT CONCAT(cs.class_date_,' ',cs.start_class_time_,'~',end_class_time_) start_class_time_ FROM course_schedule cs
         WHERE cs.class_date_ BETWEEN #{dto.startSchoolTerm} AND #{dto.endSchoolTerm}
         AND cs.class_group_id_ = #{dto.classGroupId} AND cs.type_ = #{dto.courseScheduleType}
-        AND cs.is_lock_ = 0 AND cs.pre_course_flag_ != 1 AND cs.del_flag_ = 0
+        AND cs.is_lock_ = 0 AND cs.pre_course_flag_ != 1 AND cs.del_flag_ = '0'
         ORDER BY cs.class_date_,cs.start_class_time_
     </select>
     <select id="countCourseByClassAndType" resultType="int">
@@ -3993,7 +3992,7 @@
         <if test="dto.endSchoolTerm != null">
             AND cs.class_date_ &lt;= DATE_FORMAT(#{dto.endSchoolTerm}, '%Y%m%d')
         </if>
-        AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
+        AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
     </select>
     <select id="getCourseNumNo" resultType="int">
         SELECT COUNT(id_) FROM course_schedule
@@ -4049,7 +4048,7 @@
     <select id="queryHasCourseStudentIds" resultType="java.lang.Integer">
         SELECT DISTINCT s.user_id_ FROM student s
         LEFT JOIN course_schedule_student_payment cssp ON s.user_id_ = cssp.user_id_
-        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.group_type_ = #{groupType} AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.group_type_ = #{groupType} AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
         LEFT JOIN sys_user su ON su.id_ = s.user_id_
         WHERE 1=1 and s.tenant_id_ = #{tenantId}
         <if test="hasMember != null">
@@ -4097,7 +4096,7 @@
     <sql id="queryCourseEvaluateSql">
         <where>
             cs.status_ = 'OVER' AND ta.sign_in_time_ IS NOT NULL AND cs.group_type_ != 'LIVE'
-            AND cs.del_flag_ = 0 AND (cs.is_lock_ = 0 OR cs.is_lock_ IS NULL) AND cs.pre_course_flag_ != 1
+            AND cs.del_flag_ = '0' AND (cs.is_lock_ = 0 OR cs.is_lock_ IS NULL) AND cs.pre_course_flag_ != 1
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_) AND sa.id_ IS NOT NULL
             <if test="teacherId != null">
                 AND ta.teacher_id_ = #{teacherId}
@@ -4365,7 +4364,7 @@
         select cs.type_ scheduleType,COUNT(CASE WHEN cs.status_ = 'NOT_START' THEN 1 END) subCourseNum,
                COUNT(cs.id_) totalCourseNum
         from course_schedule cs
-        where cs.group_type_ = 'MUSIC' AND cs.is_lock_ = 0 AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
+        where cs.group_type_ = 'MUSIC' AND cs.is_lock_ = 0 AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
         AND cs.class_date_ BETWEEN #{startTerm} AND #{endTerm}
         AND cs.music_group_id_ IN
         <foreach collection="musicGroupIds" item="musicGroupId" open="(" separator="," close=")">
@@ -4383,7 +4382,7 @@
     <select id="getDailySummaryOfClassesForTheCurrentSemester" resultMap="DailySummaryMap">
         select cs.class_date_ courseDate,cs.type_ scheduleType,COUNT(cs.id_) totalCourseNum
         from course_schedule cs
-        where cs.group_type_ = 'MUSIC' AND cs.is_lock_ = 0 AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
+        where cs.group_type_ = 'MUSIC' AND cs.is_lock_ = 0 AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
         AND cs.class_date_ BETWEEN #{startTerm} AND #{endTerm}
         AND cs.music_group_id_ IN
         <foreach collection="musicGroupIds" item="musicGroupId" open="(" separator="," close=")">
@@ -4395,7 +4394,7 @@
         select cs.id_ courseId,CONCAT(cs.class_date_,' ',cs.start_class_time_,'~',cs.end_class_time_) classDate,cs.status_ courseStatus,cs.name_ courseName,
         actual_teacher_id_ teacherId,cs.music_group_id_ musicGroupId,cs.teach_mode_ teachMode
         from course_schedule cs
-        where cs.group_type_ = 'MUSIC' AND cs.is_lock_ = 0 AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
+        where cs.group_type_ = 'MUSIC' AND cs.is_lock_ = 0 AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
         <if test="classDate != null and classDate != ''">
             AND cs.class_date_ = #{classDate}
         </if>
@@ -4479,7 +4478,7 @@
         left join course_schedule_student_payment cssp ON cs.id_ = cssp.course_schedule_id_
         left join organization o ON o.id_ = cs.organ_id_
         where DATE_FORMAT(cs.class_date_,'%Y-%m') = #{month} AND cssp.actual_price_ > 0
-          AND cs.del_flag_ = 0 AND cs.is_lock_ = 0 and cs.pre_course_flag_ != 1
+          AND cs.del_flag_ = '0' AND cs.is_lock_ = 0 and cs.pre_course_flag_ != 1
           AND cs.tenant_id_ = 1
         group by cs.id_ order by cs.organ_id_;
     </select>

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

@@ -171,8 +171,7 @@
 
     <sql id="practiceGroupReviewsQueryCondition">
         <where>
-            AND pg.id_ > 0 AND cs.group_type_='PRACTICE' AND cs.status_='OVER' AND (cs.del_flag_ = 0 OR cs.del_flag_ IS
-            NULL)
+            AND pg.id_ > 0 AND cs.group_type_='PRACTICE' AND cs.status_='OVER' AND cs.del_flag_ = '0'
             <if test="search!=null and search!=''">
                 AND (cs.name_ LIKE CONCAT('%',#{search},'%') OR cs.id_= #{search})
             </if>
@@ -425,8 +424,9 @@
 
     <sql id="courseReviewsQueryCondition">
         <where>
-            AND cs.type_ IN ('PRACTICE','VIP') AND cs.teach_mode_='ONLINE' AND cs.status_='OVER' AND (cs.del_flag_ = 0
-            OR cs.del_flag_ IS NULL) and cs.tenant_id_ = #{tenantId}
+            AND cs.type_ IN ('PRACTICE','VIP') AND cs.teach_mode_='ONLINE'
+            AND cs.status_='OVER' AND cs.del_flag_ = '0'
+            and cs.tenant_id_ = #{tenantId}
             <if test="search!=null and search!=''">
                 AND (cs.name_ LIKE CONCAT('%',#{search},'%') OR cs.id_= #{search})
             </if>
@@ -513,7 +513,7 @@
 
     <sql id="vipGroupReviewsQueryCondition">
         <where>
-            AND vg.id_ > 0 AND cs.group_type_='VIP' AND cs.status_='OVER' AND (cs.del_flag_ = 0 OR cs.del_flag_ IS NULL) and cs.tenant_id_ = #{tenantId}
+            AND vg.id_ > 0 AND cs.group_type_='VIP' AND cs.status_='OVER' AND cs.del_flag_ = '0' and cs.tenant_id_ = #{tenantId}
             <if test="search!=null and search!=''">
                 AND (cs.name_ LIKE CONCAT('%',#{search},'%') OR cs.id_= #{search})
             </if>

+ 7 - 7
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -312,7 +312,7 @@
 			#{item}
 		</foreach>
 		AND cs.group_type_ = #{groupType} AND cssp.user_id_ = #{userId}
-		AND cs.status_ = 'NOT_START' AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+		AND cs.status_ = 'NOT_START' AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
 		GROUP BY cssp.music_group_id_
 	</select>
     <select id="countStudentCourseNumWithGroup" resultType="int">
@@ -495,7 +495,7 @@
 		<if test="courseScheduleType != null">
 		AND cs.type_= #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 		</if>
-		AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) &gt; NOW() AND cs.pre_course_flag_ != 1 AND cs.del_flag_ = 0 AND cs.is_lock_ = 0
+		AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) &gt; NOW() AND cs.pre_course_flag_ != 1 AND cs.del_flag_ = '0' AND cs.is_lock_ = 0
 	</select>
 	<select id="countStudentsNotStartCourseNumWithCourseType" resultType="map">
 		SELECT cssp.user_id_ 'key',COUNT(DISTINCT cssp.course_schedule_id_) 'value'
@@ -508,7 +508,7 @@
 		<if test="courseScheduleType != null">
 			AND cs.type_= #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 		</if>
-		AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) &gt; NOW() AND cs.pre_course_flag_ != 1 AND cs.del_flag_ = 0 AND cs.is_lock_ = 0
+		AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) &gt; NOW() AND cs.pre_course_flag_ != 1 AND cs.del_flag_ = '0' AND cs.is_lock_ = 0
 		GROUP BY cssp.user_id_
 	</select>
 	<select id="queryMidiByUserIdsAndCourseId" resultType="java.util.Map">
@@ -789,7 +789,7 @@
     <select id="getHasVipCourseStudentIds" resultType="int">
 		SELECT cssp.user_id_ FROM course_schedule_student_payment cssp
 		LEFT JOIN course_schedule cs ON cssp.course_schedule_id_=cs.id_
-		WHERE cssp.group_type_='VIP' AND cs.del_flag_=0
+		WHERE cssp.group_type_='VIP' AND cs.del_flag_ = '0'
 		<if test="studentIds!=null and studentIds.size()>0">
 			AND cssp.user_id_ IN
 			<foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
@@ -808,7 +808,7 @@
 		WHERE
 			cssp.group_type_ IN ('VIP', 'PRACTICE')
 			AND cs.status_='NOT_START'
-			AND su.del_flag_ = 0
+			AND su.del_flag_ = '0'
 			AND su.organ_id_ = #{organId}
 	</select>
 
@@ -823,7 +823,7 @@
 		WHERE
 			cssp.group_type_ IN ('VIP', 'PRACTICE')
 			  AND cs.status_='NOT_START'
-			  AND su.del_flag_ = 0
+			  AND su.del_flag_ = '0'
 			<if test="studentIds!=null and studentIds.size()>0">
 				AND su.organ_id_ IN
 				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
@@ -1115,7 +1115,7 @@
 		select cs.organ_id_ 'key',SUM(cssp.actual_price_) 'value' from course_schedule_student_payment cssp
 		left join course_schedule cs ON cs.id_ = cssp.course_schedule_id_
 		where cs.class_date_ BETWEEN #{cutFirstDayOfMonth} AND #{cutLastDayOfMonth} AND cssp.actual_price_ > 0
-		AND cs.del_flag_ = 0 AND cs.is_lock_ = 0 and cs.pre_course_flag_ != 1 AND cs.tenant_id_ = 1
+		AND cs.del_flag_ = '0' AND cs.is_lock_ = 0 and cs.pre_course_flag_ != 1 AND cs.tenant_id_ = 1
 		group by cs.organ_id_
 	</select>
 

+ 15 - 15
mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml

@@ -313,7 +313,7 @@
 		</if>
 		AND cs.group_type_ IN ('VIP','LIVE') AND vg.organ_id_ != 41
 		AND csts.settlement_time_ IS NULL
-		AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
+		AND cs.del_flag_ = '0'
     </select>
     <select id="findTeacherCourseSalaryNoSettlement" resultMap="CourseScheduleTeacherSalary">
 		SELECT
@@ -331,7 +331,7 @@
 		</if>
 		AND cs.group_type_ = #{groupType}
 		AND csts.settlement_time_ IS NULL
-		AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
+		AND cs.del_flag_ = '0'
     </select>
     
     <select id="queryByCourseScheduleIdAndUserId" resultMap="CourseScheduleTeacherSalary" parameterType="map">
@@ -880,7 +880,7 @@
 
 	<sql id="queryCourseSalaryCondition">
 		<where>
-			(cs.del_flag_ IS NULL OR cs.del_flag_=0)
+			cs.del_flag_ = '0'
             AND csts.group_type_!='COMM'
 			AND csts.settlement_time_ IS NOT NULL
 			AND t.is_settlement_salary_ = 1 and csts.tenant_id_ = #{tenantId}
@@ -995,7 +995,7 @@
 			course_schedule_teacher_salary csts
 			LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_
 		WHERE
-			( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
+			cs.del_flag_ = '0'
 			AND csts.settlement_time_ IS NOT NULL
 			AND csts.user_id_ = #{teacherId}
 			AND DATE_FORMAT( cs.class_date_, '%Y-%m' ) = #{month}
@@ -1010,8 +1010,8 @@
 			course_schedule_teacher_salary csts
 			LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_
 		WHERE
-			( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
-			AND (cs.is_lock_=0 OR cs.is_lock_ IS NULL)
+			cs.del_flag_ = '0'
+			AND cs.is_lock_=0
 			AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
 			AND csts.settlement_time_ IS NOT NULL
 			AND csts.user_id_ = #{teacherId}
@@ -1026,7 +1026,7 @@
 			course_schedule_teacher_salary csts
 			LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_
 		WHERE
-			( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
+		cs.del_flag_ = '0'
 			AND csts.group_type_!='COMM'
 			AND csts.settlement_time_ IS NOT NULL and csts.tenant_id_ = #{tenantId}
 			<if test="teacherId!=null">
@@ -1041,7 +1041,7 @@
         course_schedule_teacher_salary csts
         LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_
         WHERE
-        	( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
+			cs.del_flag_ = '0'
 			AND csts.group_type_!='COMM'
         	AND csts.settlement_time_ IS NOT NULL and csts.tenant_id_ = #{tenantId}
         	AND DATE_FORMAT( cs.class_date_, '%Y-%m' ) = #{month}
@@ -1125,7 +1125,7 @@
 			LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_
 		WHERE
 			cs.class_date_ BETWEEN #{startDate} AND #{endDate}
-		  AND ( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
+		  AND cs.del_flag_ = '0'
 		  AND csts.settlement_time_ IS NOT NULL and csts.tenant_id_ = #{tenantId}
 	</select>
 
@@ -1148,8 +1148,8 @@
 			LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_
 			LEFT JOIN school s ON cs.schoole_id_=s.id_
 		WHERE
-			( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
-			AND (cs.is_lock_=0 OR cs.is_lock_ IS NULL)
+		cs.del_flag_ = '0'
+			AND cs.is_lock_=0
 			AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
 			AND csts.user_id_ = #{teacherId} AND cs.pre_course_flag_ != 1
 			<if test="startClassDay!=null and startClassDay!=''">
@@ -1176,8 +1176,8 @@
 			course_schedule_teacher_salary csts
 				LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_
 		WHERE
-			( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
-			AND ( cs.is_lock_ = 0 OR cs.is_lock_ IS NULL )
+		cs.del_flag_ = '0'
+			AND cs.is_lock_ = 0
 			AND ( cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_ )
 			AND csts.user_id_ = #{teacherId}
 			<if test="year!=null">
@@ -1203,8 +1203,8 @@
 		FROM course_schedule_teacher_salary csts
 			LEFT JOIN course_schedule cs ON cs.id_=csts.course_schedule_id_
 		WHERE cs.class_date_ = CURDATE()
-			AND ( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
-			AND ( cs.is_lock_ = 0 OR cs.is_lock_ IS NULL )
+			AND cs.del_flag_ = '0'
+			AND cs.is_lock_ = 0
 			AND ( cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_ ) AND cs.pre_course_flag_ != 1
 	</select>
 </mapper>

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

@@ -318,7 +318,7 @@
     	select count(cs.id_) from course_schedule cs
         left join demo_group vg on cs.music_group_id_ = vg.id_
         where cs.type_ = 'DEMO'
-  		and DATE_FORMAT(cs.class_date_, '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m') and (cs.del_flag_ = 0 or cs.del_flag_ is null) and INTE_ARRAY(vg.organ_id_list_,'36,38') = 0
+  		and DATE_FORMAT(cs.class_date_, '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m') and cs.del_flag_ = '0' and INTE_ARRAY(vg.organ_id_list_,'36,38') = 0
         <if test="organIds != null">
             AND INTE_ARRAY(vg.organ_id_list_,#{organIds})
         </if>

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

@@ -248,7 +248,7 @@
             LEFT JOIN sys_user_role sur ON sur.user_id_ = e.user_id_
         </if>
         <where>
-            su.del_flag_ = 0 and su.tenant_id_ = #{tenantId}
+            su.del_flag_ = '0' and su.tenant_id_ = #{tenantId}
             <if test="lockFlag != null">
                 AND su.lock_flag_ = #{lockFlag}
             </if>
@@ -284,7 +284,7 @@
             LEFT JOIN sys_user_role sur ON sur.user_id_ = e.user_id_
         </if>
         <where>
-            su.del_flag_ = 0 and su.tenant_id_ = #{tenantId}
+            su.del_flag_ = '0' and su.tenant_id_ = #{tenantId}
             <if test="organId != null">
                 AND INTE_ARRAY(e.organ_id_list_,#{organId})
             </if>
@@ -319,7 +319,7 @@
             LEFT JOIN sys_user_role sur ON su.id_ = sur.user_id_
             LEFT JOIN employee e ON e.user_id_ = su.id_
         WHERE
-            su.lock_flag_ = 0 AND su.del_flag_ = 0 AND FIND_IN_SET(sur.role_id_, #{roleIds})
+            su.lock_flag_ = 0 AND su.del_flag_ = '0' AND FIND_IN_SET(sur.role_id_, #{roleIds})
             <if test="organIds!=null and organIds!=''">
                 AND INTE_ARRAY(e.organ_id_list_,#{organIds})
             </if>
@@ -344,7 +344,7 @@
         SELECT COUNT(DISTINCT cs.id_)
         FROM course_schedule_teacher_salary csts
         LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
-        AND CONCAT(cs.class_date_,' ',cs.start_class_time_) > NOW() AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+        AND CONCAT(cs.class_date_,' ',cs.start_class_time_) > NOW() AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
         WHERE csts.user_id_ = #{employeeId}
     </select>
 
@@ -443,7 +443,7 @@
     </select>
     <sql id="queryEmployeeBasicInfoSql">
         <where>
-            e.demission_date_ IS NULL AND su.lock_flag_ = 0 AND su.del_flag_ = 0
+            e.demission_date_ IS NULL AND su.lock_flag_ = 0 AND su.del_flag_ = '0'
             <if test="search != null and search != ''">
                 AND (e.user_id_ = #{search} OR su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
             </if>

+ 54 - 65
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -218,11 +218,11 @@
 
 	<select id="getStudentSignUpData" resultMap="IndexBaseMonthData">
 		SELECT
-			organ_id_,su.tenant_id_,
+			su.organ_id_,su.tenant_id_,
 			#{dayStr} month_,
-			COUNT( id_ ) total_num_,
-			COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END) activate_num_,
-			TRUNCATE(COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END)/COUNT( id_ )*100, 2) percent_
+			COUNT( su.id_ ) total_num_,
+			COUNT(CASE WHEN su.password_ IS NOT NULL THEN su.id_ ELSE NULL END) activate_num_,
+			TRUNCATE(COUNT(CASE WHEN su.password_ IS NOT NULL THEN su.id_ ELSE NULL END)/COUNT( su.id_ )*100, 2) percent_
 		FROM
 			((
 				 SELECT DISTINCT
@@ -231,7 +231,7 @@
 					 student_registration sr
 					LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
 				 WHERE
-					 mg.status_ IN ( 'PREPARE', 'PROGRESS' )
+					 mg.status_ IN ( 'PREPARE', 'PROGRESS' ) and sr.tenant_id_ = #{tenantId}
 				   AND sr.music_group_status_ = 'NORMAL'
 				   AND DATE_FORMAT(sr.create_time_, '%Y-%m-%d')&lt;=#{dayStr}
 			 ) UNION ALL
@@ -242,21 +242,18 @@
 				course_schedule_student_payment cssp
 				LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
 			 WHERE
-				 cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
-			   AND ( cs.is_lock_ = 0 OR cs.is_lock_ IS NULL )
+				 cs.del_flag_ = '0' AND cs.pre_course_flag_ = 0 and cssp.tenant_id_ = #{tenantId} AND cs.is_lock_ = 0
 			   AND ( cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_ )
 			   AND cssp.group_type_ IN ('VIP', 'PRACTICE')
-			   AND cs.organ_id_ IS NOT NULL
 			   AND DATE_FORMAT(cssp.create_time_, '%Y-%m-%d')&lt;=#{dayStr}
 				AND cs.class_date_ &gt;= #{courseStartDay}
 			)) u
-			LEFT JOIN sys_user su ON u.user_id_ = su.id_
+			LEFT JOIN student st ON u.user_id_ = st.user_id_
+			LEFT JOIN sys_user su ON st.user_id_ = su.id_
 		WHERE
-			del_flag_=0 and su.tenant_id_ = #{tenantId}
-		  	AND organ_id_ IS NOT NULL
-			AND user_type_ LIKE '%STUDENT%'
-		GROUP BY organ_id_
-		ORDER BY organ_id_;
+			su.del_flag_ = '0' and su.tenant_id_ = #{tenantId}
+		GROUP BY su.organ_id_
+		ORDER BY su.organ_id_;
 	</select>
 
 	<select id="getStudentRegistrationData" resultMap="IndexBaseMonthData">
@@ -270,12 +267,10 @@
 			student stu
 			LEFT JOIN sys_user su ON stu.user_id_=su.id_
 		WHERE
-			su.del_flag_=0 and su.tenant_id_ = #{tenantId}
-		  AND su.organ_id_ IS NOT NULL
-		  AND su.user_type_ LIKE '%STUDENT%'
+			su.del_flag_='0' and su.tenant_id_ = #{tenantId}
 		  AND DATE_FORMAT(stu.create_time_, '%Y-%m-%d')&lt;=#{dayStr}
-		GROUP BY organ_id_
-		ORDER BY organ_id_;
+		GROUP BY su.organ_id_
+		ORDER BY su.organ_id_;
 	</select>
 
 	<select id="getAddStudentRegistrationData" resultMap="IndexBaseMonthData">
@@ -288,13 +283,10 @@
 		FROM
 			student stu
 			LEFT JOIN sys_user su ON stu.user_id_=su.id_
-		WHERE
-			su.del_flag_=0 and su.tenant_id_ = #{tenantId}
-		  AND su.organ_id_ IS NOT NULL
-		  AND su.user_type_ LIKE '%STUDENT%'
+		WHERE su.del_flag_='0' and su.tenant_id_ = #{tenantId}
 		  AND DATE_FORMAT(stu.create_time_, '%Y-%m-%d')=#{dayStr}
-		GROUP BY organ_id_
-		ORDER BY organ_id_;
+		GROUP BY su.organ_id_
+		ORDER BY su.organ_id_;
 	</select>
 
 	<select id="getChargeStudentChangeData" resultMap="IndexBaseMonthData">
@@ -309,12 +301,10 @@
 			LEFT JOIN sys_user su ON stu.user_id_=su.id_
 			LEFT JOIN student_payment_order spo ON stu.user_id_=spo.user_id_ AND status_='SUCCESS' AND actual_amount_>0
 		WHERE
-			su.del_flag_=0 and su.tenant_id_ = #{tenantId}
-			  AND su.organ_id_ IS NOT NULL
-			  AND su.user_type_ LIKE '%STUDENT%'
+			su.del_flag_='0' and su.tenant_id_ = #{tenantId}
 			  AND DATE_FORMAT(stu.create_time_, '%Y-%m-%d')&lt;=#{dayStr}
-		GROUP BY organ_id_
-		ORDER BY organ_id_;
+		GROUP BY su.organ_id_
+		ORDER BY su.organ_id_;
 	</select>
 
 	<select id="getHomeworkData" resultMap="IndexBaseMonthData">
@@ -341,7 +331,7 @@
 		FROM student_extracurricular_exercises_situation_ sees
 		LEFT JOIN sys_user su ON sees.student_id_=su.id_
 		LEFT JOIN teacher tea ON sees.teacher_id_=tea.id_
-		WHERE su.del_flag_=0 and su.tenant_id_ = #{tenantId}
+		WHERE su.del_flag_='0' and sees.tenant_id_ = #{tenantId}
 		  	AND tea.job_nature_='FULL_TIME'
 			AND su.organ_id_ IS NOT NULL
 			AND DATE_FORMAT(sees.monday_, '%Y-%m-%d')&lt;=#{dayStr}
@@ -434,7 +424,7 @@
 			teacher t
 			LEFT JOIN sys_user su ON su.id_ = t.id_
 		WHERE
-			su.del_flag_ = 0 and t.tenant_id_ = #{tenantId}
+			su.del_flag_ = '0' and t.tenant_id_ = #{tenantId}
 		  	AND (t.demission_date_ IS NULl OR DATE_FORMAT(t.demission_date_, '%Y-%m-%d') &gt; #{dayStr})
 		  	<if test="isDemission==null">
 				AND su.lock_flag_ = 0
@@ -653,7 +643,7 @@
 			LEFT JOIN course_schedule cs ON m.course_schedule_id_=cs.id_
 			LEFT JOIN practice_group pg ON m.music_group_id_=pg.id_ AND m.group_type_='PRACTICE'
 		WHERE
-			(cs.del_flag_ IS NULL OR cs.del_flag_=0)
+		cs.del_flag_ = '0'
 			AND cs.organ_id_ IS NOT NULL and cs.tenant_id_ = #{tenantId}
 			AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
 			AND m.group_type_ IN ('VIP', 'PRACTICE')
@@ -750,7 +740,7 @@
 		WHERE
 		cg.type_ IN ('HIGH', 'HIGH_ONLINE') and cg.tenant_id_ = #{tenantId}
 		AND mg.status_ = 'PROGRESS' AND cg.del_flag_ = 0 AND cs.pre_course_flag_ != 1
-		AND cs.del_flag_=0
+		AND cs.del_flag_ = '0'
 		AND cs.status_='NOT_START'
 		AND ( cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_ )
 		<if test="hasDesc != null and hasDesc == true">
@@ -786,7 +776,7 @@
 		WHERE
 		cg.type_ IN ('HIGH', 'HIGH_ONLINE') AND cs.pre_course_flag_ != 1 and cg.tenant_id_ = #{tenantId}
 		AND mg.status_ = 'PROGRESS' AND cg.del_flag_ = 0
-		AND cs.del_flag_=0
+		AND cs.del_flag_ = '0'
 		AND cs.status_='NOT_START'
 		AND ( cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_ )
 		<if test="educationUserId != null">
@@ -948,7 +938,7 @@
 			LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND sa.user_id_ = cssp.user_id_
 			LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_
 		WHERE
-				cs.status_ = 'OVER' AND sv.id_ IS NULL AND cs.del_flag_ = 0 AND cs.class_date_ >= #{startTime} AND cs.class_date_ &lt;= DATE_FORMAT(NOW(),'%Y-%m-%d')
+				cs.status_ = 'OVER' AND sv.id_ IS NULL AND cs.del_flag_ = '0' AND cs.class_date_ >= #{startTime} AND cs.class_date_ &lt;= DATE_FORMAT(NOW(),'%Y-%m-%d')
 				AND cssp.group_type_ IN ('MUSIC','PRACTICE','VIP') AND cs.pre_course_flag_ != 1 and cssp.tenant_id_ = #{tenantId}
 			<if test="type!=null and type=='LEAVE'">
 				AND sa.status_ = 'LEAVE'
@@ -965,7 +955,7 @@
 	</select>
     <select id="getCourseTimeError" resultType="int">
 		SELECT COUNT(cs.id_) FROM course_schedule cs
-		WHERE cs.status_ = 'NOT_START' AND cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND (cs.start_class_time_ &lt; #{courseStartTimeError} OR cs.end_class_time_ > #{courseEndTimeError})
+		WHERE cs.status_ = 'NOT_START' AND cs.del_flag_ = '0' AND cs.is_lock_ = 0 AND (cs.start_class_time_ &lt; #{courseStartTimeError} OR cs.end_class_time_ > #{courseEndTimeError})
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cs.pre_course_flag_ != 1 and cs.tenant_id_ = #{tenantId}
 		<if test="classGroupIds != null and classGroupIds.size() > 0">
 			AND cs.class_group_id_ IN
@@ -986,7 +976,7 @@
 		       cs.organ_id_ AS 'key',
 		       COUNT(cs.id_) AS 'value'
 		FROM course_schedule cs
-		WHERE cs.status_ = 'NOT_START' AND cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.start_class_time_ &lt; '06:00:00'
+		WHERE cs.status_ = 'NOT_START' AND cs.del_flag_ = '0' AND cs.is_lock_ = 0 AND cs.start_class_time_ &lt; '06:00:00'
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cs.pre_course_flag_ != 1 and cs.tenant_id_ = #{tenantId}
 		<if test="classGroupIds != null and classGroupIds.size() > 0">
 			AND cs.class_group_id_ IN
@@ -1008,7 +998,7 @@
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
 		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_ AND cs.pre_course_flag_ != 1 and cs.tenant_id_ = #{tenantId}
-		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= #{startTime}
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = '0' AND cs.class_date_ >= #{startTime}
 		AND ((ta.sign_in_status_ = 0 OR ta.sign_in_status_ IS NULL OR ta.sign_out_status_ = 0 OR ta.sign_out_status_ IS NULL)
 		         AND ta.complaints_content_ IS NULL AND ta.dispose_content_ IS NULL)
 		AND (ta.sign_out_status_ IS NOT NULL OR ta.sign_in_status_ IS NOT NULL)
@@ -1034,7 +1024,7 @@
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
 		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
 		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
-		WHERE cs.pre_course_flag_ != 1 AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= #{startTime}
+		WHERE cs.pre_course_flag_ != 1 AND cs.status_ = 'OVER' AND cs.del_flag_ = '0' AND cs.class_date_ >= #{startTime}
 		AND (sa.id_ IS NULL OR (sa.status_ = 'TRUANT' AND sa.visit_flag_ = 0)) AND cssp.id_ IS NOT NULL
 		AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
@@ -1063,7 +1053,7 @@
 		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
 		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_ and cs.tenant_id_ = #{tenantId}
-		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= #{startTime} AND cs.pre_course_flag_ != 1
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = '0' AND cs.class_date_ >= #{startTime} AND cs.pre_course_flag_ != 1
 		AND (((ta.sign_in_status_ = 0 OR ta.sign_in_status_ IS NULL OR ta.sign_out_status_ = 0 OR ta.sign_out_status_ IS NULL) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ = 'TRUANT' AND sa.visit_flag_ = 0)))
 		AND (ta.sign_out_status_ IS NOT NULL OR ta.sign_in_status_ IS NOT NULL)
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cssp.id_ IS NOT NULL
@@ -1087,7 +1077,7 @@
 		SELECT COUNT(DISTINCT cs.id_) FROM course_schedule cs
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_ and cs.tenant_id_ = #{tenantId}
-		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_>=#{startTime} AND cs.pre_course_flag_ != 1
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = '0' AND cs.class_date_>=#{startTime} AND cs.pre_course_flag_ != 1
 		AND ta.sign_in_time_ IS NULL AND ta.sign_out_time_ IS NULL AND ta.complaints_content_ IS NULL AND ta.dispose_content_ IS NULL
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
 		AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
@@ -1112,7 +1102,7 @@
 		FROM course_schedule cs
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_ and cs.tenant_id_ = #{tenantId}
-		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_>=#{startTime} AND cs.pre_course_flag_ != 1
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = '0' AND cs.class_date_>=#{startTime} AND cs.pre_course_flag_ != 1
 		AND ta.sign_in_time_ IS NULL AND ta.sign_out_time_ IS NULL AND ta.dispose_content_ IS NULL
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
 		AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
@@ -1143,7 +1133,7 @@
 		SELECT COUNT(DISTINCT tcs.user_id_) FROM teacher_course_statistics tcs
 		LEFT JOIN teacher t ON t.id_ = tcs.user_id_
 		LEFT JOIN sys_user su ON su.id_ = tcs.user_id_
-		WHERE su.lock_flag_ = 0 AND su.del_flag_ = 0 AND t.job_nature_ = 'FULL_TIME' AND t.demission_date_ IS NULL
+		WHERE su.lock_flag_ = 0 AND su.del_flag_ = '0' AND t.job_nature_ = 'FULL_TIME' AND t.demission_date_ IS NULL
 		AND t.is_settlement_salary_ = 1 and t.tenant_id_ = #{tenantId}
 		AND DATE_FORMAT(tcs.month_,'%Y-%m') = #{monthStr} AND tcs.low_salary = 1
 		<if test="organIdsStr != null and organIdsStr != ''">
@@ -1158,7 +1148,7 @@
 		FROM teacher_course_statistics tcs
 		LEFT JOIN teacher t ON t.id_ = tcs.user_id_
 		LEFT JOIN sys_user su ON su.id_ = tcs.user_id_
-		WHERE su.lock_flag_ = 0 AND su.del_flag_ = 0 AND t.job_nature_ = 'FULL_TIME' AND t.demission_date_ IS NULL
+		WHERE su.lock_flag_ = 0 AND su.del_flag_ = '0' AND t.job_nature_ = 'FULL_TIME' AND t.demission_date_ IS NULL
 		AND t.is_settlement_salary_ = 1 and t.tenant_id_ = #{tenantId}
 		AND DATE_FORMAT(tcs.month_,'%Y-%m') = #{monthStr} AND tcs.low_salary = 1
 		<if test="organIdsStr != null and organIdsStr != ''">
@@ -1881,7 +1871,7 @@
 				LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
 				LEFT JOIN sys_user su ON sr.user_id_ = su.id_
 			WHERE
-				su.del_flag_ = 0 and sr.tenant_id_ = #{tenantId}
+				su.del_flag_ = '0' and sr.tenant_id_ = #{tenantId}
 				AND mg.status_='PROGRESS'
 				AND sr.music_group_status_ = 'NORMAL'
 				<if test="dayStr!=null and dayStr!=''">
@@ -1899,7 +1889,7 @@
 			WHERE
 				cssp.group_type_ IN ( 'VIP', 'PRACTICE' ) and cssp.tenant_id_ = #{tenantId}
 				AND cs.status_ = 'NOT_START'
-				AND su.del_flag_ = 0
+				AND su.del_flag_ = '0'
 				<if test="dayStr!=null and dayStr!=''">
 					AND DATE(cssp.create_time_)&lt;= #{dayStr}
 				</if>)) t
@@ -1916,7 +1906,7 @@
 			COUNT(DISTINCT cto.student_id_) percent_
 		FROM cloud_teacher_order cto
 			LEFT JOIN sys_user su ON cto.student_id_=su.id_
-		WHERE su.del_flag_=0 AND cto.status_ IN (1,2) and cto.tenant_id_ = #{tenantId}
+		WHERE su.del_flag_='0' AND cto.status_ IN (1,2) and cto.tenant_id_ = #{tenantId}
 			<if test="dayStr!=null and dayStr!=''">
 				AND DATE(cto.create_time_)&lt;= #{dayStr}
 			</if>
@@ -1932,7 +1922,7 @@
 		COUNT(DISTINCT cto.student_id_) percent_
 		FROM cloud_teacher_order cto
 		LEFT JOIN sys_user su ON cto.student_id_=su.id_
-		WHERE su.del_flag_=0 AND cto.status_ IN (1,2) and cto.tenant_id_ = #{tenantId}
+		WHERE su.del_flag_='0' AND cto.status_ IN (1,2) and cto.tenant_id_ = #{tenantId}
 		<if test="dayStr!=null and dayStr!=''">
 			AND DATE(cto.create_time_)= #{dayStr}
 		</if>
@@ -1949,7 +1939,7 @@
 		FROM student stu
 		LEFT JOIN cloud_teacher_order cto ON stu.user_id_=cto.student_id_
 		LEFT JOIN sys_user su ON su.id_=stu.user_id_
-		WHERE su.del_flag_=0 AND stu.experience_member_rank_setting_id_ IS NOT NULL AND (cto.id_ IS NULL OR cto.status_ NOT IN (1, 2)) and cto.tenant_id_ = #{tenantId}
+		WHERE su.del_flag_='0' AND stu.experience_member_rank_setting_id_ IS NOT NULL AND (cto.id_ IS NULL OR cto.status_ NOT IN (1, 2)) and cto.tenant_id_ = #{tenantId}
 		<if test="dayStr!=null and dayStr!=''">
 			AND DATE(stu.experience_membership_start_time_)&lt;= #{dayStr}
 		</if>
@@ -1964,9 +1954,9 @@
 			COUNT(DISTINCT smcr.user_id_) activate_num_,
 			COUNT(DISTINCT smcr.user_id_) percent_
 		FROM sys_music_compare_record smcr
-			LEFT JOIN sys_user su ON smcr.user_id_=su.id_
-			LEFT JOIN student stu ON smcr.user_id_=stu.user_id_
-		WHERE su.del_flag_=0 AND stu.user_id_ IS NOT NULL and smcr.tenant_id_ = #{tenantId}
+		LEFT JOIN student stu ON smcr.user_id_=stu.user_id_
+		LEFT JOIN sys_user su ON stu.user_id_=su.id_
+		WHERE su.del_flag_='0' AND smcr.user_id_ = stu.user_id_ and smcr.tenant_id_ = #{tenantId}
 			<if test="dayStr!=null and dayStr!=''">
 				AND DATE(smcr.create_time_)= #{dayStr}
 			</if>
@@ -1981,17 +1971,16 @@
 			COUNT(user_id_) activate_num_,
 			COUNT(user_id_) percent_
 		FROM (SELECT
-			su.organ_id_,su.tenant_id_,
-			smcr.user_id_,
-			COUNT(DISTINCT(CASE WHEN DATEDIFF(NOW(), smcr.create_time_)&lt;=15 THEN DATE_FORMAT(smcr.create_time_, '%Y-%m-%d') ELSE NULL END)) days
-			FROM sys_music_compare_record smcr
-			LEFT JOIN sys_user su ON smcr.user_id_=su.id_
-			LEFT JOIN student stu ON smcr.user_id_=stu.user_id_
-			WHERE su.del_flag_=0 AND stu.user_id_ IS NOT NULL and smcr.tenant_id_ = #{tenantId}
-			<if test="dayStr!=null and dayStr!=''">
-				AND DATE(smcr.create_time_) &lt;= #{dayStr}
-			</if>
-			GROUP BY smcr.user_id_) t WHERE t.days>=5
+			  SELECT su.organ_id_, su.tenant_id_, smcr.user_id_
+					  , COUNT(DISTINCT DATE_FORMAT(smcr.create_time_, '%Y-%m-%d')) AS days
+			  FROM sys_music_compare_record smcr
+				  LEFT JOIN student stu ON smcr.user_id_ = stu.user_id_
+				  LEFT JOIN sys_user su ON stu.user_id_ = su.id_
+			  WHERE su.del_flag_ = '0' AND smcr.user_id_ = stu.user_id_
+				AND smcr.tenant_id_ = #{tenantId}
+				AND smcr.create_time_ >= CURDATE() - INTERVAL 15 DAY
+			  GROUP BY smcr.user_id_
+			) t WHERE t.days>=5
 		GROUP BY t.organ_id_
 	</select>
 
@@ -2007,7 +1996,7 @@
 		SELECT su.organ_id_, smcr.tenant_id_, smcr.user_id_
 		FROM sys_music_compare_record smcr
 		INNER JOIN sys_user su ON smcr.user_id_ = su.id_
-		WHERE su.del_flag_ = 0 AND smcr.tenant_id_ = 3
+		WHERE su.del_flag_ = '0' AND smcr.tenant_id_ = #{tenantId}
 		AND smcr.create_time_ >= #{dayStr}
 		AND smcr.create_time_ &lt; DATE_ADD(#{dayStr}, INTERVAL 1 DAY)
 		GROUP BY smcr.user_id_) t

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/IndexErrDataRecordMapper.xml

@@ -228,7 +228,7 @@
 			LEFT JOIN vip_group vg ON cs.music_group_id_=vg.id_ AND cs.group_type_='VIP'
 			LEFT JOIN practice_group pg ON cs.music_group_id_=pg.id_ AND cs.group_type_='PRACTICE'
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_
-			AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= '2021-02-01'
+			AND cs.status_ = 'OVER' AND cs.del_flag_ = '0' AND cs.class_date_ >= '2021-02-01'
 			AND (((ta.sign_in_status_ = 0 OR ta.sign_in_status_ IS NULL OR ta.sign_out_status_ = 0 OR ta.sign_out_status_ IS NULL) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ = 'TRUANT' AND sa.visit_flag_ = 0)))
 			AND (ta.sign_out_status_ IS NOT NULL OR ta.sign_in_status_ IS NOT NULL)
 			AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cssp.id_ IS NOT NULL
@@ -256,7 +256,7 @@
 			LEFT JOIN vip_group vg ON cs.music_group_id_=vg.id_ AND cs.group_type_='VIP'
 			LEFT JOIN practice_group pg ON cs.music_group_id_=pg.id_ AND cs.group_type_='PRACTICE'
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_
-			AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_>='2021-02-01'
+			AND cs.status_ = 'OVER' AND cs.del_flag_ = '0' AND cs.class_date_>='2021-02-01'
 			AND ta.sign_in_time_ IS NULL AND ta.sign_out_time_ IS NULL AND ta.dispose_content_ IS NULL
 			AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
 			AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -532,8 +532,8 @@
         left join class_group cg on cs.class_group_id_ = cg.id_
         left join music_group mg on cg.music_group_id_ = mg.id_
         where cs.group_type_ = 'MUSIC' AND cg.group_type_ = 'MUSIC' and cs.tenant_id_ = #{tenantId}
-        and DATE_FORMAT(cs.class_date_, '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m') and (cs.del_flag_ = 0 or cs.del_flag_
-        is null) and mg.organ_id_ not in (36,38) AND cs.pre_course_flag_ != 1
+        and DATE_FORMAT(cs.class_date_, '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m') and cs.del_flag_ = '0'
+        and mg.organ_id_ not in (36,38) AND cs.pre_course_flag_ != 1
         <if test="organId != null">
             AND FIND_IN_SET(mg.organ_id_,#{organId})
         </if>

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/MusicGroupTrainPlanMapper.xml

@@ -126,7 +126,7 @@
 		SELECT c.class_group_id_,c.type_,c.course_num_ - (CASE WHEN t.course_num_ IS NULL THEN 0 ELSE t.course_num_ END) num_,c.name_ FROM (
 		SELECT cs.class_group_id_,cs.type_,COUNT(cs.id_) course_num_,cg.name_ FROM course_schedule cs
 		LEFT JOIN class_group cg ON cg.id_ = cs.class_group_id_
-		WHERE cs.music_group_id_ = #{dto.musicGroupId} AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
+		WHERE cs.music_group_id_ = #{dto.musicGroupId} AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
 		<if test="dto.startSchoolTerm != null">
 			AND cs.class_date_ >= DATE_FORMAT(#{dto.startSchoolTerm}, '%Y%m%d')
 		</if>
@@ -159,7 +159,7 @@
 		GROUP BY tp.class_group_id_,tp.course_type_) t
 		LEFT JOIN (
 		SELECT cs.class_group_id_,cs.type_,COUNT(cs.id_) course_num_,'' name_ FROM course_schedule cs
-		WHERE cs.music_group_id_ = #{dto.musicGroupId} AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
+		WHERE cs.music_group_id_ = #{dto.musicGroupId} AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0
 		<if test="dto.startSchoolTerm != null">
 			AND cs.class_date_ >= DATE_FORMAT(#{dto.startSchoolTerm}, '%Y%m%d')
 		</if>

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/OperatingReportNewMapper.xml

@@ -190,7 +190,7 @@
 	<select id="sumCourseAmount" resultType="java.util.Map">
 		SELECT cs.organ_id_ 'key',SUM(cssp.actual_price_) 'value' FROM course_schedule cs
 		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
-		where cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
+		where cs.del_flag_ = '0' AND cs.is_lock_ = 0 AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
 		AND cssp.actual_price_ > 0 AND cs.class_date_ BETWEEN #{firstDay} AND #{lastDay}
 		AND DATE_FORMAT(cs.create_time_,'%Y') = #{currentYear} AND cs.settlement_report_flag_ = 0 group by cs.organ_id_;
 	</select>
@@ -242,7 +242,7 @@
 	<select id="sumCoursePreAmount" resultType="java.util.Map">
 		SELECT cs.organ_id_ 'key',SUM(cssp.actual_price_) 'value' FROM course_schedule cs
 		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
-		where cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.pre_course_flag_ != 1
+		where cs.del_flag_ = '0' AND cs.is_lock_ = 0 AND cs.pre_course_flag_ != 1
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_) AND cs.class_date_ > #{lastDay}
 		AND cs.group_type_ != 'MUSIC'
 		group by cs.organ_id_;

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -589,7 +589,7 @@
             sys_user su
         WHERE
             su.tenant_id_ = #{tenantId}
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
 			AND FIND_IN_SET('STUDENT',su.user_type_)
             <if test="organIdList!=null">
                 AND su.organ_id_ IN
@@ -610,7 +610,7 @@
             sys_user su
         WHERE
             su.tenant_id_ = #{tenantId}
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
 			AND FIND_IN_SET('STUDENT',su.user_type_)
             <if test="organIdList!=null">
             AND su.organ_id_ IN
@@ -628,7 +628,7 @@
           LEFT JOIN sys_user su ON t.id_=su.id_
         WHERE
             FIND_IN_SET(#{subjectId}, t.subject_id_)
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
             AND t.is_support_extra_practice_lesson_=1
             AND (t.organ_id_ = #{studentOrganId} OR FIND_IN_SET(#{studentOrganId},t.flow_organ_range_))
             AND NOT EXISTS (SELECT

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

@@ -499,7 +499,7 @@
     </select>
     <sql id="findStudentAttendanceSql">
         <where>
-            cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0 and cs.tenant_id_ = #{tenantId}
+            cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND cs.is_lock_ = 0 and cs.tenant_id_ = #{tenantId}
             <if test="visitFlag != null">
                 <if test="visitFlag == 1">
                     AND sa.visit_flag_ = 1

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

@@ -961,7 +961,7 @@
         LEFT JOIN student_basic_info sbi ON sbi.user_id_ = sees.student_id_
         LEFT JOIN music_group mg ON mg.id_ = sees.music_group_id_
         LEFT JOIN course_schedule_student_payment cssp ON cssp.music_group_id_ = sees.music_group_id_ AND cssp.user_id_ = sees.student_id_ AND cssp.group_type_ = 'MUSIC'
-        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
         AND cs.is_lock_ = 0 AND ( cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_ ) AND cs.class_date_ BETWEEN #{monday} AND #{sunday}
         LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_ AND sa.user_id_ = cssp.user_id_ AND sa.status_ IN ('NORMAL','LATE')
         WHERE sees.monday_ >= #{monday} AND sees.sunday_ &lt;= #{sunday}

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -171,7 +171,7 @@
     </select>
     <sql id="findStudentsByOrganIdSql">
         <where>
-                su.del_flag_ = 0 and s.tenant_id_ = #{tenantId}
+                su.del_flag_ = '0' and s.tenant_id_ = #{tenantId}
             <if test="organIds != null and organIds.length>0">
                 AND su.organ_id_ IN
                 <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
@@ -824,7 +824,7 @@
     </select>
     <select id="getIsActive" resultType="java.util.Map">
         SELECT su.id_ 'key',COUNT(su.id_) 'value' FROM sys_user su
-        WHERE su.user_type_ LIKE '%STUDENT%' AND su.del_flag_ = 0 AND su.password_ IS NULL AND su.id_ IN
+        WHERE su.user_type_ LIKE '%STUDENT%' AND su.del_flag_ = '0' AND su.password_ IS NULL AND su.id_ IN
         <foreach collection="userIds" separator="," open="(" close=")" item="item">
             #{item}
         </foreach>

+ 19 - 19
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -245,7 +245,7 @@
     </select>
     <sql id="queryPageSql">
         <where>
-        	s.tenant_id_ = #{tenantId} and su.del_flag_ = 0
+        	s.tenant_id_ = #{tenantId} and su.del_flag_ = '0'
             <if test="organId != null and organId != ''">
                 AND FIND_IN_SET(su.organ_id_,#{organId})
             </if>
@@ -393,7 +393,7 @@
         SELECT user_id_
         FROM student stu
           LEFT JOIN sys_user su ON stu.user_id_=su.id_
-        WHERE service_tag_=1 AND su.del_flag_=0
+        WHERE service_tag_=1 AND su.del_flag_='0'
         and stu.tenant_id_ = #{tenantId}
     </select>
     <select id="getServeStudentCourseStartTimes" resultType="com.ym.mec.biz.dal.dto.StudentServeCourseDto">
@@ -436,7 +436,7 @@
         FROM course_schedule_student_payment cssp
             LEFT JOIN course_schedule cs ON cssp.course_schedule_id_=cs.id_
         WHERE cssp.tenant_id_ = #{tenantId}
-            AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
+            AND cs.del_flag_ = '0'
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
             AND cs.class_date_ between #{monday} and #{sunday}
             AND cs.type_ IN ('SINGLE', 'TRAINING_SINGLE', 'MIX', 'TRAINING_MIX')
@@ -462,7 +462,7 @@
             sys_user su
         WHERE
             su.tenant_id_ = #{tenantId}
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
             AND FIND_IN_SET('STUDENT',su.user_type_)
             <if test="organIds!=null">
                 AND su.organ_id_ IN
@@ -484,7 +484,7 @@
             sys_user su
         WHERE
             su.tenant_id_ = #{tenantId}
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
             AND FIND_IN_SET('STUDENT',su.user_type_)
             <if test="organIds!=null">
                 AND su.organ_id_ IN
@@ -583,7 +583,7 @@
                FROM student_registration sr
                         LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
                         LEFT JOIN sys_user su ON sr.user_id_=su.id_
-               WHERE su.del_flag_=0
+               WHERE su.del_flag_='0'
                  AND mg.status_='PROGRESS'
                  AND sr.music_group_status_='NORMAL'
                  AND su.organ_id_ = #{organId})
@@ -597,7 +597,7 @@
                WHERE
                    cssp.group_type_ IN ('VIP', 'PRACTICE')
                  AND cs.status_='NOT_START'
-                 AND su.del_flag_ = 0
+                 AND su.del_flag_ = '0'
                  AND su.organ_id_ = #{organId})) t
         WHERE t.user_id_ NOT IN (SELECT user_id_ FROM student WHERE subject_id_list_ REGEXP '21|25|26|27|28|29')
     </select>
@@ -636,7 +636,7 @@
         cssp.group_type_ IN ('VIP', 'PRACTICE')
         AND cs.status_='NOT_START')) t
         LEFT JOIN sys_user su ON t.user_id_=su.id_
-        WHERE su.del_flag_=0 AND t.user_id_ NOT IN (SELECT user_id_ FROM student WHERE subject_id_list_ REGEXP '21|25|26|27|28|29')
+        WHERE su.del_flag_='0' AND t.user_id_ NOT IN (SELECT user_id_ FROM student WHERE subject_id_list_ REGEXP '21|25|26|27|28|29')
            AND su.organ_id_ IN
            <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
                #{organId}
@@ -650,7 +650,7 @@
         FROM sys_music_compare_record smcr
              LEFT JOIN sys_user su ON smcr.user_id_=su.id_
              LEFT JOIN student stu ON smcr.user_id_=stu.user_id_
-        WHERE su.del_flag_=0 AND stu.user_id_ IS NOT NULL AND su.organ_id_=#{organId};
+        WHERE su.del_flag_='0' AND stu.user_id_ IS NOT NULL AND su.organ_id_=#{organId};
     </select>
 
     <select id="getOrgansTotalCloudStudyStudentNum" resultType="int">
@@ -659,7 +659,7 @@
         FROM sys_music_compare_record smcr
                  LEFT JOIN sys_user su ON smcr.user_id_=su.id_
                  LEFT JOIN student stu ON smcr.user_id_=stu.user_id_
-        WHERE su.del_flag_=0 AND stu.user_id_ IS NOT NULL
+        WHERE su.del_flag_='0' AND stu.user_id_ IS NOT NULL
             AND su.organ_id_ IN
             <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
                 #{organId}
@@ -701,7 +701,7 @@
         FROM sys_music_compare_record smcr
                  LEFT JOIN sys_user su ON smcr.user_id_=su.id_
                  LEFT JOIN student stu ON smcr.user_id_=stu.user_id_
-        WHERE su.del_flag_=0 AND stu.user_id_ IS NOT NULL
+        WHERE su.del_flag_='0' AND stu.user_id_ IS NOT NULL
             AND su.organ_id_ IN
             <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
                 #{organId}
@@ -717,7 +717,7 @@
             FROM sys_music_compare_record smcr
             LEFT JOIN sys_user su ON smcr.user_id_=su.id_
             LEFT JOIN student stu ON smcr.user_id_=stu.user_id_
-            WHERE su.del_flag_=0 AND stu.user_id_ IS NOT NULL AND su.organ_id_=#{organId}
+            WHERE su.del_flag_='0' AND stu.user_id_ IS NOT NULL AND su.organ_id_=#{organId}
             GROUP BY smcr.user_id_) t WHERE t.days>=5
     </select>
 
@@ -780,7 +780,7 @@
               FROM sys_music_compare_record smcr
                        LEFT JOIN sys_user su ON smcr.user_id_=su.id_
                        LEFT JOIN student stu ON smcr.user_id_=stu.user_id_
-              WHERE su.del_flag_=0 AND stu.user_id_ IS NOT NULL
+              WHERE su.del_flag_='0' AND stu.user_id_ IS NOT NULL
                     AND su.organ_id_ IN
                     <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
                         #{organId}
@@ -791,7 +791,7 @@
 
     <sql id="queryCloudStudyStudentDataCondition">
         <where>
-            su.del_flag_=0 AND stu.subject_id_list_ NOT IN ('21','25','26','27','28','29') and su.tenant_id_ = #{tenantId}
+            su.del_flag_='0' AND stu.subject_id_list_ NOT IN ('21','25','26','27','28','29') and su.tenant_id_ = #{tenantId}
             <if test="organId!=null">
                 AND su.organ_id_=#{organId}
             </if>
@@ -899,7 +899,7 @@
         FROM student stu
              LEFT JOIN cloud_teacher_order cto ON stu.user_id_=cto.student_id_
              LEFT JOIN sys_user su ON su.id_=stu.user_id_
-        WHERE su.del_flag_=0 AND su.organ_id_=#{organId} AND stu.experience_member_rank_setting_id_ IS NOT NULL
+        WHERE su.del_flag_='0' AND su.organ_id_=#{organId} AND stu.experience_member_rank_setting_id_ IS NOT NULL
           AND NOT EXISTS (SELECT student_id_ FROM cloud_teacher_order WHERE student_id_=stu.user_id_ AND status_ IN (1,2))
     </select>
 
@@ -908,7 +908,7 @@
         FROM student stu
                  LEFT JOIN cloud_teacher_order cto ON stu.user_id_=cto.student_id_
                  LEFT JOIN sys_user su ON su.id_=stu.user_id_
-        WHERE su.del_flag_=0 AND stu.experience_member_rank_setting_id_ IS NOT NULL AND (cto.id_ IS NULL OR cto.status_ NOT IN (1, 2))
+        WHERE su.del_flag_='0' AND stu.experience_member_rank_setting_id_ IS NOT NULL AND (cto.id_ IS NULL OR cto.status_ NOT IN (1, 2))
             AND su.organ_id_ IN
             <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
                 #{organId}
@@ -1061,7 +1061,7 @@
         -- 新用户
         WHERE su.id_ NOT IN (SELECT DISTINCT(sr.`user_id_`) FROM student_registration sr
         LEFT JOIN music_group mg ON mg.id_ = sr.music_group_id_
-        LEFT JOIN course_schedule cs on cs.`music_group_id_` = mg.`id_` AND cs.`group_type_` = 'MUSIC' AND cs.`status_` = 'OVER' AND cs.del_flag_ = 0
+        LEFT JOIN course_schedule cs on cs.`music_group_id_` = mg.`id_` AND cs.`group_type_` = 'MUSIC' AND cs.`status_` = 'OVER' AND cs.del_flag_ = '0'
         LEFT JOIN `course_schedule_student_payment` cssp on cssp.`course_schedule_id_` = cs.`id_` AND sr.user_id_ = cssp.user_id_
         WHERE mg.`status_` = 'PROGRESS' AND sr.music_group_status_ = 'NORMAL'
         GROUP BY sr.`user_id_` HAVING COUNT(cssp.`id_`) &lt;= 4)
@@ -1342,7 +1342,7 @@
     <select id="queryExistStuByPhone" resultType="java.lang.String">
         select su.phone_ from student s
         left join sys_user su ON su.id_ = s.user_id_
-        where su.del_flag_ = 0 AND su.tenant_id_ = 1 AND su.phone_ IN
+        where su.del_flag_ = '0' AND su.tenant_id_ = 1 AND su.phone_ IN
         <foreach collection="phones" item="phone" separator="," open="(" close=")">
             #{phone}
         </foreach>
@@ -1350,7 +1350,7 @@
     </select>
     <sql id="queryStudentBasicInfoSql">
         <where>
-            AND su.lock_flag_ = 0 AND su.del_flag_ = 0
+            AND su.lock_flag_ = 0 AND su.del_flag_ = '0'
             <if test="search != null and search != ''">
                 AND (s.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
             </if>

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/StudentRepairMapper.xml

@@ -152,7 +152,7 @@
         FROM sys_user su
         LEFT JOIN student s ON su.id_=s.user_id_
         WHERE FIND_IN_SET(su.organ_id_,#{organIdList})
-        AND su.user_type_ LIKE '%STUDENT%' AND su.del_flag_ = 0
+        AND su.user_type_ LIKE '%STUDENT%' AND su.del_flag_ = '0'
         <if test="search">
             AND (su.username_ LIKE CONCAT(#{search},'%') OR su.phone_ LIKE CONCAT(#{search},'%'))
         </if>
@@ -167,7 +167,7 @@
         <if test="repairFlag != null">
             LEFT JOIN student s ON su.id_=s.user_id_
         </if>
-        WHERE FIND_IN_SET(su.organ_id_,#{organIdList}) AND su.user_type_ LIKE '%STUDENT%' AND su.del_flag_ = 0
+        WHERE FIND_IN_SET(su.organ_id_,#{organIdList}) AND su.user_type_ LIKE '%STUDENT%' AND su.del_flag_ = '0'
         <if test="search">
             AND (su.username_ LIKE CONCAT(#{search},'%') OR su.phone_ LIKE CONCAT(#{search},'%'))
         </if>

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

@@ -95,7 +95,7 @@
 		FROM sys_employee_position sep
 		LEFT JOIN sys_user su ON su.id_ = sep.user_id_
 		LEFT JOIN employee e ON e.user_id_ = su.id_
-		WHERE su.lock_flag_ = 0 AND su.del_flag_ = 0 AND sep.tenant_id_ = #{tenantId}
+		WHERE su.lock_flag_ = 0 AND su.del_flag_ = '0' AND sep.tenant_id_ = #{tenantId}
 		<if test="organIds!=null and organIds!=''">
 			AND INTE_ARRAY(e.organ_id_list_,#{organIds})
 		</if>

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/SysMusicCompareRecordMapper.xml

@@ -379,7 +379,7 @@
 					sys_music_compare_record smcr
 						LEFT JOIN sys_user su ON smcr.user_id_ = su.id_
 				WHERE
-					su.del_flag_ = 0
+					su.del_flag_ = '0'
 					AND su.organ_id_ = #{organId}
 				GROUP BY
 					user_id_
@@ -401,7 +401,7 @@
 					sys_music_compare_record smcr
 						LEFT JOIN sys_user su ON smcr.user_id_ = su.id_
 				WHERE
-					su.del_flag_ = 0
+					su.del_flag_ = '0'
 					<if test="organIds!=null and organIds.size()>0">
 						AND su.organ_id_ IN
 						<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
@@ -428,7 +428,7 @@
 					sys_music_compare_record smcr
 						LEFT JOIN sys_user su ON smcr.user_id_ = su.id_
 				WHERE
-					su.del_flag_ = 0
+					su.del_flag_ = '0'
 					<if test="organIds!=null and organIds.size()>0">
 						AND su.organ_id_ IN
 						<foreach collection="organIds" item="organId" open="(" close=")" separator=",">

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

@@ -290,7 +290,7 @@
     </sql>
     <sql id="queryTeacherAttendancesCondition">
         <where>
-            cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 and cs.tenant_id_ = #{tenantId}
+            cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 and cs.tenant_id_ = #{tenantId}
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
             <if test="search != null and search != ''">
                 AND (su.id_ = #{search} OR su.real_name_ LIKE CONCAT('%',#{search},'%') OR cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',#{search},'%'))
@@ -473,7 +473,7 @@
         WHERE ta.sign_out_status_ IS NULL and cs.tenant_id_ = #{tenantId}
         AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
         AND CONCAT( cs.class_date_, ' ', cs.end_class_time_ ) &lt;= DATE_SUB(now(),INTERVAL #{minutes} MINUTE)
-        AND cs.class_date_ = DATE_FORMAT(NOW(),'%Y-%m-%d') AND cs.del_flag_ = 0
+        AND cs.class_date_ = DATE_FORMAT(NOW(),'%Y-%m-%d') AND cs.del_flag_ = '0'
         AND cs.group_type_ = 'MUSIC'
     </select>
     <select id="findTeacherIdByCourseSchedule" resultMap="TeacherAttendance">
@@ -530,7 +530,7 @@
     <select id="queryTeacherExceptionAttendance" resultType="java.lang.Integer">
         SELECT DISTINCT ta.teacher_id_ FROM teacher_attendance ta
         LEFT JOIN course_schedule cs ON cs.id_ = ta.course_schedule_id_
-        WHERE cs.del_flag_ = 0 AND cs.class_date_ = #{format}
+        WHERE cs.del_flag_ = '0' AND cs.class_date_ = #{format}
         AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
         AND ta.teacher_id_ = cs.actual_teacher_id_ AND CONCAT(cs.class_date_,' ',cs.end_class_time_) &lt; NOW()
         AND (ta.sign_in_status_ IS NULL OR ta.sign_in_status_ = 0 OR ta.sign_out_status_ IS NULL OR ta.sign_out_status_ = 0)
@@ -638,7 +638,7 @@
 
     <sql id="queryTeacherAttendanceSql">
         <where>
-            cs.group_type_ = 'MUSIC' AND cs.is_lock_ = 0 AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1
+            cs.group_type_ = 'MUSIC' AND cs.is_lock_ = 0 AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
             AND CONCAT(cs.class_date_,' ',cs.start_class_time_) &lt; NOW()
             <if test="queryInfo.startTerm != null and queryInfo.startTerm != ''">
@@ -699,7 +699,7 @@
         <if test="query.courseType != null and query.courseType != ''">
             AND cs.type_ = #{query.courseType}
         </if>
-        AND cs.is_lock_ = 0 AND cs.del_flag_ = 0 AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
+        AND cs.is_lock_ = 0 AND cs.del_flag_ = '0' AND cs.pre_course_flag_ != 1 AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
     </select>
     <update id="cleanCourseTeacherSignInfo">
         UPDATE teacher_attendance

+ 11 - 11
mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -128,7 +128,7 @@
         t.is_settlement_salary_,su.tenant_id_, t.courseware_limit_
         FROM teacher t
         LEFT JOIN sys_user su ON t.id_ = su.id_
-        WHERE t.id_ = #{id} AND su.del_flag_ = 0
+        WHERE t.id_ = #{id} AND su.del_flag_ = '0'
     </select>
 
     <!-- 全查询 -->
@@ -423,7 +423,7 @@
 
     <sql id="queryPageMap">
         <where>
-            su.del_flag_ = 0 and t.tenant_id_ = #{tenantId}
+            su.del_flag_ = '0' and t.tenant_id_ = #{tenantId}
             <if test="organId != null and organId != ''">
                AND (CONCAT(',',t.organ_id_,',',IFNULL(t.flow_organ_range_,''),',') REGEXP CONCAT(',(',replace(#{organId},',','|'),'),'))
             </if>
@@ -582,7 +582,7 @@
         WHERE
             FIND_IN_SET(#{subjectId},t.subject_id_)
             AND (t.organ_id_=#{organId} OR FIND_IN_SET(#{organId},t.flow_organ_range_))
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
             AND t.is_support_extra_practice_lesson_=1
             AND t.organ_id_!=36
     </select>
@@ -599,7 +599,7 @@
         WHERE
             FIND_IN_SET(#{subjectId},t.subject_id_)
             AND (t.organ_id_=#{organId} OR FIND_IN_SET(#{organId},t.flow_organ_range_))
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
             AND t.is_support_extra_practice_lesson_=1
             AND t.organ_id_!=36
     </select>
@@ -621,7 +621,7 @@
         WHERE
             FIND_IN_SET(#{subjectId},t.subject_id_)
             AND (t.organ_id_=#{organId} OR FIND_IN_SET(#{organId},t.flow_organ_range_))
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
             AND t.is_support_extra_practice_lesson_=1
             AND t.organ_id_!=36
         GROUP BY su.id_
@@ -644,7 +644,7 @@
         WHERE
             FIND_IN_SET(#{subjectId},t.subject_id_)
             AND (t.organ_id_=#{organId} OR FIND_IN_SET(#{organId},t.flow_organ_range_))
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
             AND t.organ_id_!=36
             GROUP BY su.id_
     </select>
@@ -666,7 +666,7 @@
         WHERE
             FIND_IN_SET(#{subjectId},t.subject_id_)
             AND FIND_IN_SET(t.organ_id_,#{organIdList})
-            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND su.del_flag_='0' AND su.lock_flag_=0
             AND t.is_support_extra_practice_lesson_=1
             GROUP BY su.id_
     </select>
@@ -949,7 +949,7 @@
     <select id="findByFlowOrganRangeTeachers" resultMap="TeacherBasicDto">
         SELECT su.id_,su.username_,su.real_name_,t.organ_id_,su.phone_ FROM teacher t
         LEFT JOIN sys_user su ON t.id_ = su.id_
-        WHERE su.del_flag_ = 0
+        WHERE su.del_flag_ = '0'
             AND (INTE_ARRAY(#{organId},t.flow_organ_range_) OR FIND_IN_SET(t.organ_id_,#{organId}))
         <if test="demissionFlag != null and demissionFlag == false">
             AND t.demission_date_ IS NULL
@@ -1103,7 +1103,7 @@
         <if test="search != null and search != ''">
             AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%'))
         </if>
-        AND su.del_flag_ = 0 AND su.lock_flag_=0
+        AND su.del_flag_ = '0' AND su.lock_flag_=0
         GROUP BY su.id_
     </select>
     <select id="queryTeacherImModel" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.ImUserModel">
@@ -1431,7 +1431,7 @@
 
     <sql id="queryTeacherMusicIdsCondition">
         <where>
-            cs.del_flag_=0 AND csts.group_type_='MUSIC' AND mg.del_flag_=0 AND mg.status_='PROGRESS' and csts.tenant_id_ = #{tenantId}
+            cs.del_flag_ = '0' AND csts.group_type_='MUSIC' AND mg.del_flag_=0 AND mg.status_='PROGRESS' and csts.tenant_id_ = #{tenantId}
             <if test="teacherId!=null">
                 AND csts.user_id_=#{teacherId}
             </if>
@@ -1518,7 +1518,7 @@
     </select>
     <sql id="queryTeacherBasicInfoSql">
         <where>
-            AND t.demission_date_ IS NULL AND su.lock_flag_ = 0 AND su.del_flag_ = 0
+            AND t.demission_date_ IS NULL AND su.lock_flag_ = 0 AND su.del_flag_ = '0'
             <if test="search != null and search != ''">
                 AND (t.id_ = #{search} OR su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
             </if>

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

@@ -139,7 +139,7 @@
 		SELECT cs.id_,cs.group_type_,cs.music_group_id_,cs.class_group_id_,cs.class_date_,cs.start_class_time_,cs.end_class_time_,csts.user_id_ actual_teacher_id_,
 		cs.create_time_,cs.update_time_,cs.teach_mode_,cs.type_,cs.name_,cs.student_num_,cs.schoole_id_,cs.note_,cs.organ_id_,csts.expect_salary_ salary_ 
 		FROM course_schedule_teacher_salary csts left join course_schedule cs on csts.course_schedule_id_ = cs.id_
-		where csts.user_id_ = #{userId} and cs.class_date_ like concat(#{month},'%') and cs.del_flag_ = 0
+		where csts.user_id_ = #{userId} and cs.class_date_ like concat(#{month},'%') and cs.del_flag_ = '0'
 		order by cs.group_type_ desc
 	</select>
 </mapper>

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -919,8 +919,8 @@
     <select id="queryCurrentMonthCoursesNum" resultType="int">
         select count(cs.id_) from course_schedule cs left join vip_group vg on cs.music_group_id_ = vg.id_ where
         cs.type_ in ('VIP')
-        and DATE_FORMAT(cs.class_date_, '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m') and (cs.del_flag_ = 0 or cs.del_flag_
-        is null) and vg.organ_id_ not in (36,38) and vg.tenant_id_ = #{tenantId}
+        and DATE_FORMAT(cs.class_date_, '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m') and cs.del_flag_ = '0'
+        and vg.organ_id_ not in (36,38) and vg.tenant_id_ = #{tenantId}
         <if test="organId != null">
             AND FIND_IN_SET(vg.organ_id_,#{organId})
         </if>