VodSubjectTreeMappingMapper.xml
2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?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.meishu.mapper.VodSubjectTreeMappingMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.meishu.model.VodSubjectTreeMappingDO">
<id column="id" property="id" />
<result column="create_date" property="createTime" />
<result column="update_date" property="updateTime" />
<result column="delete_date" property="deleteTime" />
<result column="vod_id" property="vodId" />
<result column="tree_id" property="treeId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, vod_id, tree_id
</sql>
<select id="getAllNoAuthenVods" resultType="com.meishu.vo.subject.GetAllNoAuthenVodsVO">
SELECT
t2.id,
t2.vod_name,
t2.vod_type,
t3.user_name,
t2.update_date
FROM
vod_subject_tree_mapping t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
LEFT JOIN administer t3 ON t2.administer_id = t3.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.tree_id = #{treeId}
<if test="vodType!=null amd vodType =''">
AND t2.vod_type = #{vodType}
</if>
AND t2.STATUS = #{status}
</select>
<select id="getTreeVodCount" resultType="integer">
SELECT
count(1)
FROM
vod_related t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
<if test="treeId !=null and treeId !=''">
AND t.tree_id = #{treeId}
</if>
<if test="userId !=null and userId !=''">
AND t2.teacher_id = #{userId}
</if>
<if test="shareStatus !=null and shareStatus !=''">
AND t2.share_status = #{shareStatus}
</if>
<if test="subject!=null and subject !=''">
AND t2.subject = #{subject}
</if>
<if test="checkStatus==2">
AND t2.check_status = 2
</if>
<if test="checkStatus==1">
AND (t2.check_status = 1 or t2.check_status = 3 )
</if>
</select>
</mapper>