ContentMapper.xml
3.28 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
93
94
95
<?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.ContentMapper">
<update id="updateContent" parameterType="com.hui.iqiyi.entity.Content">
update iqiyi_content
<include refid="Set_Cloumn"></include>
<include refid="Where_Cloumn"> </include>
</update>
<select id="selectAllSingle" resultType="com.hui.iqiyi.entity.Content">
select b.*,c.bitrate,c.local_path from iqiyi_content as a
LEFT JOIN iqiyi_program as b on a.id =b.iqiyi_content_id
LEFT JOIN iqiyi_movie as c on b.id=c.iqiyi_program_id
<where>
<if test="param1.SeriesFlag !=null and param1.SeriesFlag !='' ">
series_flag=1
</if>
<if test="param2 !=null and param2 !='' ">
a.id=#{param2}
</if>
</where>
</select>
<select id="selectAllType" resultType="com.hui.iqiyi.response.ContentResponse" parameterType="com.hui.iqiyi.response.ContentResponse">
select contentType,cname,count(id) as num from (
select cname,'1' as contentType,id from iqiyi_content
union select cname, '0' as contentType,id from iqiyi_program where series_flag = 0 ) as m
group by contentType,cname order by contentType,cname
</select>
<select id="selectAllCont" resultType="java.lang.Integer">
select count(1) from iqiyi_content where platform_info like '%1%'
union
select count(1) from iqiyi_program where series_flag = 0 and platform_info like '%1%'
</select>
<select id="selectAllContenten" resultType="com.hui.iqiyi.entity.Content" parameterType="com.hui.iqiyi.request.ContentRequest">
select a.*
from iqiyi_content as a
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="name!= null and name!= ''">
AND name like #{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="downloadStatus !=null" >
and local_status=#{downloadStatus}
</if>
ORDER BY create_time desc
</select>
<sql id="Where_Cloumn">
<where>
<if test="id != null and id != ''">
id = #{id}
</if>
<if test="ContentIdList != null">
id in
<foreach collection="ContentIdList" index="i" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</sql>
<sql id="Set_Cloumn">
<set>
<if test="platformInfo != null" >
platform_info = #{platformInfo},
</if>
</set>
</sql>
</mapper>