Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

周箭河 5 lat temu
rodzic
commit
7bfb8a72b5

+ 6 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupDao.java

@@ -55,12 +55,15 @@ public interface DemoGroupDao extends BaseDAO<Long, DemoGroup> {
      */
     Integer countDemoGroupStudents(Long demoGroupId);
 
+
+
     /**
      * @Author: Joburgess
      * @Date: 2019/9/25
      * 试听课列表获取
      */
-    List<StudentDemoGroupListDto> findDemoGroupList(Map<String,Object> params);
+    List<StudentDemoGroupListDto> findDemoGroupList(@Param("params") Map<String,Object> params,
+                                                    @Param("demoGroupIds") List<Integer> demoGroupIds);
 
     /**
      * @Author: Joburgess
@@ -69,6 +72,8 @@ public interface DemoGroupDao extends BaseDAO<Long, DemoGroup> {
      */
     Integer countDemoGroupList(Map<String,Object> params);
 
+    List<Integer> findDemoGoupIds(Map<String,Object> params);
+
     /**
      * @Author: Joburgess
      * @Date: 2019/9/25

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Teacher.java

@@ -90,6 +90,9 @@ public class Teacher extends SysUser {
 	
 	@ApiModelProperty(value = "离职时间", required = false)
 	private Date demissionDate;
+	
+	@ApiModelProperty(value = "是否支持课程奖励规则活动", required = false)
+	private Boolean isSupportCourseScheduleRewardsRules;
 
 	private List<School> teacherSchools;
 
@@ -261,6 +264,14 @@ public class Teacher extends SysUser {
 		this.demissionDate = demissionDate;
 	}
 
+	public Boolean getIsSupportCourseScheduleRewardsRules() {
+		return isSupportCourseScheduleRewardsRules;
+	}
+
+	public void setIsSupportCourseScheduleRewardsRules(Boolean isSupportCourseScheduleRewardsRules) {
+		this.isSupportCourseScheduleRewardsRules = isSupportCourseScheduleRewardsRules;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentApplyrefundsQueryInfo.java

@@ -11,6 +11,8 @@ public class StudentApplyrefundsQueryInfo extends QueryInfo {
 	private Date endTime;
 
 	private String status;
+	
+	private Integer organId;
 
 	public String getStatus() {
 		return status;
@@ -35,4 +37,12 @@ public class StudentApplyrefundsQueryInfo extends QueryInfo {
 	public void setEndTime(Date endTime) {
 		this.endTime = endTime;
 	}
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1225,6 +1225,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 courseSchedule.setCreateTime(date);
                 courseSchedule.setUpdateTime(date);
                 courseSchedule.setTeachMode(TeachModeEnum.OFFLINE);
+                courseSchedule.setMusicGroupId(classGroup.getMusicGroupId());
                 courseSchedule.setType(classGroup4MixDto.getCourseType());
                 courseSchedule.setName(subjectNames + "-" + CourseSchedule.CourseScheduleType.SINGLE.getMsg());
                 courseSchedule.setGroupType(GroupType.MUSIC);
@@ -1438,6 +1439,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 courseSchedule.setTeachMode(TeachModeEnum.OFFLINE);
                 courseSchedule.setType(classGroup4MixDto.getCourseType());
                 courseSchedule.setGroupType(GroupType.MUSIC);
+                courseSchedule.setMusicGroupId(classGroup.getMusicGroupId());
                 courseSchedule.setName(subjectNames + "-" + CourseSchedule.CourseScheduleType.SINGLE.getMsg());
 
                 courseScheduleDao.insert(courseSchedule);

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -140,7 +140,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		if(Objects.isNull(teacherCourseByDateSpeed)){
 			return YesOrNoEnum.NO;
 		}else{
-//			int i = studentAttendanceDao.countByCourseSchedule(teacherCourseByDateSpeed.getCourseScheduleId());
 			if(Objects.nonNull(teacherCourseByDateSpeed.getSignInTime())&&checkSchool&&schoolId.equals(teacherCourseByDateSpeed.getSchoolId())){
 				return YesOrNoEnum.YES;
 			}else{

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupServiceImpl.java

@@ -146,7 +146,8 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 		if (count > 0) {
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
-			dataList = demoGroupDao.findDemoGroupList(params);
+			List<Integer> demoGoupIds = demoGroupDao.findDemoGoupIds(params);
+			dataList = demoGroupDao.findDemoGroupList(params,demoGoupIds);
 		}
 		if (count == 0) {
 			dataList = new ArrayList<>();

+ 24 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -69,8 +69,8 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			throw new BizException("请选择课程!");
 		}
 
-		SysConfig byParamName = sysConfigService.findByParamName(SysConfigService.ADVANCE_SIGN_IN_MINUTES);
-		Integer advanceSignInMinutes=Integer.parseInt(byParamName.getParanValue());
+//		SysConfig byParamName = sysConfigService.findByParamName(SysConfigService.ADVANCE_SIGN_IN_MINUTES);
+//		Integer advanceSignInMinutes=Integer.parseInt(byParamName.getParanValue());
 
 		Map<String,Object> result=new HashMap<>();
 
@@ -99,13 +99,16 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		if(courseSchedule == null){
 			throw new BizException("课程信息不存在");
 		}
+		teacherAttendance.setCurrentClassTimes(currentCourseDetail.getCurrentClassTimes() + 1);
 		String classDate = DateUtil.format(courseSchedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
 		String startClassTime = DateUtil.format(courseSchedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
 		String endClassTime = DateUtil.format(courseSchedule.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
 		//上课时间
 		Date classStartDateTime = DateUtil.stringToDate(classDate + " " + startClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
 		Date classEndDateTime = DateUtil.stringToDate(classDate + " " + endClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-		Date addMinutes = DateUtil.addMinutes(classStartDateTime, advanceSignMinutes * -1);
+		Date classEndDateAdd60Minutes = DateUtil.addMinutes(classEndDateTime, 60);
+		Date add20Minutes = DateUtil.addMinutes(classStartDateTime, advanceSignMinutes * -1);
+		Date add60Minutes = DateUtil.addMinutes(classStartDateTime, -60);
 		if(teacherAttendance.getSignInTime() == null && teacherSignOutDto.getTeacherAttendanceInfo().getStatus().equals(SignStatusEnum.SIGN_IN.getCode())){
 
 			if (currentCourseDetail.getEndClassTime().before(date)){
@@ -121,9 +124,9 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			result.put("signInStatus",0);
 			if(yesOrNoEnum == YesOrNoEnum.YES){
 				//连堂课
-			}else if(DateUtil.minutesBetween(addMinutes,date) >= 0 && DateUtil.minutesBetween(date,classStartDateTime) > 0){
+			}else if(DateUtil.minutesBetween(add60Minutes,date) > 0 && DateUtil.minutesBetween(date,add20Minutes) > 0){
 				//正常签到范围(开始前20分钟  ~  开始之前)
-			}else if(DateUtil.minutesBetween(classStartDateTime,date) > 0 && DateUtil.minutesBetween(date,classEndDateTime) > 0){
+			}else if(DateUtil.minutesBetween(add20Minutes,date) > 0){
 				if(StringUtils.isEmpty(teacherAttendance.getRemark())){
 					//当前为异常签到,请填写原因!
 					result.put("status",2);
@@ -142,15 +145,28 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			}
 			return result;
 		}else if(teacherAttendance.getSignOutTime() == null && teacherSignOutDto.getTeacherAttendanceInfo().getStatus().equals(SignStatusEnum.SIGN_OUT.getCode())){
+			//正常签退范围(结束后1小时内)
 			teacherAttendance.setSignOutTime(date);
-			teacherAttendance.setSignOutStatus(YesOrNoEnum.YES);
-			teacherAttendanceDao.update(teacherAttendance);
+			if(DateUtil.minutesBetween(classEndDateTime,date) > 0 && DateUtil.minutesBetween(date,classEndDateAdd60Minutes) > 0){
+				teacherAttendance.setSignOutStatus(YesOrNoEnum.YES);
+				result.put("signInStatus",0);
+			}else if(DateUtil.minutesBetween(classEndDateAdd60Minutes,date) > 0){
+				teacherAttendance.setSignOutStatus(YesOrNoEnum.NO);
+				result.put("signInStatus",1);
+			}else {
+				throw new BizException("签退时间异常");
+			}
 			if(Objects.nonNull(teacherAttendance.getId())){
 				teacherAttendanceDao.update(teacherAttendance);
 			}else{
 				teacherAttendanceDao.insert(teacherAttendance);
 			}
-			result.put("signInStatus",0);
+			//修改当前课时
+			ClassGroup classGroup = new ClassGroup();
+			classGroup.setId(teacherAttendance.getClassGroupId());
+			classGroup.setCurrentClassTimes(teacherAttendance.getCurrentClassTimes() + 1);
+			classGroup.setUpdateTime(date);
+			classGroupDao.update(classGroup);
 			//新增课堂作业
 			CourseHomework courseHomework=teacherSignOutDto.getCourseHomeworkInfo();
 			courseHomework.setCourseScheduleId(teacherAttendance.getCourseScheduleId());

+ 8 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1373,16 +1373,20 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if (list != null && list.size() > 0) {
 
 			Integer organId = null, teacherId = null, coursesTimes = 0;
+			boolean isSupportCourseScheduleRewardsRules = false;
 
 			for (Map<Integer, Integer> map : list) {
 				organId = map.get("organ_id_");
 				teacherId = map.get("teacher_id_");
 				coursesTimes = map.get("times");
+				isSupportCourseScheduleRewardsRules = Boolean.parseBoolean(map.get("is_support_course_schedule_rewards_rules_").toString());
 
-				BigDecimal decimal = courseScheduleRewardsRulesService.queryRewardsAmount(organId, CourseScheduleType.VIP, coursesTimes);
-				if (decimal.doubleValue() > 0) {
-					sysUserCashAccountDetailService.addCashAccountDetail(teacherId, decimal, "", SysUserCashAccountDetailService.ORGAN,
-							PlatformCashAccountDetailTypeEnum.REWARDS, null, DealStatusEnum.SUCCESS, "分部奖励");
+				if (isSupportCourseScheduleRewardsRules) {
+					BigDecimal decimal = courseScheduleRewardsRulesService.queryRewardsAmount(organId, CourseScheduleType.VIP, coursesTimes);
+					if (decimal.doubleValue() > 0) {
+						sysUserCashAccountDetailService.addCashAccountDetail(teacherId, decimal, "", SysUserCashAccountDetailService.ORGAN,
+								PlatformCashAccountDetailTypeEnum.REWARDS, null, DealStatusEnum.SUCCESS, "分部奖励");
+					}
 				}
 			}
 		}

+ 18 - 16
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -672,6 +672,7 @@
     <sql id="queryStudentCourseScheduleRecordCondition">
         <where>
             sa.user_id_=#{userId}
+            AND cs.status_='OVER'
             <if test="teachMode!=null and teachMode!=''">
                 AND cs.teach_mode_=#{teachMode}
             </if>
@@ -686,21 +687,21 @@
 
     <select id="findStudentCourseScheduleRecords" resultMap="studentCourseScheduleRecord">
         SELECT
-        sa.id_,
-        sa.status_,
-        sa.teacher_id_,
-        su.username_,
-        cs.id_ course_schedule_id_,
-        cs.name_,
-        cs.class_date_,
-        CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
-        CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
-        cs.teacher_id_,
-        cs.teach_mode_
+            sa.id_,
+            sa.status_,
+            sa.teacher_id_,
+            su.username_,
+            cs.id_ course_schedule_id_,
+            cs.name_,
+            cs.class_date_,
+            CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
+            CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
+            cs.teacher_id_,
+            cs.teach_mode_
         FROM
-        student_attendance sa
-        LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
-        LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
+          student_attendance sa
+            LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
+            LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
         <include refid="queryStudentCourseScheduleRecordCondition"/>
         ORDER BY cs.class_date_ DESC,cs.start_class_time_ DESC
         <include refid="global.limit"/>
@@ -841,7 +842,7 @@
     </select>
     
     <select id="queryVipGroupTeachereClassTimesByMonth" resultType="map" parameterType="map">
-        SELECT vp.organ_id_ organ_id_,cs.actual_teacher_id_ teacher_id_,count(cs.id_) times FROM course_schedule cs left join vip_group vp on cs.music_group_id_ = vp.id_ where cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} and date_format(#{monthDate} , '%Y%m' ) = date_format(cs.class_date_, '%Y%m' ) group by vp.organ_id_,cs.actual_teacher_id_
+        SELECT vp.organ_id_ organ_id_,cs.actual_teacher_id_ teacher_id_,count(cs.id_) times,t.is_support_course_schedule_rewards_rules_ FROM course_schedule cs left join vip_group vp on cs.music_group_id_ = vp.id_ left join teacher t on cs.actual_teacher_id_ = t.id_ where cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} and date_format(#{monthDate} , '%Y%m' ) = date_format(cs.class_date_, '%Y%m' ) group by vp.organ_id_,cs.actual_teacher_id_
     </select>
     
     <select id="queryFinishedWithNoUpdateStatus" resultMap="CourseSchedule">
@@ -1270,7 +1271,7 @@
         cs.schoole_id_
       from  course_schedule cs
         LEFT JOIN course_schedule_teacher_salary csts ON cs.id_=csts.course_schedule_id_
-      where cs.class_group_id_=#{classGroupId} AND cs.status=#{status}
+      where cs.class_group_id_=#{classGroupId} AND cs.status_=#{status}
     </select>
     <select id="findByClassGroups" resultMap="CourseSchedule">
         select
@@ -1361,6 +1362,7 @@
         WHERE
             cg.music_group_id_=#{musicGroupId}
             AND status_ = #{status}
+            AND cs.type_!='HIGH'
     </select>
     <delete id="deleteCourseSchedulesByClassGroupIds">
         DELETE FROM course_schedule WHERE class_group_id_ IN

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

@@ -187,42 +187,75 @@
         </where>
     </sql>
 
+    <sql id="demoGroupQueryCondition1">
+        <where>
+            dgcp.status_=0
+            AND dgcp.demo_group_id_ IN
+            <foreach collection="demoGroupIds" item="demoGroupId" open="(" close=")" separator=",">
+                #{demoGroupId}
+            </foreach>
+            AND CONCAT(dgcp.course_date_,' ',dgcp.start_time_)&gt;=NOW()
+            <if test="params.search!=null">
+                AND su.username_ like concat('%',#{params.search},'%')
+            </if>
+            <if test="params.subjectIds!=null and params.subjectIds!=''">
+                AND FIND_IN_SET(dg.subject_id_,#{params.subjectIds})
+            </if>
+            <if test="params.startTime!=null and params.endTime==null">
+                AND CONCAT(dgcp.course_date_,' ',dgcp.start_time_)&gt;=DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%S')
+                AND dgcp.course_date_=DATE_FORMAT(#{params.startTime},'%Y-%m-%d')
+            </if>
+            <if test="params.startTime!=null and params.endTime!=null">
+                AND (CONCAT(dgcp.course_date_,' ',dgcp.start_time_) BETWEEN DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%S') AND DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%S'))
+            </if>
+        </where>
+    </sql>
+
     <select id="findDemoGroupList" resultMap="studentDemoGroupListDto">
         SELECT
-        dg.id_ demo_group_id_,
-        su.username_,
-        su.avatar_,
-        t.introduction_,
-        s.name_ subject_name_,
-        COUNT(cg.id_) number_of_classes_,
-        dgcp.id_,
-        dgcp.demo_group_id_,
-        dgcp.create_time_,
-        dgcp.status_,
-        dgcp.course_date_,
-        CONCAT(dgcp.course_date_,' ',dgcp.start_time_) start_time_,
-        CONCAT(dgcp.course_date_,' ',dgcp.end_time_) end_time_
+            dg.id_ demo_group_id_,
+            su.username_,
+            su.avatar_,
+            t.introduction_,
+            s.name_ subject_name_,
+            COUNT(cg.id_) number_of_classes_,
+            dgcp.id_,
+            dgcp.demo_group_id_,
+            dgcp.create_time_,
+            dgcp.status_,
+            dgcp.course_date_,
+            CONCAT(dgcp.course_date_,' ',dgcp.start_time_) start_time_,
+            CONCAT(dgcp.course_date_,' ',dgcp.end_time_) end_time_
         FROM
-        demo_group dg
-        LEFT JOIN demo_group_courses_plan dgcp ON dg.id_=dgcp.demo_group_id_
-        LEFT JOIN teacher t ON dg.user_id_=t.id_
-        LEFT JOIN sys_user su ON dg.user_id_=su.id_
-        LEFT JOIN `subject` s ON dg.subject_id_=s.id_
-        LEFT JOIN class_group cg ON dg.id_=cg.music_group_id_ AND cg.group_type_='DEMO'
-        <include refid="demoGroupQueryCondition"/>
+            demo_group dg
+            LEFT JOIN demo_group_courses_plan dgcp ON dg.id_=dgcp.demo_group_id_
+            LEFT JOIN teacher t ON dg.user_id_=t.id_
+            LEFT JOIN sys_user su ON dg.user_id_=su.id_
+            LEFT JOIN `subject` s ON dg.subject_id_=s.id_
+            LEFT JOIN class_group cg ON dg.id_=cg.music_group_id_ AND cg.group_type_='DEMO'
+        <include refid="demoGroupQueryCondition1"/>
         GROUP BY dgcp.id_,dg.id_
         ORDER BY dgcp.start_time_
-        <include refid="global.limit"/>
     </select>
     <select id="countDemoGroupList" resultType="java.lang.Integer">
         SELECT
-        count(*)
+          COUNT(DISTINCT dg.id_)
         FROM
         demo_group dg
-        LEFT JOIN demo_group_courses_plan dgcp ON dg.id_=dgcp.demo_group_id_
-        LEFT JOIN sys_user su ON dg.user_id_=su.id_
+        LEFT JOIN demo_group_courses_plan dgcp ON dg.id_ = dgcp.demo_group_id_
+        LEFT JOIN sys_user su ON dg.user_id_ = su.id_
         <include refid="demoGroupQueryCondition"/>
     </select>
+    <select id="findDemoGoupIds" resultType="java.lang.Integer">
+        SELECT
+          DISTINCT dg.id_
+        FROM
+          demo_group dg
+        LEFT JOIN demo_group_courses_plan dgcp ON dg.id_ = dgcp.demo_group_id_
+        LEFT JOIN sys_user su ON dg.user_id_ = su.id_
+        <include refid="demoGroupQueryCondition"/>
+        <include refid="global.limit"/>
+    </select>
     <select id="findClassGroupIDByDemoGroupId" resultType="java.lang.Integer">
 		SELECT
 			id_

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

@@ -96,14 +96,17 @@
             and sar.create_time_ &lt;= #{endTime}
         </if>
         <if test="status!=null and status!=''">
-            and status_=#{status}
+            and sar.status_=#{status}
+        </if>
+        <if test="organId!=null and organId!=''">
+            and u.organ_id_=#{organId}
         </if>
         ORDER BY sar.id_ <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int" parameterType="map">
-		SELECT count(1) FROM student_apply_refunds sar left join student_payment_order spo on sar.orig_payment_order_id_ = spo.id_ 
+		SELECT count(1) FROM student_apply_refunds sar left join student_payment_order spo on sar.orig_payment_order_id_ = spo.id_ left join sys_user u on sar.user_id_ = u.id_
 		where 1=1 
         <if test="startTime != null">
             and sar.create_time_ &gt;= #{startTime}
@@ -111,6 +114,12 @@
         <if test="endTime != null">
             and sar.create_time_ &lt;= #{endTime}
         </if>
+        <if test="status!=null and status!=''">
+            and sar.status_=#{status}
+        </if>
+        <if test="organId!=null and organId!=''">
+            and u.organ_id_=#{organId}
+        </if>
 	</select>
 
     <select id="checkIsApplyRefund" resultType="java.util.Map">

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

@@ -113,7 +113,7 @@
 	                current_class_times_ = #{item.currentClassTimes},
 	            </if>
         	</set>
-	        where id_ = ${item.id}
+	        where id_ = #{item.id}
 	    </foreach>      
 	</update>
 

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

@@ -321,7 +321,7 @@
         LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND sa.user_id_ = cssp.user_id_
         LEFT JOIN class_group cg ON cg.id_ = sa.class_group_id_
         <include refid="studentPaymentSql"/>
-        ORDER BY cs.class_date_,cs.start_class_time_ DESC
+        ORDER BY cs.class_date_ DESC,cs.start_class_time_ DESC
         <include refid="global.limit"/>
     </select>
     <sql id="studentPaymentSql">

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

@@ -486,11 +486,10 @@
         SELECT count(sr.id_) total_num_,sum(case when sr.create_time_ >= timestamp(date_add(curdate(), interval - day(curdate()) + 1 day)) then 1 else 0 end) new_num_,sum(case when sr.music_group_status_ = 'QUIT' and sr.update_time_ >= timestamp(date_add(curdate(), interval - day(curdate()) + 1 day)) then 1 else 0 end) quit_num_
         FROM student_registration sr left join music_group mg on sr.music_group_id_ = mg.id_
         <where>
-            sr.music_group_status_ != 'QUIT'
     		<if test="organId != null">
     			AND mg.organ_id_ = #{organId}
     		</if>
-    	</where> 
+    	</where>
     </select>
     <select id="findMapByMusicGroupId" resultType="java.util.Map">
         SELECT sr.user_id_ 'key',MIN(sr.parents_phone_) 'value' FROM student_registration sr

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

@@ -25,6 +25,7 @@
         <result column="certificate_num_" property="certificateNum"/>
         <result column="flow_organ_range_" property="flowOrganRange"/>
         <result column="introduction_" property="introduction"/>
+        <result column="is_support_course_schedule_rewards_rules_" property="isSupportCourseScheduleRewardsRules"/>
         <result column="update_time_" property="updateTime"/>
         <result column="create_time_" property="createTime"/>
 
@@ -68,8 +69,8 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Teacher" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO teacher
-        (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_)
-        VALUES(#{id},#{organId},#{jobType},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now())
+        (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_,is_support_course_schedule_rewards_rules_)
+        VALUES(#{id},#{organId},#{jobType},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now(),#{isSupportCourseScheduleRewardsRules})
     </insert>
 
     <insert id="addSysUser" parameterType="com.ym.mec.auth.api.entity.SysUser" useGeneratedKeys="true" keyColumn="id"
@@ -132,6 +133,9 @@
             <if test="introduction != null">
                 introduction_ = #{introduction},
             </if>
+            <if test="isSupportCourseScheduleRewardsRules != null">
+                is_support_course_schedule_rewards_rules_ = #{isSupportCourseScheduleRewardsRules},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>

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

@@ -507,15 +507,22 @@
           LEFT JOIN sys_user su ON suca.user_id_=su.id_
         WHERE
           suca.course_balance_ >0
+          <if test="search!=null and search!=''">
+              AND (su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
+          </if>
         <include refid="global.limit"/>
     </select>
     <select id="countHaveCourseBalanceStudentNum" resultType="int">
         SELECT
             COUNT(1)
         FROM
-        sys_user_cash_account suca
+            sys_user_cash_account suca
+            LEFT JOIN sys_user su ON suca.user_id_=su.id_
         WHERE
         suca.course_balance_ >0
+        <if test="search!=null and search!=''">
+            AND (su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
+        </if>
     </select>
 
     <select id="countVipGroupStudents" resultType="int">