zouxuan 5 лет назад
Родитель
Сommit
224233af4d

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

@@ -15,7 +15,7 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
      * @param subjectId
      * @return
      */
-    List<Goods> findGoodsBySubId(@Param("subjectId") Integer subjectId, @Param("goodsCategoryId") Integer goodsCategoryId);
+    List<Goods> findGoodsBySubId(@Param("subjectId") Integer subjectId, @Param("type") String type);
 
     /**
      * 根据商品分类查找商品数量

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysUserBankCardDao.java

@@ -18,4 +18,11 @@ public interface SysUserBankCardDao extends BaseDAO<Long, SysUserBankCard> {
      * @return
      */
     List<SysUserBankCard> findByUser(@Param("userId") Integer userId);
+
+    /**
+     * 删除银行卡
+     * @param id
+     * @param userId
+     */
+    void del(@Param("id") Long id, @Param("userId")Integer userId);
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentPayLogQueryInfo.java

@@ -11,6 +11,17 @@ public class StudentPayLogQueryInfo extends QueryInfo {
 
     private Integer userId;
 
+    @ApiModelProperty(value = "当前年月(2019-08)",required = true)
+    private String date;
+
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+
     public Integer getUserId() {
         return userId;
     }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/GoodsService.java

@@ -15,7 +15,7 @@ public interface GoodsService extends BaseService<Integer, Goods> {
      * @param subjectId
      * @return
      */
-    List<Goods> findGoodsBySubId(Integer subjectId, Integer goodsCategoryId);
+    List<Goods> findGoodsBySubId(Integer subjectId,String type);
 
     /**
      * 根据商品分类id查找商品数量

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysUserBankCardService.java

@@ -20,4 +20,11 @@ public interface SysUserBankCardService extends BaseService<Long, SysUserBankCar
      * @return
      */
     List<SysUserBankCard> findByUser(Integer id);
+
+    /**
+     * 删除银行卡
+     * @param id
+     * @param userId
+     */
+    void del(Long id, Integer userId);
 }

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

@@ -23,8 +23,8 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 	}
 
 	@Override
