pet/com.datang.pet.mapper/target/classes/mapper/PetMapper.xml

323 lines
11 KiB
XML

<?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.datang.pet.mapper.PetMapper">
<resultMap id="BaseResultMap" type="com.datang.pet.pojo.Pet">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="belong_user_id" jdbcType="VARCHAR" property="belongUserId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="gender" jdbcType="CHAR" property="gender" />
<result column="breed" jdbcType="VARCHAR" property="breed" />
<result column="birthday" jdbcType="DATE" property="birthday" />
<result column="staple" jdbcType="VARCHAR" property="staple" />
<result column="snacks" jdbcType="VARCHAR" property="snacks" />
<result column="former_user_id" jdbcType="VARCHAR" property="formerUserId" />
<result column="sequence" jdbcType="INTEGER" property="sequence" />
<result column="pictrue" jdbcType="VARCHAR" property="pictrue" />
<result column="register_date" jdbcType="TIMESTAMP" property="registerDate" />
</resultMap>
<sql id="Example_Where_Clause">
<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">
<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">
id, belong_user_id, name, gender, breed, birthday, staple, snacks, former_user_id,
sequence, pictrue, register_date
</sql>
<select id="selectByExample" parameterType="com.datang.pet.pojo.PetExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from pet
<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.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pet
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from pet
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.datang.pet.pojo.PetExample">
delete from pet
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.datang.pet.pojo.Pet">
insert into pet (id, belong_user_id, name,
gender, breed, birthday,
staple, snacks, former_user_id,
sequence, pictrue, register_date
)
values (#{id,jdbcType=VARCHAR}, #{belongUserId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{gender,jdbcType=CHAR}, #{breed,jdbcType=VARCHAR}, #{birthday,jdbcType=DATE},
#{staple,jdbcType=VARCHAR}, #{snacks,jdbcType=VARCHAR}, #{formerUserId,jdbcType=VARCHAR},
#{sequence,jdbcType=INTEGER}, #{pictrue,jdbcType=VARCHAR}, #{registerDate,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.datang.pet.pojo.Pet">
insert into pet
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="belongUserId != null">
belong_user_id,
</if>
<if test="name != null">
name,
</if>
<if test="gender != null">
gender,
</if>
<if test="breed != null">
breed,
</if>
<if test="birthday != null">
birthday,
</if>
<if test="staple != null">
staple,
</if>
<if test="snacks != null">
snacks,
</if>
<if test="formerUserId != null">
former_user_id,
</if>
<if test="sequence != null">
sequence,
</if>
<if test="pictrue != null">
pictrue,
</if>
<if test="registerDate != null">
register_date,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="belongUserId != null">
#{belongUserId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="gender != null">
#{gender,jdbcType=CHAR},
</if>
<if test="breed != null">
#{breed,jdbcType=VARCHAR},
</if>
<if test="birthday != null">
#{birthday,jdbcType=DATE},
</if>
<if test="staple != null">
#{staple,jdbcType=VARCHAR},
</if>
<if test="snacks != null">
#{snacks,jdbcType=VARCHAR},
</if>
<if test="formerUserId != null">
#{formerUserId,jdbcType=VARCHAR},
</if>
<if test="sequence != null">
#{sequence,jdbcType=INTEGER},
</if>
<if test="pictrue != null">
#{pictrue,jdbcType=VARCHAR},
</if>
<if test="registerDate != null">
#{registerDate,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.datang.pet.pojo.PetExample" resultType="java.lang.Long">
select count(*) from pet
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update pet
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.belongUserId != null">
belong_user_id = #{record.belongUserId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.gender != null">
gender = #{record.gender,jdbcType=CHAR},
</if>
<if test="record.breed != null">
breed = #{record.breed,jdbcType=VARCHAR},
</if>
<if test="record.birthday != null">
birthday = #{record.birthday,jdbcType=DATE},
</if>
<if test="record.staple != null">
staple = #{record.staple,jdbcType=VARCHAR},
</if>
<if test="record.snacks != null">
snacks = #{record.snacks,jdbcType=VARCHAR},
</if>
<if test="record.formerUserId != null">
former_user_id = #{record.formerUserId,jdbcType=VARCHAR},
</if>
<if test="record.sequence != null">
sequence = #{record.sequence,jdbcType=INTEGER},
</if>
<if test="record.pictrue != null">
pictrue = #{record.pictrue,jdbcType=VARCHAR},
</if>
<if test="record.registerDate != null">
register_date = #{record.registerDate,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update pet
set id = #{record.id,jdbcType=VARCHAR},
belong_user_id = #{record.belongUserId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
gender = #{record.gender,jdbcType=CHAR},
breed = #{record.breed,jdbcType=VARCHAR},
birthday = #{record.birthday,jdbcType=DATE},
staple = #{record.staple,jdbcType=VARCHAR},
snacks = #{record.snacks,jdbcType=VARCHAR},
former_user_id = #{record.formerUserId,jdbcType=VARCHAR},
sequence = #{record.sequence,jdbcType=INTEGER},
pictrue = #{record.pictrue,jdbcType=VARCHAR},
register_date = #{record.registerDate,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.datang.pet.pojo.Pet">
update pet
<set>
<if test="belongUserId != null">
belong_user_id = #{belongUserId,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="gender != null">
gender = #{gender,jdbcType=CHAR},
</if>
<if test="breed != null">
breed = #{breed,jdbcType=VARCHAR},
</if>
<if test="birthday != null">
birthday = #{birthday,jdbcType=DATE},
</if>
<if test="staple != null">
staple = #{staple,jdbcType=VARCHAR},
</if>
<if test="snacks != null">
snacks = #{snacks,jdbcType=VARCHAR},
</if>
<if test="formerUserId != null">
former_user_id = #{formerUserId,jdbcType=VARCHAR},
</if>
<if test="sequence != null">
sequence = #{sequence,jdbcType=INTEGER},
</if>
<if test="pictrue != null">
pictrue = #{pictrue,jdbcType=VARCHAR},
</if>
<if test="registerDate != null">
register_date = #{registerDate,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.datang.pet.pojo.Pet">
update pet
set belong_user_id = #{belongUserId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
gender = #{gender,jdbcType=CHAR},
breed = #{breed,jdbcType=VARCHAR},
birthday = #{birthday,jdbcType=DATE},
staple = #{staple,jdbcType=VARCHAR},
snacks = #{snacks,jdbcType=VARCHAR},
former_user_id = #{formerUserId,jdbcType=VARCHAR},
sequence = #{sequence,jdbcType=INTEGER},
pictrue = #{pictrue,jdbcType=VARCHAR},
register_date = #{registerDate,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>