ShareLogMapper.xml 1.26 KB
<?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>