ShareLogMapper.xml
1.26 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.example.mapper.ShareLogMapper">
<insert id="create">
insert into `t_kmr_share_log` (
`openid`,
`share_time`
)
values(
#{openid},
#{shareTime}
);
</insert>
<select id="countByDay" resultType="long">
select count(*) c
from `t_kmr_share_log`
where share_time BETWEEN #{startDate} and #{endDate}
and openid= #{openid};
</select>
<insert id="saveStat">
insert into `t_kmr_stat_log`(
`openid`
) values (
#{openid}
)
</insert>
<select id="findPVByDay" resultType="int">
SELECT count(*) c FROM `t_kmr_stat_log` where `create_at` BETWEEN #{startDate} and #{endDate};
</select>
<select id="findUVByDay" resultType="int">
SELECT count(DISTINCT `openid` ) c FROM `t_kmr_stat_log` where `create_at` BETWEEN #{startDate} and #{endDate};
</select>
<select id="findShareByDay" resultType="int">
select count(*) c
from `t_kmr_share_log`
where share_time BETWEEN #{startDate} and #{endDate}
</select>
<select id="findImgByDay" resultType="int">
SELECT count(*) c FROM `t_kmr_img_info` where `create_at` BETWEEN #{startDate} and #{endDate};
</select>
</mapper>