AppActiveMapper.xml
3.81 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?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.IAppActiveDAO" >
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.AppActive" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="DATE_ID" property="dateId" jdbcType="INTEGER" />
<result column="APP_ACTIVE" property="appActive" jdbcType="INTEGER" />
<result column="app_key" property="appKey" jdbcType="VARCHAR" />
<result column="NEW_UDID" property="newUdid" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
ID, DATE_ID, APP_ACTIVE, app_key, NEW_UDID
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from APP_ACTIVE
where ID = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from APP_ACTIVE
where ID = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.unions.dal.model.AppActive" >
insert into APP_ACTIVE (ID, DATE_ID, APP_ACTIVE,
app_key, NEW_UDID)
values (#{id,jdbcType=INTEGER}, #{dateId,jdbcType=INTEGER}, #{appActive,jdbcType=INTEGER},
#{appKey,jdbcType=VARCHAR}, #{newUdid,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yoho.unions.dal.model.AppActive" >
insert into APP_ACTIVE
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
ID,
</if>
<if test="dateId != null" >
DATE_ID,
</if>
<if test="appActive != null" >
APP_ACTIVE,
</if>
<if test="appKey != null" >
app_key,
</if>
<if test="newUdid != null" >
NEW_UDID,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="dateId != null" >
#{dateId,jdbcType=INTEGER},
</if>
<if test="appActive != null" >
#{appActive,jdbcType=INTEGER},
</if>
<if test="appKey != null" >
#{appKey,jdbcType=VARCHAR},
</if>
<if test="newUdid != null" >
#{newUdid,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.unions.dal.model.AppActive" >
update APP_ACTIVE
<set >
<if test="dateId != null" >
DATE_ID = #{dateId,jdbcType=INTEGER},
</if>
<if test="appActive != null" >
APP_ACTIVE = #{appActive,jdbcType=INTEGER},
</if>
<if test="appKey != null" >
app_key = #{appKey,jdbcType=VARCHAR},
</if>
<if test="newUdid != null" >
NEW_UDID = #{newUdid,jdbcType=INTEGER},
</if>
</set>
where ID = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.AppActive" >
update APP_ACTIVE
set DATE_ID = #{dateId,jdbcType=INTEGER},
APP_ACTIVE = #{appActive,jdbcType=INTEGER},
app_key = #{appKey,jdbcType=VARCHAR},
NEW_UDID = #{newUdid,jdbcType=INTEGER}
where ID = #{id,jdbcType=INTEGER}
</update>
<select id="selectActivationAndActualCostByDateId" parameterType="java.util.Map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from APP_ACTIVE
<include refid="WHERE_CONDITION"/>
</select>
<sql id="WHERE_CONDITION">
<trim prefix="where" prefixOverrides="and | or">
<if test="params.beginTime != null and params.beginTime != ''"><![CDATA[ and DATE_ID>=#{params.beginTime}]]></if>
<if test="params.endTime != null and params.endTime != ''"><![CDATA[ and DATE_ID<=#{params.endTime}]]></if>
</trim>
</sql>
</mapper>