Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 years ago
parent
commit
93f06ba6e0
19 changed files with 615 additions and 7 deletions
  1. 5 5
      codegen/src/main/resources/generateConfigration.xml
  2. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java
  3. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeLessonApplyDao.java
  4. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ResourceRespositoryDao.java
  5. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java
  6. 136 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/PracticeGroup.java
  7. 59 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/PracticeLessonApply.java
  8. 81 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ResourceRespository.java
  9. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GroupType.java
  10. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java
  11. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeLessonApplyService.java
  12. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ResourceRespositoryService.java
  13. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  14. 28 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeLessonApplyServiceImpl.java
  15. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ResourceRespositoryServiceImpl.java
  16. 50 0
      mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml
  17. 46 0
      mec-biz/src/main/resources/config/mybatis/PracticeLessonApplyMapper.xml
  18. 45 0
      mec-biz/src/main/resources/config/mybatis/ResourceRespositoryMapper.xml
  19. 59 0
      mec-student/src/main/java/com/ym/mec/student/controller/PracticeLessonApplyController.java

+ 5 - 5
codegen/src/main/resources/generateConfigration.xml

@@ -2,11 +2,11 @@
 <GenerateConfiguration>
 <GenerateConfiguration>
 	<dbConfiguration>
 	<dbConfiguration>
 		<driverClass>com.mysql.jdbc.Driver</driverClass>
 		<driverClass>com.mysql.jdbc.Driver</driverClass>
-		<url>jdbc:mysql://47.99.212.176:3306/mec_dev</url>
-		<username>mec_dev</username>
-		<password>mec_dev</password>
-		<catalog>mec_dev</catalog>
-		<schema>mec_dev</schema>
+		<url>jdbc:mysql://47.99.212.176:3306/mec_data_online</url>
+		<username>dayaData</username>
+		<password>dayaDataOnline2019</password>
+		<catalog>mec_data_online</catalog>
+		<schema>mec_data_online</schema>
 	</dbConfiguration>
 	</dbConfiguration>
 	<srcBase>d:/javabean</srcBase>
 	<srcBase>d:/javabean</srcBase>
 	<pojoPackageName>com.ym.mec.biz.dal.entity</pojoPackageName>
 	<pojoPackageName>com.ym.mec.biz.dal.entity</pojoPackageName>

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.PracticeGroup;
+
+public interface PracticeGroupDao extends com.ym.mec.common.dal.BaseDAO<Long, PracticeGroup> {
+
+	
+}

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeLessonApplyDao.java

