3.4 クエリ映像情報
3.4.1 ニーズ分析の
レッスンプランは、ページ内に保存された映像情報、解決のレッスンプランのページを表示するには、このセクションの情報に関連付けられたメディア情報を表示することはできません。
ソリューション:
クエリ、およびフロントエンドの表示と一緒にメディア資産情報に関連した授業計画ツリーのノード情報を、取得すると、表示領域次の図は、レッスンプランを示しています。
3.4.2ダオは、
レッスンプランクエリ変更ダオ:
1のモデルを変更するには、
授業計画の結果情報のメディア首都に情報を追加します
@Data
@ToString
public class TeachplanNode extends Teachplan {
List<TeachplanNode> children;
//媒资信息
private String mediaId;
private String mediaFileOriginalName;
}
2 、変更のSQL クエリ情報に関連付けられたメディア情報を追加し、ステートメントを
追加するMEDIAIDを、mediaFileOriginalName
<resultMap type="com.xuecheng.framework.domain.course.ext.TeachplanNode" id="teachplanMap" >
<id property="id" column="one_id"/>
<result property="pname" column="one_name"/>
<result property="grade" column="one_grade"/>
<collection property="children"
ofType="com.xuecheng.framework.domain.course.ext.TeachplanNode">
<id property="id" column="two_id"/>
<result property="pname" column="two_name"/>
<result property="grade" column="two_grade"/>
<collection property="children"
ofType="com.xuecheng.framework.domain.course.ext.TeachplanNode">
<id property="id" column="three_id"/>
<result property="pname" column="three_name"/>
<result property="grade" column="three_grade"/>
<result property="mediaId" column="mediaId"/>
<result property="mediaFileOriginalName" column="mediaFileOriginalName"/>
</collection>
</collection>
</resultMap>
<select id="selectList" resultMap="teachplanMap" parameterType="java.lang.String" >
SELECT
a.id one_id,
a.pname one_name,
a.grade one_grade,
a.orderby one_orderby,
b.id two_id,
b.pname two_name,
b.grade two_grade,
b.orderby two_orderby,
c.id three_id,
c.pname three_name,
c.grade three_grade,
c.orderby three_orderby,
media.media_id mediaId,
media.media_fileoriginalname mediaFileOriginalName
FROM
teachplan a LEFT JOIN teachplan b
ON a.id = b.parentid
LEFT JOIN teachplan c
ON b.id = c.parentid
LEFT JOIN teachplan_media media
ON c.id = media.teachplan_id
WHERE a.parentid = '0'
<if test="_parameter!=null and _parameter!=''">
and a.courseid=#{courseId}
</if>
ORDER BY a.orderby,
b.orderby,
c.orderby
</select>
3.4.3 ページ問合せ映像
授業計画ノード情報に含まメディアリソース情報は、情報を取得するためにページ上に表示することができます。
<el‐button style="font‐size: 12px;" type="text" on‐click={ () => this.querymedia(data.id) }>
{data.mediaFileOriginalName} 选择视频</el‐button>
:結果は以下のようにしている
の提出が成功した後のリフレッシュ授業計画ツリーをすぐにビデオを選択した後、クエリプランコースコードを追加します。this.fifindTeachplan()以下のように、完全なコードは次のようになります。
choosemedia(mediaId,fileOriginalName,mediaUrl){
this.mediaFormVisible = false;
//保存课程计划与视频对应关系
let teachplanMedia = {};
teachplanMedia.teachplanId = this.activeTeachplanId;
teachplanMedia.mediaId = mediaId;
teachplanMedia.mediaFileOriginalName = fileOriginalName;
teachplanMedia.mediaUrl = mediaUrl;
teachplanMedia.courseId = this.courseid;
//保存媒资信息到课程数据库
courseApi.savemedia(teachplanMedia).then(res=>{
if(res.success){
this.$message.success("选择视频成功")
//查询课程计划
this.findTeachplan()
}else{
this.$message.error(res.message)
}
})
},