12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?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.juxiao.xchat.module.xbd.mapper.circle.MomentsLikeMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.circle.MomentsLike" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="uid" property="uid" jdbcType="BIGINT" />
- <result column="moments_id" property="momentsId" jdbcType="INTEGER" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, uid, moments_id, create_time
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from moments_like
- where id = #{id,jdbcType=INTEGER}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentsLike" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into moments_like (uid, moments_id, create_time
- )
- values (#{uid,jdbcType=BIGINT}, #{momentsId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentsLike" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into moments_like
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- uid,
- </if>
- <if test="momentsId != null" >
- moments_id,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="momentsId != null" >
- #{momentsId,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentsLike" >
- update moments_like
- <set >
- <if test="uid != null" >
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="momentsId != null" >
- moments_id = #{momentsId,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentsLike" >
- update moments_like
- set uid = #{uid,jdbcType=BIGINT},
- moments_id = #{momentsId,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from moments_like
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByMomentsId">
- delete from moments_like where moments_id = #{momentsId}
- </delete>
- </mapper>
|