-	public List<Goods> findGoodsBySubId(Integer subjectId,Integer goodsCategoryId) {
-		return goodsDao.findGoodsBySubId(subjectId,goodsCategoryId);
+	public List<Goods> findGoodsBySubId(Integer subjectId,String type) {
+		return goodsDao.findGoodsBySubId(subjectId,type);
 	}
 
 	public int findGoodsNumByCategoryId(Integer goodsCategoryId){

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysUserBankCardServiceImpl.java

@@ -49,4 +49,9 @@ public class SysUserBankCardServiceImpl extends BaseServiceImpl<Long, SysUserBan
 	public List<SysUserBankCard> findByUser(Integer userId) {
 		return sysUserBankCardDao.findByUser(userId);
 	}
+
+	@Override
+	public void del(Long id, Integer userId) {
+		sysUserBankCardDao.del(id,userId);
+	}
 }

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

@@ -325,6 +325,9 @@
             <if test="search != null and search != ''">
                 AND cg.name_ LIKE CONCAT('%',#{search},'%')
             </if>
+            <if test="date != null and date != ''">
+                AND spo.create_time_ LIKE CONCAT(#{date},'%')
+            </if>
             <if test="userId != null">
                 AND spo.user_id_ = #{userId}
             </if>
@@ -347,6 +350,9 @@
             <if test="search != null and search != ''">
                 AND cg.name_ LIKE CONCAT('%',#{search},'%')
             </if>
+            <if test="date != null and date != ''">
+                AND spo.create_time_ LIKE CONCAT(#{date},'%')
+            </if>
             <if test="userId != null">
                 AND spo.user_id_ = #{userId}
             </if>

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

@@ -5,99 +5,103 @@
 不要修改此文件。所有改动将在下次重新自动生成时丢失。
 -->
 <mapper namespace="com.ym.mec.biz.dal.dao.DemoGroupDao">
-	
-	<resultMap type="com.ym.mec.biz.dal.entity.DemoGroup" id="DemoGroup">
-		<result column="id_" property="id" />
-		<result column="name_" property="name" />
-		<result column="single_class_minutes_" property="singleClassMinutes" />
-		<result column="organ_id_list_" property="organIdList" />
-		<result column="create_time_" property="createTime" />
-		<result column="update_time_" property="updateTime" />
-		<result column="user_id_" property="userId" />
-		<result column="price_" property="price"/>
-		<result column="subject_id_" property="subjectId"/>
-	</resultMap>
-
-	<resultMap id="studentDemoGroupListDto" type="com.ym.mec.biz.dal.dto.StudentDemoGroupListDto">
-		<result property="demoGroupId" column="demo_group_id_"/>
-		<result property="userId" column="user_id_"/>
-		<result property="userName" column="username_"/>
-		<result property="avatar" column="avatar_"/>
-		<result property="introduction" column="introduction_"/>
-		<result property="numberOfClasses" column="number_of_classes_"/>
-		<result property="subjectName" column="subject_name_"/>
-		<collection property="coursesPlans" resultMap="com.ym.mec.biz.dal.dao.DemoGroupCoursesPlanDao.DemoGroupCoursesPlan" column="dgcp.id_"/>
-	</resultMap>
-	
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="DemoGroup" >
+
+    <resultMap type="com.ym.mec.biz.dal.entity.DemoGroup" id="DemoGroup">
+        <result column="id_" property="id"/>
+        <result column="name_" property="name"/>
+        <result column="single_class_minutes_" property="singleClassMinutes"/>
+        <result column="organ_id_list_" property="organIdList"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="user_id_" property="userId"/>
+        <result column="price_" property="price"/>
+        <result column="subject_id_" property="subjectId"/>
+    </resultMap>
+
+    <resultMap id="studentDemoGroupListDto" type="com.ym.mec.biz.dal.dto.StudentDemoGroupListDto">
+        <result property="demoGroupId" column="demo_group_id_"/>
+        <result property="userId" column="user_id_"/>
+        <result property="userName" column="username_"/>
+        <result property="avatar" column="avatar_"/>
+        <result property="introduction" column="introduction_"/>
+        <result property="numberOfClasses" column="number_of_classes_"/>
+        <result property="subjectName" column="subject_name_"/>
+        <collection property="coursesPlans"
+                    resultMap="com.ym.mec.biz.dal.dao.DemoGroupCoursesPlanDao.DemoGroupCoursesPlan" column="dgcp.id_"/>
+    </resultMap>
+
+    <!-- 根据主键查询一条记录 -->
+    <select id="get" resultMap="DemoGroup">
 		SELECT * FROM demo_group WHERE id_ = #{id} 
 	</select>
-	
-	<!-- 全查询 -->
-	<select id="findAll" resultMap="DemoGroup">
+
+    <!-- 全查询 -->
+    <select id="findAll" resultMap="DemoGroup">
 		SELECT * FROM demo_group ORDER BY id_
 	</select>
-	
-	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.DemoGroup" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		<!--
-		<selectKey resultClass="int" keyProperty="id" > 
-		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
-		</selectKey>
-		-->
-		INSERT INTO demo_group (id_,name_,single_class_minutes_,organ_id_list_,create_time_,update_time_,user_id_,price_,subject_id_) VALUES(#{id},#{name},#{singleClassMinutes},#{organIdList},#{createTime},#{updateTime},#{userId},#{price},#{subjectId})
-	</insert>
-	
-	<!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="com.ym.mec.biz.dal.entity.DemoGroup">
-		UPDATE demo_group <set>
-<if test="userId != null">
-user_id_ = #{userId},
-</if>
-<if test="id != null">
-id_ = #{id},
-</if>
-<if test="updateTime != null">
-update_time_ = #{updateTime},
-</if>
-<if test="singleClassMinutes != null">
-single_class_minutes_ = #{singleClassMinutes},
-</if>
-<if test="organIdList != null">
-organ_id_list_ = #{organIdList},
-</if>
-<if test="name != null">
-name_ = #{name},
-</if>
-<if test="createTime != null">
-create_time_ = #{createTime},
-</if>
-		<if test="price != null">
-			price_ = #{price},
-		</if>
-		<if test="subjectId != null">
-			subject_id_ = #{subjectId},
-		</if>
-</set> WHERE id_ = #{id} 
-	</update>
-	
-	<!-- 根据主键删除一条记录 -->
-	<delete id="delete" >
+
+    <!-- 向数据库增加一条记录 -->
+    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.DemoGroup" useGeneratedKeys="true" keyColumn="id"
+            keyProperty="id">
+        <!--
+        <selectKey resultClass="int" keyProperty="id" >
+        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
+        </selectKey>
+        -->
+        INSERT INTO demo_group
+        (id_,name_,single_class_minutes_,organ_id_list_,create_time_,update_time_,user_id_,price_,subject_id_)
+        VALUES(#{id},#{name},#{singleClassMinutes},#{organIdList},#{createTime},#{updateTime},#{userId},#{price},#{subjectId})
+    </insert>
+
+    <!-- 根据主键查询一条记录 -->
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.DemoGroup">
+        UPDATE demo_group
+        <set>
+            <if test="userId != null">
+                user_id_ = #{userId},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+            <if test="singleClassMinutes != null">
+                single_class_minutes_ = #{singleClassMinutes},
+            </if>
+            <if test="organIdList != null">
+                organ_id_list_ = #{organIdList},
+            </if>
+            <if test="name != null">
+                name_ = #{name},
+            </if>
+            <if test="createTime != null">
+                create_time_ = #{createTime},
+            </if>
+            <if test="price != null">
+                price_ = #{price},
+            </if>
+            <if test="subjectId != null">
+                subject_id_ = #{subjectId},
+            </if>
+        </set>
+        WHERE id_ = #{id}
+    </update>
+
+    <!-- 根据主键删除一条记录 -->
+    <delete id="delete">
 		DELETE FROM demo_group WHERE id_ = #{id} 
 	</delete>
-	
-	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="DemoGroup" parameterType="map">
-		SELECT * FROM demo_group ORDER BY id_ <include refid="global.limit"/>
-	</select>
-	
-	<!-- 查询当前表的总记录数 -->
-	<select id="queryCount" resultType="int">
+
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="DemoGroup" parameterType="map">
+        SELECT * FROM demo_group ORDER BY id_
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM demo_group
 	</select>
 
-	<select id="organIdListByDemoGroupId" resultType="int">
+    <select id="organIdListByDemoGroupId" resultType="int">
 		SELECT
 			su.organ_id_
 		FROM
@@ -106,24 +110,25 @@ create_time_ = #{createTime},
 			LEFT JOIN sys_user su ON cgsm.user_id_=su.id_
 		WHERE dgcgm.demo_group_id_=#{demoGroupId}
 	</select>
-	<select id="getOrganIdByUserId" resultType="java.lang.Integer">
+    <select id="getOrganIdByUserId" resultType="java.lang.Integer">
 		select organ_id_ from sys_user where id_=#{userId}
 	</select>
-	<select id="createCourseScheduleByDemoGroup" parameterType="com.ym.mec.biz.dal.entity.DemoGroup" resultMap="com.ym.mec.biz.dal.dao.CourseScheduleDao.CourseSchedule">
+    <select id="createCourseScheduleByDemoGroup" parameterType="com.ym.mec.biz.dal.entity.DemoGroup"
+            resultMap="com.ym.mec.biz.dal.dao.CourseScheduleDao.CourseSchedule">
 		SELECT
 			#{classGroupId} class_group_id_,
 			'NOT_START' status_,
-			DATE_FORMAT(dgcp.courses_start_time_,'%Y-%m-%d') class_date_,
-			dgcp.courses_start_time_ start_class_time_,
-			DATE_ADD(dgcp.courses_start_time_,INTERVAL #{demoGroup.singleClassMinutes} MINUTE) end_class_time_,
+			DATE_FORMAT(dgcp.start_time_,'%Y-%m-%d') class_date_,
+			dgcp.start_time_ start_class_time_,
+			DATE_ADD(dgcp.start_time_,INTERVAL #{demoGroup.singleClassMinutes} MINUTE) end_class_time_,
 			#{demoGroup.userId} teacher_id_,
 			'ONLINE' teach_mode_,
 			'demo' type_
 		FROM
 			demo_group_courses_plan dgcp
-			WHERE dgcp.demo_group_id_=#{demoGroup.id} AND dgcp.courses_start_time_ = #{startTime}
+			WHERE dgcp.demo_group_id_=#{demoGroup.id} AND dgcp.start_time_ = #{startTime}
 	</select>
-	<select id="countDemoGroupStudents" resultType="java.lang.Integer">
+    <select id="countDemoGroupStudents" resultType="java.lang.Integer">
 		SELECT
 			count(cgsm.user_id_)
 		FROM
@@ -132,55 +137,55 @@ create_time_ = #{createTime},
 		WHERE dgcgm.demo_group_id_=#{demoGroupId}
 	</select>
 
-	<sql id="demoGroupQueryCondition">
-		<where>
-			dgcp.status_=0
-			<if test="search!=null">
-				AND su.username_ like concat('%',#{search},'%')
-			</if>
-			<if test="subjectIds!=null and subjectIds!=''">
-				AND FIND_IN_SET(dg.subject_id_,#{subjectIds})
-			</if>
-			<if test="startTime!=null and endTime==null">
-				AND dgcp.courses_start_time_=#{startTime}
-			</if>
-			<if test="startTime!=null and endTime!=null">
-				AND dgcp.courses_start_time_&gt;=#{startTime} AND dgcp.courses_start_time_ &lt;= #{endTime}
-			</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(dgcgm.class_group_id_) number_of_classes_,
-		dgcp.*
-		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 demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
-		<include refid="demoGroupQueryCondition"/>
-		GROUP BY dgcp.id_,dg.id_
-		ORDER BY dgcp.courses_start_time_
-		<include refid="global.limit"/>
-	</select>
-	<select id="countDemoGroupList" resultType="java.lang.Integer">
-		SELECT
-			count(*)
-		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"/>
-	</select>
-	<select id="findClassGroupIDByDemoGroupId" resultType="java.lang.Integer">
+    <sql id="demoGroupQueryCondition">
+        <where>
+            dgcp.status_=0
+            <if test="search!=null">
+                AND su.username_ like concat('%',#{search},'%')
+            </if>
+            <if test="subjectIds!=null and subjectIds!=''">
+                AND FIND_IN_SET(dg.subject_id_,#{subjectIds})
+            </if>
+            <if test="startTime!=null and endTime==null">
+                AND dgcp.start_time_=#{startTime}
+            </if>
+            <if test="startTime!=null and endTime!=null">
+                AND dgcp.start_time_&gt;=#{startTime} AND dgcp.start_time_ &lt;= #{endTime}
+            </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(dgcgm.class_group_id_) number_of_classes_,
+        dgcp.*
+        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 demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
+        <include refid="demoGroupQueryCondition"/>
+        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(*)
+        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"/>
+    </select>
+    <select id="findClassGroupIDByDemoGroupId" resultType="java.lang.Integer">
 		SELECT
 			class_group_id_
 		FROM
@@ -191,40 +196,41 @@ create_time_ = #{createTime},
 		SELECT * FROM demo_group WHERE user_id_=#{teacherId}
 	</select>
 
-	<sql id="teacherDemoGroupsQueryCondition">
-		<where>
-			dg.user_id_=#{teacherId}
-		</where>
-	</sql>
+    <sql id="teacherDemoGroupsQueryCondition">
+        <where>
+            dg.user_id_=#{teacherId}
+        </where>
+    </sql>
 
-	<select id="findTeacherDemoGroups" resultType="com.ym.mec.biz.dal.dto.TeacherManageDemoGroupListDto">
-		SELECT
-			cs.class_date_ classDate,
-			GROUP_CONCAT(DISTINCT CONCAT(cs.start_class_time_,cs.end_class_time_)) startTimes,
-			GROUP_CONCAT(s.name_) subjectNames
-		FROM
-			demo_group dg
-		LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
-		LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
-		LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
-		LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,cg.subject_id_list_)
-		<include refid="teacherDemoGroupsQueryCondition"/>
-		GROUP BY cs.class_date_
-		<include refid="global.limit"/>
-	</select>
-	<select id="countTeacherDemoGroups" resultType="int">
-		SELECT
-			count(*)
-		FROM
-			demo_group dg
-		LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
-		LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
-		LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
-		<include refid="teacherDemoGroupsQueryCondition"/>
-		GROUP BY cs.class_date_
-	</select>
+    <select id="findTeacherDemoGroups" resultType="com.ym.mec.biz.dal.dto.TeacherManageDemoGroupListDto">
+        SELECT
+        cs.class_date_ classDate,
+        GROUP_CONCAT(DISTINCT CONCAT(cs.start_class_time_,cs.end_class_time_)) startTimes,
+        GROUP_CONCAT(s.name_) subjectNames
+        FROM
+        demo_group dg
+        LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
+        LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
+        LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
+        LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,cg.subject_id_list_)
+        <include refid="teacherDemoGroupsQueryCondition"/>
+        GROUP BY cs.class_date_
+        <include refid="global.limit"/>
+    </select>
+    <select id="countTeacherDemoGroups" resultType="int">
+        SELECT
+        count(*)
+        FROM
+        demo_group dg
+        LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
+        LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
+        LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
+        <include refid="teacherDemoGroupsQueryCondition"/>
+        GROUP BY cs.class_date_
+    </select>
 
-	<select id="findDemoGroupStartClassTimesWithWeekByTeacherId" resultType="com.ym.mec.biz.dal.dto.EducationDemoGroupListDto">
+    <select id="findDemoGroupStartClassTimesWithWeekByTeacherId"
+            resultType="com.ym.mec.biz.dal.dto.EducationDemoGroupListDto">
 		SELECT
 			class_date_ classDate,
 			GROUP_CONCAT(start_class_time_) startClassTimes

+ 172 - 62
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1,88 +1,113 @@
 <?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.StudentRegistrationDao">
 
-    <resultMap type="com.ym.mec.biz.dal.entity.TeacherLeaveRecord" id="TeacherLeaveRecord">
-        <result column="id_" property="id" />
-        <result column="user_id_" property="userId" />
-        <result column="days_" property="days" />
-        <result column="leave_category_id_" property="leaveCategoryId" />
-        <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
-        <result column="remark_" property="remark" />
-        <result column="create_time_" property="createTime" />
-        <result column="update_time_" property="updateTime" />
-        <result column="start_time_" property="startTime" />
-        <result column="end_time_" property="endTime" />
-        <result column="courses_schedule_json_" property="coursesScheduleJson" />
-        <result column="wf_process_id_" property="wfProcessId" />
-        <result column="wf_order_id_" property="wfOrderId" />
+    <resultMap type="com.ym.mec.biz.dal.entity.StudentRegistration" id="StudentRegistration">
+        <result column="id_" property="id"/>
+        <result column="user_id_" property="userId"/>
+        <result column="name_" property="name"/>
+        <result column="music_group_id_" property="musicGroupId"/>
+        <result column="current_grade_" property="currentGrade"/>
+        <result column="current_class_" property="currentClass"/>
+        <result column="subject_id_" property="subjectId"/>
+        <result column="actual_subject_id_" property="actualSubjectId"/>
+        <result column="is_allow_adjust_" property="isAllowAdjust"
+                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="kit_purchase_method_" property="kitPurchaseMethod"
+                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="remark_" property="remark"/>
+        <result column="class_group_id_" property="classGroupId"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="parents_name_" property="parentsName"/>
+        <result column="parents_phone_" property="parentsPhone"/>
+        <result column="parents_company_" property="parentsCompany"/>
+        <result column="payment_status_" property="paymentStatus"
+                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="last_payment_date_" property="lastPaymentDate"/>
+        <result column="next_payment_date_" property="nextPaymentDate"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
-    <select id="get" resultMap="TeacherLeaveRecord">
-		SELECT * FROM
-		teacher_leave_record WHERE id_ = #{id}
-	</select>
+    <select id="get" resultMap="StudentRegistration">
+        SELECT * FROM student_registration WHERE id_ = #{id}
+    </select>
 
     <!-- 全查询 -->
-    <select id="findAll" resultMap="TeacherLeaveRecord">
-		SELECT * FROM
-		teacher_leave_record ORDER BY id_
-	</select>
+    <select id="findAll" resultMap="StudentRegistration">
+        SELECT *
+        FROM student_registration
+        ORDER BY id_
+    </select>
+
 
     <!-- 向数据库增加一条记录 -->
-    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.TeacherLeaveRecord"
-            useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-        <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
-            AS ID FROM DUAL </selectKey> -->
-        INSERT INTO teacher_leave_record
-        (id_,user_id_,days_,leave_category_id_,status_,remark_,create_time_,update_time_,start_time_,end_time_,courses_schedule_json_,wf_process_id_,wf_order_id_)
-        VALUES(#{id},#{userId},#{days},#{leaveCategoryId},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{remark},#{createTime},#{updateTime},#{startTime},#{endTime},#{coursesScheduleJson},#{wfProcessId},#{wfOrderId})
+    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration" useGeneratedKeys="true"
+            keyColumn="id" keyProperty="id">
+        INSERT INTO student_registration
+        (parents_phone_,id_,user_id_,name_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,last_payment_date_,next_payment_date_,actual_subject_id_)
+        VALUES(#{parentsPhone},#{id},#{userId},#{name},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},#{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+        #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate},#{subjectId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
-    <update id="update" parameterType="com.ym.mec.biz.dal.entity.TeacherLeaveRecord">
-        UPDATE teacher_leave_record
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
+        UPDATE student_registration
         <set>
-            <if test="status != null">
-                status_ = #{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            <if test="parentsPhone != null">
+                parents_phone_ = #{parentsPhone},
             </if>
-            <if test="wfOrderId != null">
-                wf_order_id_ = #{wfOrderId},
+            <if test="subjectId != null">
+                subject_id_ = #{subjectId},
             </if>
-            <if test="id != null">
-                id_ = #{id},
+            <if test="nextPaymentDate != null">
+                next_payment_date_ = #{nextPaymentDate},
             </if>
-            <if test="days != null">
-                days_ = #{days},
+            <if test="currentGrade != null">
+                current_grade_ = #{currentGrade},
             </if>
-            <if test="endTime != null">
-                end_time_ = #{endTime},
+            <if test="lastPaymentDate != null">
+                last_payment_date_ = #{lastPaymentDate},
             </if>
-            <if test="createTime != null">
-                create_time_ = #{createTime},
+            <if test="currentClass != null">
+                current_class_ = #{currentClass},
             </if>
-            <if test="startTime != null">
-                start_time_ = #{startTime},
+            <if test="isAllowAdjust != null">
+                is_allow_adjust_ = #{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
-            <if test="coursesScheduleJson != null">
-                courses_schedule_json_ = #{coursesScheduleJson},
+            <if test="kitPurchaseMethod != null">
+                kit_purchase_method_ = #{kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
             <if test="userId != null">
                 user_id_ = #{userId},
             </if>
+            <if test="name != null">
+                name_ = #{name},
+            </if>
             <if test="remark != null">
                 remark_ = #{remark},
             </if>
-            <if test="wfProcessId != null">
-                wf_process_id_ = #{wfProcessId},
+            <if test="paymentStatus != null">
+                payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="parentsName != null">
+                parents_name_ = #{parentsName},
             </if>
             <if test="updateTime != null">
                 update_time_ = #{updateTime},
             </if>
-            <if test="leaveCategoryId != null">
-                leave_category_id_ = #{leaveCategoryId},
+            <if test="parentsCompany != null">
+                parents_company_ = #{parentsCompany},
+            </if>
+            <if test="musicGroupId != null">
+                music_group_id_ = #{musicGroupId},
+            </if>
+            <if test="actualSubjectId != null">
+                actual_subject_id_ = #{actualSubjectId},
             </if>
         </set>
         WHERE id_ = #{id}
@@ -90,20 +115,105 @@
 
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
-		DELETE FROM teacher_leave_record WHERE id_ =
-		#{id}
-	</delete>
+        DELETE FROM student_registration WHERE id_ = #{id}
+    </delete>
+
+    <sql id="queryPageSql">
+        <where>
+            <if test="isAllowAdjust != null">
+                AND is_allow_adjust_ = #{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="subjectId != null">
+                AND subject_id_ = #{subjectId}
+            </if>
+        </where>
+    </sql>
 
     <!-- 分页查询 -->
-    <select id="queryPage" resultMap="TeacherLeaveRecord"
-            parameterType="map">
-        SELECT * FROM teacher_leave_record ORDER BY id_
-        <include refid="global.limit" />
+    <select id="queryPage" resultMap="StudentRegistration" parameterType="map">
+        SELECT * FROM student_registration ORDER BY id_
+        <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM
-		teacher_leave_record
-	</select>
+        SELECT COUNT(*)
+        FROM student_registration
+    </select>
+
+
+    <sql id="queryStudentDetailPageSql">
+        <where>
+            <if test="musicGroupId != null">
+                sr.music_group_id_ = #{musicGroupId}
+            </if>
+            <if test="subjectId != null">
+                sr.subject_id_ = #{subjectId}
+            </if>
+            <if test="isAllowAdjust != null">
+                sr.is_allow_adjust_ = #{isAllowAdjust}
+            </if>
+            <if test="actualSubjectId != null">
+                sr.actual_subject_id_ = #{actualSubjectId}
+            </if>
+        </where>
+    </sql>
+
+    <resultMap type="com.ym.mec.biz.dal.dto.StudentApplyDetailDto" id="studentApplyDetail">
+        <result column="current_grade_" property="currentGrade"/>
+        <result column="current_class_" property="currentClass"/>
+        <result column="is_allow_adjust_" property="isAllowAdjust"
+                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="parents_name_" property="parentsName"/>
+        <result column="parents_phone_" property="parentsPhone"/>
+        <result column="subject_name_" property="subjectName"/>
+        <result column="username_" property="studentName"/>
+        <result column="actual_subject_name_" property="actualSubjectName"/>
+        <result column="gender_" property="gender" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+    </resultMap>
+    <select id="queryStudentDetailPage" resultMap="studentApplyDetail">
+        SELECT su.username_,sr.parents_name_,sr.current_class_,sr.current_grade_,
+        su.gender_,sr.is_allow_adjust_, s.name_ subject_name_,ss.name_ actual_subject_name_,sr.parents_phone_
+        FROM student_registration sr
+        LEFT JOIN sys_user su ON sr.subject_id_ = su.id_
+        LEFT JOIN `subject` s ON sr.subject_id_ = s.id_
+        LEFT JOIN `subject` ss ON sr.actual_subject_id_ = ss.id_
+        <include refid="queryStudentDetailPageSql"/>
+        <include refid="global.limit"/>
+    </select>
+    <select id="queryStudentDetailCount" resultType="java.lang.Integer">
+        SELECT COUNT(sr.id_) FROM student_registration sr
+        <include refid="queryStudentDetailPageSql"/>
+    </select>
+
+    <select id="countPayNum" resultType="java.lang.Integer">
+        SELECT COUNT(DISTINCT user_id_) FROM student_registration
+        WHERE music_group_id_ = #{musicGroupId} AND subject_id_ = #{subjectId} AND payment_status_ = 1
+    </select>
+
+    <resultMap id="queryFeeDetailMap" type="com.ym.mec.biz.dal.dto.StudentFeeDto">
+        <result column="deposit_fee_" property="depositFee"/>
+        <result column="course_fee_" property="courseFee"/>
+        <result column="musical_fee_" property="musicalFee"/>
+        <result column="total_amount_" property="totalAmount"/>
+    </resultMap>
+    <select id="queryFeeDetail" resultMap="queryFeeDetailMap">
+
+    </select>
+
+    <!-- 根据乐团和声部获取未分班的学生 -->
+    <select id="getNoClassStuBySubjectId" resultMap="StudentRegistration">
+        SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND actual_subject_id_ =
+        #{actualSubjectId} AND class_group_id_ >=1
+    </select>
+
+    <!-- 根据乐团和声部获取未分班人数 -->
+    <select id="getNoClassStuCountBySubjectId" resultType="java.lang.Integer">
+        SELECT count(*) FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND actual_subject_id_ =
+        #{actualSubjectId} AND class_group_id_ >=1
+    </select>
+
+    <update id="updateByUserIdAndMusicGroupId" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
+        UPDATE student_registration SET class_group_id_ = #{classGroupId} WHERE user_id_ = #{userId} AND music_group_id_ = #{musicGroupId}
+    </update>
 </mapper>

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

@@ -25,6 +25,9 @@
         <result column="id_card_no_" property="idCardNo"/>
         <result column="real_name_" property="realName"/>
     </resultMap>
+    <delete id="del">
+        UPDATE sys_user_bank_card SET status_ = 0 WHERE id_ = #{id} AND user_id_ = #{userId}
+    </delete>
 
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="SysUserBankCard">

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/StudentDemoGroupController.java

@@ -37,7 +37,7 @@ public class StudentDemoGroupController extends BaseController {
 
     @ApiOperation(value = "试听课列表获取")
     @PostMapping("/queryStudentDemoGroups")
-    public Object queryStudentDemoGroups(@RequestBody StudentDemoGroupQueryInfo queryInfo){
+    public Object queryStudentDemoGroups(StudentDemoGroupQueryInfo queryInfo){
         return succeed(demoGroupService.queryStudentDemoGroups(queryInfo));
     }
 

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/controller/GoodsController.java

@@ -66,8 +66,8 @@ public class GoodsController extends BaseController {
     @ApiOperation(value = "通过科目编号、商品分类 查询商品(教材、辅件)列表")
     @GetMapping("/queryGoodsBySubId")
     @ApiImplicitParams({ @ApiImplicitParam(name = "subjectId", value = "科目编号", required = true, dataType = "Integer"),
-            @ApiImplicitParam(name = "goodsCategoryId", value = "商品分类", required = true, dataType = "Integer")})
-    public Object findGoodsBySubId(@RequestAttribute Integer subjectId,@RequestAttribute Integer goodsCategoryId){
-        return succeed(goodsService.findGoodsBySubId(subjectId,goodsCategoryId));
+            @ApiImplicitParam(name = "type", value = "INSTRUMENT 乐器, ACCESSORIES 教辅", required = true, dataType = "String")})
+    public Object findGoodsBySubId(Integer subjectId,String type){
+        return succeed(goodsService.findGoodsBySubId(subjectId,type));
     }
 }

+ 5 - 1
mec-web/src/main/java/com/ym/mec/web/controller/SysUserBankCardController.java

@@ -41,7 +41,11 @@ public class SysUserBankCardController extends BaseController {
     @ApiOperation(value = "删除银行卡信息")
     @PostMapping("/del")
     public Object del(Long id) {
-        sysUserBankCardService.delete(id);
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser != null && sysUser.getId() != null){
+            return failed("获取用户信息失败");
+        }
+        sysUserBankCardService.del(id,sysUser.getId());
         return succeed();
     }