Commit 3eec852f authored by YangZhaoJun1's avatar YangZhaoJun1

xml

parent e54ee9e3
...@@ -33,4 +33,34 @@ ...@@ -33,4 +33,34 @@
<result column="class_name" property="className"></result> <result column="class_name" property="className"></result>
<result column="chapter_name" property="chapterName"></result> <result column="chapter_name" property="chapterName"></result>
</resultMap> </resultMap>
<resultMap id="SupperStudentChildListResultMap" type="org.rcisoft.business.bchapter.entity.BChapter" extends="BaseResultMap">
<association column="{studentId=stuId,paId=business_id}" property="childList" select="queryBChaptersByPidAndUserId">
</association>
</resultMap>
<select id="queryBChaptersByPidAndUserId" parameterType="java.util.Map" resultMap="SupperStudentChildListResultMap">
SELECT
bc.*,
#{studentId} AS stuId,
bf.video_url AS videoUrl,
bf.file_url AS fileUrl,
bf.ppt_url AS pptUrl,
bf.pdf_url AS pdfUrl,
IFNULL((select is_complete from b_r_student_chapter brs
LEFT JOIN b_student bs on brs.student_id = bs.business_id
LEFT JOIN s_user su on bs.`code` = su.login_name
WHERE brs.chapter_id = bc.business_id AND su.business_id = #{studentId}),0) as isComplete,
(SELECT count(*) FROM b_r_student_chapter brs WHERE brs.chapter_id = bc.business_id AND brs.score = - 1) AS studentNum
FROM
b_chapter bc
LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id
WHERE
bc.del_flag = 0
AND bc.pid = #{paId}
ORDER BY
bc.sort asc
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment