MediaMapper.xml
3.2 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?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.hui.iqiyi.mapper.MediaMapper">
<select id="selectAllIqIy" resultType="com.hui.iqiyi.entity.Media" parameterType="com.hui.iqiyi.request.MediaRequest">
select im.*
from iqiyi_media as im
left join iqiyi_program as ip on im.id =ip.iqiyi_content_id
LEFT JOIN iqiyi_movie as i on ip.id=i.iqiyi_program_id
where 1=1
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="cid != null and cid != ''">
and cid = #{cid}
</if>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="name!= null and name!= ''">
AND name = #{name}
</if>
<if test="cname!= null and cname!= ''">
AND cname = #{cname}
</if>
<if test="beginTime != null">
and create_time >= #{beginTime}
</if>
<if test="EndTime != null">
and create_time <= #{EndTime}
</if>
<if test="score != null">
and score = #{score}
</if>
<if test="platformInfo != null">
and platform_info = #{platformInfo}
</if>
<if test="follow != null">
and platform_info is not null
</if>
<if test="downloadStatus !=null" >
and local_status=#{downloadStatus}
</if>
ORDER BY create_time desc
</select>
<select id="selectAllfollow" resultType="com.hui.iqiyi.entity.Media">
select * from iqiyi_media as a
LEFT JOIN iqiyi_program as c on a.id =c.iqiyi_content_id
LEFT JOIN iqiyi_movie as d on d.iqiyi_program_id=c.id
<where>
1=1
<if test="platformInfo!=null">
and a.platform_info=#{platformInfo}
</if>
</where>
ORDER BY a.update_time
</select>
<!-- <select id="selectAllIqIy" resultType="com.hui.iqiyi.entity.Media" parameterType="com.hui.iqiyi.request.MediaRequest">-->
<!-- select im.*-->
<!-- from iqiyi_media as im-->
<!-- where 1=1-->
<!-- <if test="param2.type != null and param2.type != ''">-->
<!-- and type = #{param2.type}-->
<!-- </if>-->
<!-- <if test="param2.name!= null and param2.name!= ''">-->
<!-- AND name = #{param2.name}-->
<!-- </if>-->
<!-- <if test="param2.cname!= null and param2.cname!= ''">-->
<!-- AND cname = #{param2.cname}-->
<!-- </if>-->
<!-- <if test="param2.beginTime != null">-->
<!-- and create_time >= #{param2.beginTime}-->
<!-- </if>-->
<!-- <if test="param2.EndTime != null">-->
<!-- and create_time <= #{param2.EndTime}-->
<!-- </if>-->
<!-- <if test="param2.score != null">-->
<!-- and score = #{param2.score}-->
<!-- </if>-->
<!-- <if test="param2.platform_info != null">-->
<!-- and platform_info = #{param2.platform_info}-->
<!-- </if>-->
<!-- ORDER BY create_time-->
<!-- </select>-->
</mapper>