|
|
@@ -0,0 +1,90 @@
|
|
|
+<?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.goafanti.common.dao.UserInterestMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserInterest" >
|
|
|
+ <id column="id" property="id" jdbcType="VARCHAR" />
|
|
|
+ <result column="from_uid" property="fromUid" jdbcType="VARCHAR" />
|
|
|
+ <result column="to_uid" property="toUid" jdbcType="VARCHAR" />
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ id, from_uid, to_uid, create_time
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from user_interest
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
|
+ delete from user_interest
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.UserInterest" >
|
|
|
+ insert into user_interest (id, from_uid, to_uid,
|
|
|
+ create_time)
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{fromUid,jdbcType=VARCHAR}, #{toUid,jdbcType=VARCHAR},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.UserInterest" >
|
|
|
+ insert into user_interest
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id != null" >
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="fromUid != null" >
|
|
|
+ from_uid,
|
|
|
+ </if>
|
|
|
+ <if test="toUid != null" >
|
|
|
+ to_uid,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id != null" >
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="fromUid != null" >
|
|
|
+ #{fromUid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="toUid != null" >
|
|
|
+ #{toUid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserInterest" >
|
|
|
+ update user_interest
|
|
|
+ <set >
|
|
|
+ <if test="fromUid != null" >
|
|
|
+ from_uid = #{fromUid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="toUid != null" >
|
|
|
+ to_uid = #{toUid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserInterest" >
|
|
|
+ update user_interest
|
|
|
+ set from_uid = #{fromUid,jdbcType=VARCHAR},
|
|
|
+ to_uid = #{toUid,jdbcType=VARCHAR},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="findByFromUidAndToUid" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from user_interest
|
|
|
+ where from_uid = #{fromUid,jdbcType=VARCHAR}
|
|
|
+ and to_uid = #{toUid,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+</mapper>
|