2025-11-27 14:12:51 +08:00
|
|
|
<?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.zcloud.edu.persistence.mapper.VideoCoursewareMapper">
|
2025-11-27 17:51:34 +08:00
|
|
|
|
|
|
|
|
<select id="getInfoById" resultType="com.zcloud.edu.persistence.dataobject.VideoCoursewareDO">
|
|
|
|
|
select
|
2026-01-13 13:38:14 +08:00
|
|
|
a.*,
|
|
|
|
|
b.name as trainingTypeName,
|
|
|
|
|
u.name as teacherName,
|
|
|
|
|
d.corp_name as corpName
|
2025-11-27 17:51:34 +08:00
|
|
|
from video_courseware a
|
2026-01-13 13:38:14 +08:00
|
|
|
left join training_type b on a.training_type_id = b.training_type_id and b.delete_enum = 'FALSE'
|
|
|
|
|
left join teacher t on a.teacher_id = t.teacher_id and t.delete_enum = 'FALSE'
|
|
|
|
|
left join corp_info d on a.corpinfo_id = d.id
|
|
|
|
|
left join user u on u.id = t.user_id
|
2025-11-27 17:51:34 +08:00
|
|
|
where a.id = #{id,jdbcType=BIGINT}
|
2026-01-13 13:38:14 +08:00
|
|
|
and a.delete_enum = 'FALSE'
|
2025-11-27 17:51:34 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getVideoCoursewarePage" resultType="com.zcloud.edu.persistence.dataobject.VideoCoursewareDO">
|
|
|
|
|
select
|
2026-01-13 13:38:14 +08:00
|
|
|
a.*,
|
|
|
|
|
b.name as trainingTypeName,
|
|
|
|
|
u.name as teacherName,
|
|
|
|
|
d.corp_name as corpName,
|
|
|
|
|
count(q.id) as questionCount,
|
|
|
|
|
d.type as corpType
|
2025-11-27 17:51:34 +08:00
|
|
|
from video_courseware a
|
2026-01-13 13:38:14 +08:00
|
|
|
left join training_type b on a.training_type_id = b.training_type_id and b.delete_enum = 'FALSE'
|
|
|
|
|
left join teacher c on a.teacher_id = c.teacher_id and c.delete_enum = 'FALSE'
|
|
|
|
|
left join corp_info d on a.corpinfo_id = d.id
|
|
|
|
|
left join user u on u.id = c.user_id
|
|
|
|
|
left join question q on a.video_courseware_id = q.video_courseware_id and q.delete_enum = 'FALSE' and q.courseware_type=1
|
|
|
|
|
where a.delete_enum = 'FALSE'
|
|
|
|
|
<if test="params.inCorpinfoId != null">
|
|
|
|
|
AND a.corpinfo_id in
|
|
|
|
|
<foreach collection="params.inCorpinfoId" item="corpinfoId" open="(" close=")" separator=",">
|
|
|
|
|
#{corpinfoId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="params.corpinfoId != null">
|
|
|
|
|
AND a.corpinfo_id = #{params.corpinfoId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.coursewareName != null and params.coursewareName!=''">
|
|
|
|
|
AND a.courseware_name = #{params.coursewareName}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.trainingTypeId != null and params.trainingTypeId!='' ">
|
|
|
|
|
AND a.training_type_id = #{params.trainingTypeId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.state != null">
|
|
|
|
|
AND a.state = #{params.state}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group by a.id
|
|
|
|
|
having 1=1
|
|
|
|
|
<if test="params.questionNum != null">
|
|
|
|
|
AND questionCount >= #{params.questionNum}
|
|
|
|
|
</if>
|
|
|
|
|
order by a.create_time desc
|
2025-11-27 17:51:34 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getVideoCoursewareList" resultType="com.zcloud.edu.persistence.dataobject.VideoCoursewareDO">
|
|
|
|
|
select
|
2026-01-13 13:38:14 +08:00
|
|
|
a.*,
|
|
|
|
|
b.name as trainingTypeName,
|
|
|
|
|
u.name as teacherName,
|
2025-11-27 17:51:34 +08:00
|
|
|
d.corp_name as corpName
|
|
|
|
|
from video_courseware a
|
2026-01-13 13:38:14 +08:00
|
|
|
left join training_type b on a.training_type_id = b.training_type_id and b.delete_enum = 'FALSE'
|
|
|
|
|
left join teacher c on a.teacher_id = c.teacher_id and c.delete_enum = 'FALSE'
|
|
|
|
|
left join corp_info d on a.corpinfo_id = d.id
|
|
|
|
|
left join user u on u.id = c.user_id
|
|
|
|
|
|
|
|
|
|
where a.delete_enum = 'FALSE'
|
|
|
|
|
<if test="params.corpinfoId != null">
|
|
|
|
|
AND a.corpinfo_id = #{params.corpinfoId}
|
|
|
|
|
</if>
|
|
|
|
|
order by a.create_time desc
|
2025-11-27 17:51:34 +08:00
|
|
|
</select>
|
|
|
|
|
|
2025-11-27 14:12:51 +08:00
|
|
|
</mapper>
|
|
|
|
|
|