浏览代码

Merge remote-tracking branch 'origin/master'

Joburgess 5 年之前
父节点
当前提交
0638a73a56
共有 17 个文件被更改,包括 879 次插入0 次删除
  1. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/AppVersionInfoDao.java
  2. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleModifyLogDao.java
  3. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherFreeTimeDao.java
  4. 125 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/AppVersionInfo.java
  5. 81 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleModifyLog.java
  6. 146 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherFreeTime.java
  7. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/service/AppVersionInfoService.java
  8. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleModifyLogService.java
  9. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherFreeTimeService.java
  10. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/AppVersionInfoServiceImpl.java
  11. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleModifyLogServiceImpl.java
  12. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherFreeTimeServiceImpl.java
  13. 99 0
      mec-biz/src/main/resources/config/mybatis/AppVersionInfoMapper.xml
  14. 47 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleModifyLogMapper.xml
  15. 105 0
      mec-biz/src/main/resources/config/mybatis/TeacherFreeTimeMapper.xml
  16. 84 0
      mec-web/src/main/java/com/ym/mec/web/controller/AppVersionInfoController.java
  17. 60 0
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherFreeTimeController.java

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/AppVersionInfoDao.java

@@ -0,0 +1,11 @@
+package com.ym.mec.biz.dal.dao;
+
+import java.util.List;
+
+import com.ym.mec.biz.dal.entity.AppVersionInfo;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface AppVersionInfoDao extends BaseDAO<Integer, AppVersionInfo> {
+
+	List<AppVersionInfo> queryNewestByPlatform(String platform);
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleModifyLogDao.java

@@ -0,0 +1,10 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
+import com.ym.mec.common.dal.BaseDAO;
+
+
+public interface CourseScheduleModifyLogDao extends BaseDAO<Integer, CourseScheduleModifyLog> {
+
+	
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherFreeTimeDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.TeacherFreeTime;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface TeacherFreeTimeDao extends BaseDAO<Integer, TeacherFreeTime> {
+
+	
+}

+ 125 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/AppVersionInfo.java

@@ -0,0 +1,125 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(app_version_info):
+ */
+public class AppVersionInfo {
+
+	/**  */
+	private Integer id;
+	
+	/** 平台(andorid/ios) */
+	private String platform;
+	
+	/** 版本号(以V开头) */
+	private String version;
+	
+	/** 状态(newest/history) */
+	private String status;
+	
+	/** 是否强制更新 */
+	private boolean isForceUpdate;
+	
+	/** 更新描述 */
+	private String description;
+	
+	/** 下载地址 */
+	private byte[] downloadUrl;
+	
+	/** 创建人 */
+	private Integer operatorId;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setPlatform(String platform){
+		this.platform = platform;
+	}
+	
+	public String getPlatform(){
+		return this.platform;
+	}
+			
+	public void setVersion(String version){
+		this.version = version;
+	}
+	
+	public String getVersion(){
+		return this.version;
+	}
+			
+	public void setStatus(String status){
+		this.status = status;
+	}
+	
+	public String getStatus(){
+		return this.status;
+	}
+			
+	public void setIsForceUpdate(boolean isForceUpdate){
+		this.isForceUpdate = isForceUpdate;
+	}
+	
+	public boolean isIsForceUpdate(){
+		return this.isForceUpdate;
+	}
+			
+	public void setDescription(String description){
+		this.description = description;
+	}
+	
+	public String getDescription(){
+		return this.description;
+	}
+			
+	public void setDownloadUrl(byte[] downloadUrl){
+		this.downloadUrl = downloadUrl;
+	}
+	
+	public byte[] getDownloadUrl(){
+		return this.downloadUrl;
+	}
+			
+	public void setOperatorId(Integer operatorId){
+		this.operatorId = operatorId;
+	}
+	
+	public Integer getOperatorId(){
+		return this.operatorId;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 81 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleModifyLog.java

@@ -0,0 +1,81 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(course_schedule_modify_log):
+ */
+public class CourseScheduleModifyLog {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Long courseScheduleId;
+	
+	/**  */
+	private Integer operatorId;
+	
+	/**  */
+	private String previousCourseSchedule;
+	
+	/**  */
+	private String currentCourseSchedule;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setCourseScheduleId(Long courseScheduleId){
+		this.courseScheduleId = courseScheduleId;
+	}
+	
+	public Long getCourseScheduleId(){
+		return this.courseScheduleId;
+	}
+			
+	public void setOperatorId(Integer operatorId){
+		this.operatorId = operatorId;
+	}
+	
+	public Integer getOperatorId(){
+		return this.operatorId;
+	}
+			
+	public void setPreviousCourseSchedule(String previousCourseSchedule){
+		this.previousCourseSchedule = previousCourseSchedule;
+	}
+	
+	public String getPreviousCourseSchedule(){
+		return this.previousCourseSchedule;
+	}
+			
+	public void setCurrentCourseSchedule(String currentCourseSchedule){
+		this.currentCourseSchedule = currentCourseSchedule;
+	}
+	
+	public String getCurrentCourseSchedule(){
+		return this.currentCourseSchedule;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 146 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherFreeTime.java

@@ -0,0 +1,146 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(teacher_free_time):
+ */
+public class TeacherFreeTime {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer userId;
+	
+	/**  */
+	private String monday;
+	
+	/**  */
+	private String tuesday;
+	
+	/**  */
+	private String wednesday;
+	
+	/**  */
+	private String thursday;
+	
+	/**  */
+	private String friday;
+	
+	/**  */
+	private String saturday;
+	
+	/**  */
+	private String sunday;
+	
+	private Integer totalTimes;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setMonday(String monday){
+		this.monday = monday;
+	}
+	
+	public String getMonday(){
+		return this.monday;
+	}
+			
+	public void setTuesday(String tuesday){
+		this.tuesday = tuesday;
+	}
+	
+	public String getTuesday(){
+		return this.tuesday;
+	}
+			
+	public void setWednesday(String wednesday){
+		this.wednesday = wednesday;
+	}
+	
+	public String getWednesday(){
+		return this.wednesday;
+	}
+			
+	public void setThursday(String thursday){
+		this.thursday = thursday;
+	}
+	
+	public String getThursday(){
+		return this.thursday;
+	}
+			
+	public void setFriday(String friday){
+		this.friday = friday;
+	}
+	
+	public String getFriday(){
+		return this.friday;
+	}
+			
+	public void setSaturday(String saturday){
+		this.saturday = saturday;
+	}
+	
+	public String getSaturday(){
+		return this.saturday;
+	}
+			
+	public void setSunday(String sunday){
+		this.sunday = sunday;
+	}
+	
+	public String getSunday(){
+		return this.sunday;
+	}
+			
+	public Integer getTotalTimes() {
+		return totalTimes;
+	}
+
+	public void setTotalTimes(Integer totalTimes) {
+		this.totalTimes = totalTimes;
+	}
+
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/AppVersionInfoService.java

@@ -0,0 +1,11 @@
+package com.ym.mec.biz.service;
+
+import java.util.List;
+
+import com.ym.mec.biz.dal.entity.AppVersionInfo;
+import com.ym.mec.common.service.BaseService;
+
+public interface AppVersionInfoService extends BaseService<Integer, AppVersionInfo> {
+
+	List<AppVersionInfo> queryNewestByPlatform(String platform);
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleModifyLogService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
+import com.ym.mec.common.service.BaseService;
+
+public interface CourseScheduleModifyLogService extends BaseService<Integer, CourseScheduleModifyLog> {
+
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherFreeTimeService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.TeacherFreeTime;
+import com.ym.mec.common.service.BaseService;
+
+public interface TeacherFreeTimeService extends BaseService<Integer, TeacherFreeTime> {
+
+}

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/AppVersionInfoServiceImpl.java

@@ -0,0 +1,30 @@
+package com.ym.mec.biz.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.AppVersionInfoDao;
+import com.ym.mec.biz.dal.entity.AppVersionInfo;
+import com.ym.mec.biz.service.AppVersionInfoService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class AppVersionInfoServiceImpl extends BaseServiceImpl<Integer, AppVersionInfo>  implements AppVersionInfoService {
+	
+	@Autowired
+	private AppVersionInfoDao appVersionInfoDao;
+
+	@Override
+	public BaseDAO<Integer, AppVersionInfo> getDAO() {
+		return appVersionInfoDao;
+	}
+
+	@Override
+	public List<AppVersionInfo> queryNewestByPlatform(String platform) {
+		return appVersionInfoDao.queryNewestByPlatform(platform);
+	}
+	
+}

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleModifyLogServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.CourseScheduleModifyLogDao;
+import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class CourseScheduleModifyLogServiceImpl extends BaseServiceImpl<Integer,CourseScheduleModifyLog>{
+	
+	@Autowired
+	private CourseScheduleModifyLogDao courseScheduleModifyLogDao;
+
+	@Override
+	public BaseDAO<Integer, CourseScheduleModifyLog> getDAO() {
+		return courseScheduleModifyLogDao;
+	}
+	
+}

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherFreeTimeServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.TeacherFreeTimeDao;
+import com.ym.mec.biz.dal.entity.TeacherFreeTime;
+import com.ym.mec.biz.service.TeacherFreeTimeService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class TeacherFreeTimeServiceImpl extends BaseServiceImpl<Integer, TeacherFreeTime> implements TeacherFreeTimeService {
+
+	@Autowired
+	private TeacherFreeTimeDao teacherFreeTimeDao;
+
+	@Override
+	public BaseDAO<Integer, TeacherFreeTime> getDAO() {
+		return teacherFreeTimeDao;
+	}
+
+}

+ 99 - 0
mec-biz/src/main/resources/config/mybatis/AppVersionInfoMapper.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.ym.mec.biz.dal.dao.AppVersionInfoDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.AppVersionInfo"
+		id="AppVersionInfo">
+		<result column="id_" property="id" />
+		<result column="platform_" property="platform" />
+		<result column="version_" property="version" />
+		<result column="status_" property="status" />
+		<result column="is_force_update_" property="isForceUpdate" />
+		<result column="description_" property="description" />
+		<result column="download_url_" property="downloadUrl" />
+		<result column="operator_id_" property="operatorId" />
+		<result column="update_time_" property="updateTime" />
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="AppVersionInfo">
+		SELECT * FROM
+		app_version_info WHERE id_ = #{id}
+	</select>
+	
+	<select id="queryNewestByPlatform" resultMap="AppVersionInfo">
+		SELECT * FROM app_version_info WHERE platform_ = #{platform} and status_ = 'newest'
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="AppVersionInfo">
+		SELECT * FROM app_version_info
+		ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.AppVersionInfo"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO app_version_info
+		(id_,platform_,version_,status_,is_force_update_,description_,download_url_,operator_id_,update_time_,create_time_)
+		VALUES(#{id},#{platform},#{version},#{status},#{isForceUpdate},#{description},#{downloadUrl},#{operatorId},#{updateTime},#{createTime})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.AppVersionInfo">
+		UPDATE app_version_info
+		<set>
+			<if test="operatorId != null">
+				operator_id_ = #{operatorId},
+			</if>
+			<if test="status != null">
+				status_ = #{status},
+			</if>
+			<if test="downloadUrl != null">
+				download_url_ = #{downloadUrl},
+			</if>
+			<if test="platform != null">
+				platform_ = #{platform},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="version != null">
+				version_ = #{version},
+			</if>
+			<if test="description != null">
+				description_ = #{description},
+			</if>
+			<if test="isForceUpdate != null">
+				is_force_update_ = #{isForceUpdate},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM app_version_info WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="AppVersionInfo" parameterType="map">
+		SELECT * FROM app_version_info ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM app_version_info
+	</select>
+</mapper>

+ 47 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleModifyLogMapper.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.ym.mec.biz.dal.dao.CourseScheduleModifyLogDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleModifyLog"
+		id="CourseScheduleModifyLog">
+		<result column="id_" property="id" />
+		<result column="course_schedule_id_" property="courseScheduleId" />
+		<result column="operator_id_" property="operatorId" />
+		<result column="previous_course_schedule_" property="previousCourseSchedule" />
+		<result column="current_course_schedule_" property="currentCourseSchedule" />
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="CourseScheduleModifyLog">
+		SELECT * FROM
+		course_schedule_modify_log
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleModifyLog"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO course_schedule_modify_log
+		(id_,course_schedule_id_,operator_id_,previous_course_schedule_,current_course_schedule_,create_time_)
+		VALUES(#{id},#{courseScheduleId},#{operatorId},#{previousCourseSchedule},#{currentCourseSchedule},#{createTime})
+	</insert>
+
+
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="CourseScheduleModifyLog"
+		parameterType="map">
+		SELECT * FROM course_schedule_modify_log
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM
+		course_schedule_modify_log
+	</select>
+</mapper>

+ 105 - 0
mec-biz/src/main/resources/config/mybatis/TeacherFreeTimeMapper.xml

@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.ym.mec.biz.dal.dao.TeacherFreeTimeDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.TeacherFreeTime"
+		id="TeacherFreeTime">
+		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
+		<result column="monday_" property="monday" />
+		<result column="tuesday_" property="tuesday" />
+		<result column="wednesday_" property="wednesday" />
+		<result column="thursday_" property="thursday" />
+		<result column="friday_" property="friday" />
+		<result column="saturday_" property="saturday" />
+		<result column="sunday_" property="sunday" />
+		<result column="total_times_" property="totalTimes" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="TeacherFreeTime">
+		SELECT * FROM
+		teacher_free_time WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="TeacherFreeTime">
+		SELECT * FROM teacher_free_time
+		ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.TeacherFreeTime"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO teacher_free_time
+		(id_,user_id_,monday_,tuesday_,wednesday_,thursday_,friday_,saturday_,sunday_,total_times_,create_time_,update_time_)
+		VALUES(#{id},#{userId},#{monday},#{tuesday},#{wednesday},#{thursday},#{friday},#{saturday},#{sunday},#{totalTimes},#{createTime},#{updateTime})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.TeacherFreeTime">
+		UPDATE teacher_free_time
+		<set>
+			<if test="monday != null">
+				monday_ = #{monday},
+			</if>
+			<if test="userId != null">
+				user_id_ = #{userId},
+			</if>
+			<if test="thursday != null">
+				thursday_ = #{thursday},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="saturday != null">
+				saturday_ = #{saturday},
+			</if>
+			<if test="wednesday != null">
+				wednesday_ = #{wednesday},
+			</if>
+			<if test="friday != null">
+				friday_ = #{friday},
+			</if>
+			<if test="tuesday != null">
+				tuesday_ = #{tuesday},
+			</if>
+			<if test="sunday != null">
+				sunday_ = #{sunday},
+			</if>
+			<if test="totalTimes != null">
+				total_times_ = #{totalTimes},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM teacher_free_time WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="TeacherFreeTime"
+		parameterType="map">
+		SELECT * FROM teacher_free_time ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM
+		teacher_free_time
+	</select>
+</mapper>

+ 84 - 0
mec-web/src/main/java/com/ym/mec/web/controller/AppVersionInfoController.java

@@ -0,0 +1,84 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.entity.AppVersionInfo;
+import com.ym.mec.biz.service.AppVersionInfoService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+
+@RequestMapping("appVersionInfo")
+@Api(tags = "APP版本信息服务")
+@RestController
+public class AppVersionInfoController extends BaseController {
+
+	@Autowired
+	private AppVersionInfoService appVersionInfoService;
+
+	@ApiOperation("分页查询")
+	@GetMapping(value = "/list")
+	public Object getList(QueryInfo queryInfo) {
+		return succeed(appVersionInfoService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("根据app客户端查询对象")
+	@ApiImplicitParam(name = "platform", value = "平台名称", required = true, dataType = "String", paramType = "path")
+	@GetMapping(value = "/queryByPlatform")
+	public Object queryByPlatform(String platform) {
+		List<AppVersionInfo> list = appVersionInfoService.queryNewestByPlatform(platform);
+		if (list.size() > 0) {
+			return succeed(list.get(0));
+		}
+		return failed();
+	}
+
+	@ApiOperation("单查询")
+	@ApiImplicitParam(name = "id", value = "ID编号", required = true, dataType = "Integer", paramType = "path")
+	@GetMapping(value = "/query")
+	public Object query(Integer id) {
+
+		return succeed(appVersionInfoService.get(id));
+	}
+
+	@ApiOperation("新增")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object add(AppVersionInfo appVersionInfo) {
+		Date date = new Date();
+		appVersionInfo.setCreateTime(date);
+		if (StringUtils.equals(appVersionInfo.getStatus(), "newest")) {
+			List<AppVersionInfo> list = appVersionInfoService.queryNewestByPlatform(appVersionInfo.getPlatform());
+			if (list.size() > 0) {
+				return failed("一个平台只能有一个最新状态的记录");
+			}
+		}
+		return succeed(appVersionInfoService.insert(appVersionInfo));
+	}
+
+	@ApiOperation("更新")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object update(AppVersionInfo appVersionInfo) {
+		Date date = new Date();
+		appVersionInfo.setUpdateTime(date);
+		if (StringUtils.equals(appVersionInfo.getStatus(), "newest")) {
+			List<AppVersionInfo> list = appVersionInfoService.queryNewestByPlatform(appVersionInfo.getPlatform());
+			if (list.size() > 0) {
+				return failed("一个平台只能有一个最新状态的记录");
+			}
+		}
+		return succeed(appVersionInfoService.update(appVersionInfo));
+	}
+
+}

+ 60 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TeacherFreeTimeController.java

@@ -0,0 +1,60 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.entity.TeacherFreeTime;
+import com.ym.mec.biz.service.TeacherFreeTimeService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+
+@RequestMapping("teacherFreeTime")
+@Api(tags = "老师空余时间设置服务")
+@RestController
+public class TeacherFreeTimeController extends BaseController {
+
+	@Autowired
+	private TeacherFreeTimeService teacherFreeTimeService;
+
+	@ApiOperation("分页查询")
+	@GetMapping(value = "/list")
+	public Object getList(QueryInfo queryInfo) {
+		return succeed(teacherFreeTimeService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("单查询")
+	@ApiImplicitParam(name = "id", value = "ID编号", required = true, dataType = "Integer", paramType = "path")
+	@GetMapping(value = "/query")
+	public Object query(Integer id) {
+
+		return succeed(teacherFreeTimeService.get(id));
+	}
+
+	@ApiOperation("新增")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object add(TeacherFreeTime teacherFreeTime) {
+		Date date = new Date();
+		teacherFreeTime.setCreateTime(date);
+		return succeed(teacherFreeTimeService.insert(teacherFreeTime));
+	}
+
+	@ApiOperation("更新")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object update(TeacherFreeTime teacherFreeTime) {
+		Date date = new Date();
+		teacherFreeTime.setUpdateTime(date);
+
+		return succeed(teacherFreeTimeService.update(teacherFreeTime));
+	}
+
+}