|
@@ -132,7 +132,7 @@
|
|
|
</update>
|
|
|
|
|
|
<update id="updateUserSub">
|
|
|
- UPDATE apply_info SET sub_id_ = #{subId},course_id_ = #{courseId},update_time_ = #{updateTime} WHERE id_ = ${userId}
|
|
|
+ UPDATE apply_info SET sub_id_ = #{subId},course_id_ = #{courseId},update_time_ = #{updateTime} WHERE id_ = ${userId} AND status_ = 1
|
|
|
</update>
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
@@ -184,23 +184,9 @@
|
|
|
|
|
|
<select id="queryUserPage" resultMap="ApplyInfoPage" parameterType="map">
|
|
|
SELECT ao.*,cgi.sub_name_ sub_name_ FROM (SELECT ai.*,o.amount amount_ FROM apply_info ai
|
|
|
- LEFT JOIN `order` o ON ai.id_ = o.user_id
|
|
|
- <where>
|
|
|
- o.tui_fee IS NOT NULL AND o.`status` = 2
|
|
|
- <if test="musicTeamId != null">
|
|
|
- AND ai.class_id_ = #{musicTeamId}
|
|
|
- </if>
|
|
|
- <if test="name != null and name != ''">
|
|
|
- AND ai.name_ = #{name}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- AND ai.status_ = #{status}
|
|
|
- </if>
|
|
|
- <if test="subId != null">
|
|
|
- AND ai.sub_id_ = #{subId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ) ao LEFT JOIN course_group_info cgi ON ao.course_id_ = cgi.id_
|
|
|
+ LEFT JOIN (SELECT * FROM `order` WHERE id IN (SELECT DISTINCT(user_id) FROM `order` WHERE class_id = #{musicTeamId})) o
|
|
|
+ ON ai.id_ = o.user_id <include refid="studentsPage"/>) ao
|
|
|
+ LEFT JOIN course_group_info cgi ON ao.course_id_ = cgi.id_
|
|
|
ORDER BY ao.update_time_ DESC
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
@@ -209,21 +195,7 @@
|
|
|
SELECT count(DISTINCT ai.id_) FROM apply_info ai
|
|
|
LEFT JOIN course_group_info cgi ON ai.sub_id_ = cgi.sub_id_
|
|
|
LEFT JOIN `order` o ON ai.id_ = o.user_id
|
|
|
- <where>
|
|
|
- AND o.tui_fee IS NOT NULL AND o.`status` = 2
|
|
|
- <if test="musicTeamId != null">
|
|
|
- AND ai.class_id_ = #{musicTeamId}
|
|
|
- </if>
|
|
|
- <if test="name != null and name != ''">
|
|
|
- AND ai.name_ = #{name}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- AND ai.status_ = #{status}
|
|
|
- </if>
|
|
|
- <if test="subId != null">
|
|
|
- AND ai.sub_id_ = #{subId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ <include refid="studentsPage"/>
|
|
|
</select>
|
|
|
|
|
|
<select id="findByUserId" resultMap="ApplyInfo">
|