Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
mapper fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MGZero committed Sep 4, 2019
1 parent e0f1e87 commit 3b9f8be
Showing 1 changed file with 241 additions and 0 deletions.
241 changes: 241 additions & 0 deletions src/main/resources/dbmappers/HostnameDbObjMapper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
<?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.zfgc.mappers.HostnameDbObjMapper">
<resultMap id="BaseResultMap" type="com.zfgc.dbobj.HostnameDbObj">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
<id column="HOSTNAME_ID" jdbcType="INTEGER" property="hostnameId" />
<result column="HOSTNAME" jdbcType="VARCHAR" property="hostname" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
HOSTNAME_ID, HOSTNAME
</sql>
<select id="selectByExample" parameterType="com.zfgc.dbobj.HostnameDbObjExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from HOSTNAME
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
select
<include refid="Base_Column_List" />
from HOSTNAME
where HOSTNAME_ID = #{hostnameId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
delete from HOSTNAME
where HOSTNAME_ID = #{hostnameId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zfgc.dbobj.HostnameDbObjExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
delete from HOSTNAME
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zfgc.dbobj.HostnameDbObj">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
<selectKey keyProperty="hostnameId" order="BEFORE" resultType="java.lang.Integer">
SELECT COALESCE(MAX(HOSTNAME_ID) + 1,0) FROM HOSTNAME
</selectKey>
insert into HOSTNAME (HOSTNAME_ID, HOSTNAME)
values (#{hostnameId,jdbcType=INTEGER}, #{hostname,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.zfgc.dbobj.HostnameDbObj">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
<selectKey keyProperty="hostnameId" order="BEFORE" resultType="java.lang.Integer">
SELECT COALESCE(MAX(HOSTNAME_ID) + 1,0) FROM HOSTNAME
</selectKey>
insert into HOSTNAME
<trim prefix="(" suffix=")" suffixOverrides=",">
HOSTNAME_ID,
<if test="hostname != null">
HOSTNAME,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{hostnameId,jdbcType=INTEGER},
<if test="hostname != null">
#{hostname,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zfgc.dbobj.HostnameDbObjExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
select count(*) from HOSTNAME
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
update HOSTNAME
<set>
<if test="record.hostnameId != null">
HOSTNAME_ID = #{record.hostnameId,jdbcType=INTEGER},
</if>
<if test="record.hostname != null">
HOSTNAME = #{record.hostname,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
update HOSTNAME
set HOSTNAME_ID = #{record.hostnameId,jdbcType=INTEGER},
HOSTNAME = #{record.hostname,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zfgc.dbobj.HostnameDbObj">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
update HOSTNAME
<set>
<if test="hostname != null">
HOSTNAME = #{hostname,jdbcType=VARCHAR},
</if>
</set>
where HOSTNAME_ID = #{hostnameId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zfgc.dbobj.HostnameDbObj">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Sun Sep 01 18:35:01 EDT 2019.
-->
update HOSTNAME
set HOSTNAME = #{hostname,jdbcType=VARCHAR}
where HOSTNAME_ID = #{hostnameId,jdbcType=INTEGER}
</update>
</mapper>

0 comments on commit 3b9f8be

Please sign in to comment.