UnionClickCountDayMapper.xml
2.78 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
<?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.yoho.unions.dal.UnionClickCountDayMapper">
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.UnionClickCountDay">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="day_id" jdbcType="VARCHAR" property="dayId" />
<result column="union_type" jdbcType="VARCHAR" property="unionType" />
<result column="client_type" jdbcType="INTEGER" property="clientType" />
<result column="num" jdbcType="INTEGER" property="num" />
<result column="comb" jdbcType="VARCHAR" property="comb" />
<result column="create_time" jdbcType="INTEGER" property="createTime" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from union_click_count_day
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.unions.dal.model.UnionClickCountDay">
insert into union_click_count_day (id, day_id, union_type,
client_type, num, comb,
create_time)
values (#{id,jdbcType=INTEGER}, #{dayId,jdbcType=VARCHAR}, #{unionType,jdbcType=VARCHAR},
#{clientType,jdbcType=INTEGER}, #{num,jdbcType=INTEGER}, #{comb,jdbcType=VARCHAR},
#{createTime,jdbcType=INTEGER})
</insert>
<update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.UnionClickCountDay">
update union_click_count_day
set day_id = #{dayId,jdbcType=VARCHAR},
union_type = #{unionType,jdbcType=VARCHAR},
client_type = #{clientType,jdbcType=INTEGER},
num = #{num,jdbcType=INTEGER},
comb = #{comb,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select id, day_id, union_type, client_type, num, comb, create_time
from union_click_count_day
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select id, day_id, union_type, client_type, num, comb, create_time
from union_click_count_day
</select>
<delete id="deleteCountInfoByTime">
delete
from union_click_count_day
where
create_time >= #{beginTime,jdbcType=INTEGER}
and create_time < #{endTime,jdbcType=INTEGER}
</delete>
<select id="selectCount" resultType="java.lang.Integer">
select case when sum(num) is null then 0 else sum(num) end from union_click_count_day
where union_type = #{unionType,jdbcType=VARCHAR} and client_type = #{clientType,jdbcType=INTEGER} and
day_id >= #{start,jdbcType=VARCHAR} and day_id <= #{end,jdbcType=VARCHAR}
</select>
</mapper>