IconZipMapper.xml
3.57 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
<?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.yohobuy.platform.dal.cms.IIconZipDao" >
<resultMap id="BaseResultMap" type="com.yohobuy.platform.dal.cms.model.IconZip" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="zip" property="zip" jdbcType="VARCHAR" />
<result column="platform" property="platform" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="TINYINT" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, zip, platform, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from icon_zip
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from icon_zip
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yohobuy.platform.dal.cms.model.IconZip" useGeneratedKeys="true" keyProperty="id">
insert into icon_zip (id, zip, platform, status, create_time)
values (#{id,jdbcType=INTEGER}, #{zip,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR},
#{status,jdbcType=TINYINT}, UNIX_TIMESTAMP())
</insert>
<insert id="insertSelective" parameterType="com.yohobuy.platform.dal.cms.model.IconZip" useGeneratedKeys="true" keyProperty="id">
insert into icon_zip
<trim prefix="(" suffix=")" suffixOverrides="," >
id,
<if test="zip != null" >
zip,
</if>
<if test="platform != null" >
platform,
</if>
<if test="status != null" >
status,
</if>
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
#{id,jdbcType=INTEGER},
<if test="zip != null" >
#{zip,jdbcType=VARCHAR},
</if>
<if test="platform != null" >
#{platform,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
UNIX_TIMESTAMP()
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.cms.model.IconZip" >
update icon_zip
<set >
<if test="zip != null" >
zip = #{zip,jdbcType=VARCHAR},
</if>
<if test="platform != null" >
platform = #{platform,jdbcType=VARCHAR},
</if>
<if test="status != null" >
status = #{status,jdbcType=TINYINT},
</if>
update_time = UNIX_TIMESTAMP()
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yohobuy.platform.dal.cms.model.IconZip" >
update icon_zip
set zip = #{zip,jdbcType=VARCHAR},
platform = #{platform,jdbcType=VARCHAR},
status = #{status,jdbcType=TINYINT},
update_time = UNIX_TIMESTAMP()
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectSelective" resultMap="BaseResultMap" parameterType="com.yohobuy.platform.dal.cms.model.IconZip" >
select
<include refid="Base_Column_List" />
from icon_zip
<trim prefix="where" prefixOverrides="and | or">
<if test="platform != null" >
and platform = #{platform}
</if>
<if test="status != null and (status == 1 || status == 0)" >
and status = #{status}
</if>
</trim>
</select>
</mapper>