IconSettingMapper.xml
4.89 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?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.IIconSettingDao" >
<resultMap id="BaseResultMap" type="com.yohobuy.platform.dal.cms.model.IconSetting" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="ico_name" property="icoName" jdbcType="VARCHAR" />
<result column="default_ico" property="defaultIco" jdbcType="VARCHAR" />
<result column="ico" property="ico" jdbcType="VARCHAR" />
<result column="type" property="type" jdbcType="TINYINT" />
<result column="ico_key" property="icoKey" 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, ico_name, default_ico, ico, type, ico_key, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from icon_setting
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from icon_setting
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yohobuy.platform.dal.cms.model.IconSetting" useGeneratedKeys="true" keyProperty="id" >
insert into icon_setting (id, ico_name, default_ico, ico, type, ico_key, status, create_time)
values (#{id,jdbcType=INTEGER}, #{icoName,jdbcType=VARCHAR}, #{defaultIco,jdbcType=VARCHAR},
#{ico,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{icoKey,jdbcType=VARCHAR},
#{status,jdbcType=TINYINT}, UNIX_TIMESTAMP()
)
</insert>
<insert id="insertSelective" parameterType="com.yohobuy.platform.dal.cms.model.IconSetting" useGeneratedKeys="true" keyProperty="id" >
insert into icon_setting
<trim prefix="(" suffix=")" suffixOverrides="," >
id,
<if test="icoName != null" >
ico_name,
</if>
<if test="defaultIco != null" >
default_ico,
</if>
<if test="ico != null" >
ico,
</if>
<if test="type != null" >
type,
</if>
<if test="icoKey != null" >
ico_key,
</if>
<if test="status != null" >
status,
</if>
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
#{id,jdbcType=INTEGER},
<if test="icoName != null" >
#{icoName,jdbcType=VARCHAR},
</if>
<if test="defaultIco != null" >
#{defaultIco,jdbcType=VARCHAR},
</if>
<if test="ico != null" >
#{ico,jdbcType=VARCHAR},
</if>
<if test="type != null" >
#{type,jdbcType=TINYINT},
</if>
<if test="icoKey != null" >
#{icoKey,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.IconSetting" >
update icon_setting
<set >
<if test="icoName != null" >
ico_name = #{icoName,jdbcType=VARCHAR},
</if>
<if test="defaultIco != null" >
default_ico = #{defaultIco,jdbcType=VARCHAR},
</if>
<if test="ico != null" >
ico = #{ico,jdbcType=VARCHAR},
</if>
<if test="type != null" >
type = #{type,jdbcType=TINYINT},
</if>
<if test="icoKey != null" >
ico_key = #{icoKey,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.IconSetting" >
update icon_setting
set ico_name = #{icoName,jdbcType=VARCHAR},
default_ico = #{defaultIco,jdbcType=VARCHAR},
ico = #{ico,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
ico_key = #{icoKey,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.IconSetting" >
select
<include refid="Base_Column_List" />
from icon_setting
<trim prefix="where" prefixOverrides="and | or">
<if test="type != null" >
and type = #{type}
</if>
<if test="status != null and (status == 1 || status == 0)" >
and status = #{status}
</if>
<if test="icoName != null" >
and ico_name like CONCAT('%',#{icoName},'%')
</if>
</trim>
</select>
</mapper>