@@ -0,0 +1,14 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.PracticeLessonApply;
+
+public interface PracticeLessonApplyDao extends com.ym.mec.common.dal.BaseDAO<Integer, PracticeLessonApply> {
+
+
+    /**
+     * 根据学员编号获取陪练课申请
+     * @param userId
+     * @return
+     */
+    PracticeLessonApply findByUserId(Integer userId);
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ResourceRespositoryDao.java

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

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java

@@ -28,7 +28,7 @@ public class CourseSchedule {
 	public enum CourseScheduleType implements BaseEnum<String, CourseScheduleType> {
 	public enum CourseScheduleType implements BaseEnum<String, CourseScheduleType> {
 
 
 		SINGLE("SINGLE", "单技课"), MIX("MIX", "合奏课"), HIGH("HIGH", "小班课"), VIP("VIP", "vip课"), DEMO("DEMO", "试听课"), COMPREHENSIVE("COMPREHENSIVE", "综合课"), PRACTICE(
 		SINGLE("SINGLE", "单技课"), MIX("MIX", "合奏课"), HIGH("HIGH", "小班课"), VIP("VIP", "vip课"), DEMO("DEMO", "试听课"), COMPREHENSIVE("COMPREHENSIVE", "综合课"), PRACTICE(
-				"PRACTICE", "练课"), ENLIGHTENMENT("ENLIGHTENMENT", "启蒙课"), TRAINING_SINGLE("TRAINING_SINGLE", "集训单技课"), TRAINING_MIX("TRAINING_MIX", "集训合奏课"), CLASSROOM(
+				"PRACTICE", "练课"), ENLIGHTENMENT("ENLIGHTENMENT", "启蒙课"), TRAINING_SINGLE("TRAINING_SINGLE", "集训单技课"), TRAINING_MIX("TRAINING_MIX", "集训合奏课"), CLASSROOM(
 				"CLASSROOM", "课堂课");
 				"CLASSROOM", "课堂课");
 
 
 		private String code;
 		private String code;

+ 136 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/PracticeGroup.java

@@ -0,0 +1,136 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(practice_group):
+ */
+public class PracticeGroup {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private String name;
+	
+	/**  */
+	private Integer subjectId;
+	
+	/**  */
+	private Integer userId;
+	
+	/**  */
+	private Integer singleClassMinutes;
+	
+	/**  */
+	private Integer organId;
+	
+	/**  */
+	private java.util.Date coursesStartDate;
+	
+	/**  */
+	private java.util.Date coursesExpireDate;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/**  */
+	private String memo;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setSubjectId(Integer subjectId){
+		this.subjectId = subjectId;
+	}
+	
+	public Integer getSubjectId(){
+		return this.subjectId;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setSingleClassMinutes(Integer singleClassMinutes){
+		this.singleClassMinutes = singleClassMinutes;
+	}
+	
+	public Integer getSingleClassMinutes(){
+		return this.singleClassMinutes;
+	}
+			
+	public void setOrganId(Integer organId){
+		this.organId = organId;
+	}
+	
+	public Integer getOrganId(){
+		return this.organId;
+	}
+			
+	public void setCoursesStartDate(java.util.Date coursesStartDate){
+		this.coursesStartDate = coursesStartDate;
+	}
+	
+	public java.util.Date getCoursesStartDate(){
+		return this.coursesStartDate;
+	}
+			
+	public void setCoursesExpireDate(java.util.Date coursesExpireDate){
+		this.coursesExpireDate = coursesExpireDate;
+	}
+	
+	public java.util.Date getCoursesExpireDate(){
+		return this.coursesExpireDate;
+	}
+			
+	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;
+	}
+			
+	public void setMemo(String memo){
+		this.memo = memo;
+	}
+	
+	public String getMemo(){
+		return this.memo;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 59 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/PracticeLessonApply.java

@@ -0,0 +1,59 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(practice_lesson_apply):
+ */
+public class PracticeLessonApply {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer userId;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private String memo;
+	
+	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 setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setMemo(String memo){
+		this.memo = memo;
+	}
+	
+	public String getMemo(){
+		return this.memo;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

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

@@ -0,0 +1,81 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(resource_respository):
+ */
+public class ResourceRespository {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private String name;
+	
+	/**  */
+	private String url;
+	
+	/**  */
+	private boolean delFlag;
+	
+	/**  */
+	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 setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setUrl(String url){
+		this.url = url;
+	}
+	
+	public String getUrl(){
+		return this.url;
+	}
+			
+	public void setDelFlag(boolean delFlag){
+		this.delFlag = delFlag;
+	}
+	
+	public boolean isDelFlag(){
+		return this.delFlag;
+	}
+			
+	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);
+	}
+
+}

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GroupType.java

@@ -3,7 +3,7 @@ package com.ym.mec.biz.dal.enums;
 import com.ym.mec.common.enums.BaseEnum;
 import com.ym.mec.common.enums.BaseEnum;
 
 
 public enum GroupType implements BaseEnum<String, GroupType> {
 public enum GroupType implements BaseEnum<String, GroupType> {
-	MUSIC("乐团课"), VIP("VIP课"), DEMO("试听课"), SPORADIC("零星收费");
+	MUSIC("乐团课"), VIP("VIP课"), DEMO("试听课"), SPORADIC("零星收费"), PRACTICE("陪练课");
 
 
 	private String desc;
 	private String desc;
 
 

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

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

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeLessonApplyService.java

@@ -0,0 +1,14 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.PracticeLessonApply;
+import com.ym.mec.common.service.BaseService;
+
+public interface PracticeLessonApplyService extends BaseService<Integer, PracticeLessonApply>{
+
+    /**
+     * 根据学员编号获取陪练课申请
+     * @param userId
+     * @return
+     */
+    PracticeLessonApply findByUserId(Integer userId);
+}

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

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

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.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.PracticeGroupDao;
+import com.ym.mec.biz.dal.entity.PracticeGroup;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGroup>{
+
+	@Autowired
+	private PracticeGroupDao practiceGroupDao;
+	
+	@Override
+	public BaseDAO<Long, PracticeGroup> getDAO() {
+		return practiceGroupDao;
+	}
+	
+}

+ 28 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeLessonApplyServiceImpl.java

@@ -0,0 +1,28 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.service.PracticeLessonApplyService;
+import com.ym.mec.biz.service.SchoolService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.PracticeLessonApplyDao;
+import com.ym.mec.biz.dal.entity.PracticeLessonApply;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class PracticeLessonApplyServiceImpl extends BaseServiceImpl<Integer, PracticeLessonApply>  implements PracticeLessonApplyService {
+	
+	@Autowired
+	private PracticeLessonApplyDao practiceLessonApplyDao;
+
+	@Override
+	public BaseDAO<Integer, PracticeLessonApply> getDAO() {
+		return practiceLessonApplyDao;
+	}
+
+	@Override
+	public PracticeLessonApply findByUserId(Integer userId) {
+		return practiceLessonApplyDao.findByUserId(userId);
+	}
+}

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ResourceRespositoryServiceImpl.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.ResourceRespositoryDao;
+import com.ym.mec.biz.dal.entity.ResourceRespository;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class ResourceRespositoryServiceImpl extends BaseServiceImpl<Integer, ResourceRespository>{
+
+	@Autowired
+	private ResourceRespositoryDao resourceRespositoryDao;
+	
+	@Override
+	public BaseDAO<Integer, ResourceRespository> getDAO() {
+		return resourceRespositoryDao;
+	}
+	
+}

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

@@ -0,0 +1,50 @@
+<?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.PracticeGroupDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.PracticeGroup" id="PracticeGroup">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="subject_id_" property="subjectId" />
+		<result column="user_id_" property="userId" />
+		<result column="single_class_minutes_" property="singleClassMinutes" />
+		<result column="organ_id_" property="organId" />
+		<result column="courses_start_date_" property="coursesStartDate" />
+		<result column="courses_expire_date_" property="coursesExpireDate" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="memo_" property="memo" />
+	</resultMap>
+	
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="PracticeGroup">
+		SELECT * FROM practice_group
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.PracticeGroup" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO practice_group (id_,name_,subject_id_,user_id_,single_class_minutes_,organ_id_,courses_start_date_,courses_expire_date_,create_time_,update_time_,memo_) VALUES(#{id},#{name},#{subjectId},#{userId},#{singleClassMinutes},#{organId},#{coursesStartDate},#{coursesExpireDate},#{createTime},#{updateTime},#{memo})
+	</insert>
+	
+	
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="PracticeGroup" parameterType="map">
+		SELECT * FROM practice_group <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM practice_group
+	</select>
+</mapper>

+ 46 - 0
mec-biz/src/main/resources/config/mybatis/PracticeLessonApplyMapper.xml

@@ -0,0 +1,46 @@
+<?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.PracticeLessonApplyDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.PracticeLessonApply" id="PracticeLessonApply">
+		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
+		<result column="create_time_" property="createTime" />
+		<result column="memo_" property="memo" />
+	</resultMap>
+	
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="PracticeLessonApply">
+		SELECT * FROM practice_lesson_apply
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.PracticeLessonApply" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO practice_lesson_apply (id_,user_id_,create_time_,memo_) VALUES(#{id},#{userId},#{createTime},#{memo})
+	</insert>
+	
+	
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="PracticeLessonApply" parameterType="map">
+		SELECT * FROM practice_lesson_apply <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM practice_lesson_apply
+	</select>
+    <select id="findByUserId" resultMap="PracticeLessonApply">
+		SELECT * FROM practice_lesson_apply WHERE user_id_ = #{userId} LIMIT 1
+	</select>
+</mapper>

+ 45 - 0
mec-biz/src/main/resources/config/mybatis/ResourceRespositoryMapper.xml

@@ -0,0 +1,45 @@
+<?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.ResourceRespositoryDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.ResourceRespository" id="ResourceRespository">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="url_" property="url" />
+		<result column="del_flag_" property="delFlag" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ResourceRespository">
+		SELECT * FROM resource_respository
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ResourceRespository" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO resource_respository (id_,name_,url_,del_flag_,create_time_,update_time_) VALUES(#{id},#{name},#{url},#{delFlag},#{createTime},#{updateTime})
+	</insert>
+	
+	
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ResourceRespository" parameterType="map">
+		SELECT * FROM resource_respository <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM resource_respository
+	</select>
+</mapper>

+ 59 - 0
mec-student/src/main/java/com/ym/mec/student/controller/PracticeLessonApplyController.java

@@ -0,0 +1,59 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.PracticeLessonApply;
+import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
+import com.ym.mec.biz.service.ContractService;
+import com.ym.mec.biz.service.PracticeLessonApplyService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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 java.util.Date;
+
+@RequestMapping("practiceLessonApply")
+@Api(tags = "陪练课服务")
+@RestController
+public class PracticeLessonApplyController extends BaseController {
+
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@Autowired
+	private PracticeLessonApplyService practiceLessonApplyService;
+
+	@ApiOperation("新增陪练课申请")
+	@PostMapping(value = "add")
+	public Object add(String memo) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed("获取用户信息失败");
+		}
+		PracticeLessonApply lessonApply = practiceLessonApplyService.findByUserId(sysUser.getId());
+		if(lessonApply != null){
+			throw new BizException("您已申请过陪练课!");
+		}
+		PracticeLessonApply practiceLessonApply = new PracticeLessonApply();
+		practiceLessonApply.setCreateTime(new Date());
+		practiceLessonApply.setMemo(memo);
+		practiceLessonApply.setUserId(sysUser.getId());
+		return succeed(practiceLessonApplyService.insert(practiceLessonApply));
+	}
+
+	@ApiOperation("根据用户编号查询是否申请过")
+	@GetMapping(value = "findPracticeByUser")
+	public Object findPracticeByUser() {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed("获取用户信息失败");
+		}
+		return succeed(practiceLessonApplyService.findByUserId(sysUser.getId()));
+	}
+}