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

353 lines
13 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.TalkMapper">
<resultMap id="BaseResultMap" type="com.datang.pet.pojo.Talk">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="bgm_id" jdbcType="VARCHAR" property="bgmId" />
<result column="bgm_author" jdbcType="VARCHAR" property="bgmAuthor" />
<result column="bgm_name" jdbcType="VARCHAR" property="bgmName" />
<result column="label" jdbcType="VARCHAR" property="label" />
<result column="talk_type" jdbcType="CHAR" property="talkType" />
<result column="resource_id" jdbcType="VARCHAR" property="resourceId" />
<result column="talk_describe" jdbcType="VARCHAR" property="talkDescribe" />
<result column="talk_date" jdbcType="TIMESTAMP" property="talkDate" />
<result column="ban" jdbcType="CHAR" property="ban" />
<result column="like_quantity" jdbcType="INTEGER" property="likeQuantity" />
<result column="comment_quantity" jdbcType="INTEGER" property="commentQuantity" />
<result column="complanin_quantity" jdbcType="INTEGER" property="complaninQuantity" />
</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, user_id, bgm_id, bgm_author, bgm_name, label, talk_type, resource_id, talk_describe,
talk_date, ban, like_quantity, comment_quantity, complanin_quantity
</sql>
<select id="selectByExample" parameterType="com.datang.pet.pojo.TalkExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from talk
<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 talk
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from talk
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.datang.pet.pojo.TalkExample">
delete from talk
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.datang.pet.pojo.Talk">
insert into talk (id, user_id, bgm_id,
bgm_author, bgm_name, label,
talk_type, resource_id, talk_describe,
talk_date, ban, like_quantity,
comment_quantity, complanin_quantity)
values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{bgmId,jdbcType=VARCHAR},
#{bgmAuthor,jdbcType=VARCHAR}, #{bgmName,jdbcType=VARCHAR}, #{label,jdbcType=VARCHAR},
#{talkType,jdbcType=CHAR}, #{resourceId,jdbcType=VARCHAR}, #{talkDescribe,jdbcType=VARCHAR},
#{talkDate,jdbcType=TIMESTAMP}, #{ban,jdbcType=CHAR}, #{likeQuantity,jdbcType=INTEGER},
#{commentQuantity,jdbcType=INTEGER}, #{complaninQuantity,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.datang.pet.pojo.Talk">
insert into talk
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="bgmId != null">
bgm_id,
</if>
<if test="bgmAuthor != null">
bgm_author,
</if>
<if test="bgmName != null">
bgm_name,
</if>
<if test="label != null">
label,
</if>
<if test="talkType != null">
talk_type,
</if>
<if test="resourceId != null">
resource_id,
</if>
<if test="talkDescribe != null">
talk_describe,
</if>
<if test="talkDate != null">
talk_date,
</if>
<if test="ban != null">
ban,
</if>
<if test="likeQuantity != null">
like_quantity,
</if>
<if test="commentQuantity != null">
comment_quantity,
</if>
<if test="complaninQuantity != null">
complanin_quantity,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="bgmId != null">
#{bgmId,jdbcType=VARCHAR},
</if>
<if test="bgmAuthor != null">
#{bgmAuthor,jdbcType=VARCHAR},
</if>
<if test="bgmName != null">
#{bgmName,jdbcType=VARCHAR},
</if>
<if test="label != null">
#{label,jdbcType=VARCHAR},
</if>
<if test="talkType != null">
#{talkType,jdbcType=CHAR},
</if>
<if test="resourceId != null">
#{resourceId,jdbcType=VARCHAR},
</if>
<if test="talkDescribe != null">
#{talkDescribe,jdbcType=VARCHAR},
</if>
<if test="talkDate != null">
#{talkDate,jdbcType=TIMESTAMP},
</if>
<if test="ban != null">
#{ban,jdbcType=CHAR},
</if>
<if test="likeQuantity != null">
#{likeQuantity,jdbcType=INTEGER},
</if>
<if test="commentQuantity != null">
#{commentQuantity,jdbcType=INTEGER},
</if>
<if test="complaninQuantity != null">
#{complaninQuantity,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.datang.pet.pojo.TalkExample" resultType="java.lang.Long">
select count(*) from talk
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update talk
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.bgmId != null">
bgm_id = #{record.bgmId,jdbcType=VARCHAR},
</if>
<if test="record.bgmAuthor != null">
bgm_author = #{record.bgmAuthor,jdbcType=VARCHAR},
</if>
<if test="record.bgmName != null">
bgm_name = #{record.bgmName,jdbcType=VARCHAR},
</if>
<if test="record.label != null">
label = #{record.label,jdbcType=VARCHAR},
</if>
<if test="record.talkType != null">
talk_type = #{record.talkType,jdbcType=CHAR},
</if>
<if test="record.resourceId != null">
resource_id = #{record.resourceId,jdbcType=VARCHAR},
</if>
<if test="record.talkDescribe != null">
talk_describe = #{record.talkDescribe,jdbcType=VARCHAR},
</if>
<if test="record.talkDate != null">
talk_date = #{record.talkDate,jdbcType=TIMESTAMP},
</if>
<if test="record.ban != null">
ban = #{record.ban,jdbcType=CHAR},
</if>
<if test="record.likeQuantity != null">
like_quantity = #{record.likeQuantity,jdbcType=INTEGER},
</if>
<if test="record.commentQuantity != null">
comment_quantity = #{record.commentQuantity,jdbcType=INTEGER},
</if>
<if test="record.complaninQuantity != null">
complanin_quantity = #{record.complaninQuantity,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update talk
set id = #{record.id,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
bgm_id = #{record.bgmId,jdbcType=VARCHAR},
bgm_author = #{record.bgmAuthor,jdbcType=VARCHAR},
bgm_name = #{record.bgmName,jdbcType=VARCHAR},
label = #{record.label,jdbcType=VARCHAR},
talk_type = #{record.talkType,jdbcType=CHAR},
resource_id = #{record.resourceId,jdbcType=VARCHAR},
talk_describe = #{record.talkDescribe,jdbcType=VARCHAR},
talk_date = #{record.talkDate,jdbcType=TIMESTAMP},
ban = #{record.ban,jdbcType=CHAR},
like_quantity = #{record.likeQuantity,jdbcType=INTEGER},
comment_quantity = #{record.commentQuantity,jdbcType=INTEGER},
complanin_quantity = #{record.complaninQuantity,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.datang.pet.pojo.Talk">
update talk
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="bgmId != null">
bgm_id = #{bgmId,jdbcType=VARCHAR},
</if>
<if test="bgmAuthor != null">
bgm_author = #{bgmAuthor,jdbcType=VARCHAR},
</if>
<if test="bgmName != null">
bgm_name = #{bgmName,jdbcType=VARCHAR},
</if>
<if test="label != null">
label = #{label,jdbcType=VARCHAR},
</if>
<if test="talkType != null">
talk_type = #{talkType,jdbcType=CHAR},
</if>
<if test="resourceId != null">
resource_id = #{resourceId,jdbcType=VARCHAR},
</if>
<if test="talkDescribe != null">
talk_describe = #{talkDescribe,jdbcType=VARCHAR},
</if>
<if test="talkDate != null">
talk_date = #{talkDate,jdbcType=TIMESTAMP},
</if>
<if test="ban != null">
ban = #{ban,jdbcType=CHAR},
</if>
<if test="likeQuantity != null">
like_quantity = #{likeQuantity,jdbcType=INTEGER},
</if>
<if test="commentQuantity != null">
comment_quantity = #{commentQuantity,jdbcType=INTEGER},
</if>
<if test="complaninQuantity != null">
complanin_quantity = #{complaninQuantity,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.datang.pet.pojo.Talk">
update talk
set user_id = #{userId,jdbcType=VARCHAR},
bgm_id = #{bgmId,jdbcType=VARCHAR},
bgm_author = #{bgmAuthor,jdbcType=VARCHAR},
bgm_name = #{bgmName,jdbcType=VARCHAR},
label = #{label,jdbcType=VARCHAR},
talk_type = #{talkType,jdbcType=CHAR},
resource_id = #{resourceId,jdbcType=VARCHAR},
talk_describe = #{talkDescribe,jdbcType=VARCHAR},
talk_date = #{talkDate,jdbcType=TIMESTAMP},
ban = #{ban,jdbcType=CHAR},
like_quantity = #{likeQuantity,jdbcType=INTEGER},
comment_quantity = #{commentQuantity,jdbcType=INTEGER},
complanin_quantity = #{complaninQuantity,jdbcType=INTEGER}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>