ElbInfoMapper.xml
1.54 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
<?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.monitor.mysql.mapper.ElbInfoMapper" >
<resultMap id="BaseResultMap" type="com.monitor.model.domain.ElbInfo" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="cloudtype" property="cloudType" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="netype" property="netType" jdbcType="VARCHAR" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="ports" property="ports" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, cloudtype, name, netype, address, ports, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') AS createTime
</sql>
<insert id="insert" parameterType="com.monitor.model.domain.ElbInfo" useGeneratedKeys="true" keyProperty="id">
insert into elb_info
(
cloudtype, name, netype, address, ports, create_time
)
values
(
#{cloudType,jdbcType=VARCHAR}, #{name,jdbcType=INTEGER}, #{netType,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{ports,jdbcType=VARCHAR}, now()
)
</insert>
<delete id="deleteAll" parameterType="java.lang.Integer" >
delete from elb_info
</delete>
<select id="getAll" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from elb_info
</select>
</mapper>