ContentMapper.xml
2.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
<?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>
<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>