MovieMapper.xml
2.22 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
<?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.MovieMapper">
<update id="updateMoviePriority" parameterType="com.hui.iqiyi.request.MovieRequest">
update iqiyi_movie as im,(
select id
from iqiyi_program
<where>
<if test="contentId != null and contentId != ''">
iqiyi_content_id = #{contentId}
</if>
<if test="contentIdList != null">
iqiyi_content_id in
<foreach collection="contentIdList" index="i" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
) as ip
set priority = #{priority}
where im.iqiyi_program_id = ip.id
</update>
<select id="selectAllPopulation" resultType="com.hui.iqiyi.entity.Movie" parameterType="com.hui.iqiyi.entity.Movie">
select local_status, count(1) as'number',sum(file_size)/1024/1024/1024 as'capacity', sum(duration)/60/60 as'duration'
from iqiyi_movie where local_status >= 0
GROUP BY local_status;
</select>
<select id="selectAllSevenxz" resultType="com.hui.iqiyi.response.MovieResponse" parameterType="com.hui.iqiyi.request.ProRequest">
SELECT DATE_FORMAT(p.update_time,"%Y-%m-%d")as day1 ,count(p.id) as TotlFee3 ,
sum(m.file_size)/1024/1024/1024 as TotlSize2,sum(m.duration)/60/60 as TotlDuration4
FROM iqiyi_program p left join iqiyi_movie m on p.id = m.iqiyi_program_id
<where>
<if test="proRequest.startTime != null">
and UNIX_TIMESTAMP(p.update_time) >= UNIX_TIMESTAMP(#{proRequest.startTime})
</if>
<if test="proRequest.endTime != null">
and UNIX_TIMESTAMP(p.update_time) <= UNIX_TIMESTAMP(#{proRequest.endTime})
</if>
and date_sub(curdate(), interval 7 day) <date(p.update_time)
</where>
GROUP BY DATE_FORMAT(p.update_time,"%Y-%m-%d")
order by DATE_FORMAT(p.update_time,"%Y-%m-%d") desc
</select>
</mapper>