parent
5837fb8a65
commit
278c3d3aae
@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.platform.dao.VolumeDao">
|
||||||
|
<resultMap id="getEntityByText" type="com.platform.entities.VolumeInitEntity">
|
||||||
|
<id property="id" column="id" javaType="int" jdbcType="INTEGER" />
|
||||||
|
<result property="name" column="name" javaType="string"
|
||||||
|
jdbcType="VARCHAR" />
|
||||||
|
<result property="ip" column="ip" javaType="string"
|
||||||
|
jdbcType="VARCHAR" />
|
||||||
|
<result property="path" column="path" javaType="string"
|
||||||
|
jdbcType="VARCHAR" />
|
||||||
|
<result property="mark" column="mark" javaType="string"
|
||||||
|
jdbcType="VARCHAR" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 获取数据全部记录信息 -->
|
||||||
|
<select id="findAll" resultType="com.platform.entities.VolumeInitEntity">
|
||||||
|
SELECT
|
||||||
|
id,name,ip,path,mark
|
||||||
|
FROM
|
||||||
|
volume_info
|
||||||
|
ORDER BY id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.platform.entities.VolumeInitEntity">
|
||||||
|
UPDATE
|
||||||
|
volume_info
|
||||||
|
<set >
|
||||||
|
<trim suffixOverrides=",">
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
name= #{name},
|
||||||
|
</if>
|
||||||
|
<if test="ip != null and ip != ''">
|
||||||
|
ip= #{ip},
|
||||||
|
</if>
|
||||||
|
<if test="path != null and path != ''">
|
||||||
|
path= #{path},
|
||||||
|
</if>
|
||||||
|
<if test="mark != null and mark != ''">
|
||||||
|
mark= #{mark},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</set>
|
||||||
|
<where>
|
||||||
|
id = #{id}
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.platform.entities.VolumeInitEntity">
|
||||||
|
INSERT INTO
|
||||||
|
volume_info(
|
||||||
|
<trim suffixOverrides=",">
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
name,
|
||||||
|
</if>
|
||||||
|
<if test="ip != null and ip != ''">
|
||||||
|
ip,
|
||||||
|
</if>
|
||||||
|
<if test="path != null and path != ''">
|
||||||
|
path,
|
||||||
|
</if>
|
||||||
|
<if test="mark != null and mark != ''">
|
||||||
|
mark,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
)
|
||||||
|
VALUES(
|
||||||
|
<trim suffixOverrides=",">
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
#{name},
|
||||||
|
</if>
|
||||||
|
<if test="ip != null and ip != ''">
|
||||||
|
#{ip},
|
||||||
|
</if>
|
||||||
|
<if test="path != null and path != ''">
|
||||||
|
#{path},
|
||||||
|
</if>
|
||||||
|
<if test="mark != null and mark != ''">
|
||||||
|
#{mark},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<delete id="remove" parameterType="java.lang.Integer">
|
||||||
|
DELETE FROM
|
||||||
|
volume_info
|
||||||
|
WHERE
|
||||||
|
id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,86 @@
|
|||||||
|
package com.platform.entities;
|
||||||
|
|
||||||
|
public class VolumeInitEntity {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
private String mark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the id
|
||||||
|
*/
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the id to set
|
||||||
|
*/
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the name
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param name the name to set
|
||||||
|
*/
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ip
|
||||||
|
*/
|
||||||
|
public String getIp() {
|
||||||
|
return ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ip the ip to set
|
||||||
|
*/
|
||||||
|
public void setIp(String ip) {
|
||||||
|
this.ip = ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the path
|
||||||
|
*/
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param path the path to set
|
||||||
|
*/
|
||||||
|
public void setPath(String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the mark
|
||||||
|
*/
|
||||||
|
public String getMark() {
|
||||||
|
return mark;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mark the mark to set
|
||||||
|
*/
|
||||||
|
public void setMark(String mark) {
|
||||||
|
this.mark = mark;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue