| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- <?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.mirage.mirageservice.mapper.mysql.FamilyMomentsMapper">
- <resultMap id="BaseResultMap" type="com.mirage.mirageservice.domain.FamilyMoments">
- <!--@mbg.generated-->
- <!--@Table family_moments-->
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="publish_uid" jdbcType="BIGINT" property="publishUid" />
- <result column="publish_time" jdbcType="TIMESTAMP" property="publishTime" />
- <result column="expire_time" jdbcType="BIGINT" property="expireTime" />
- <result column="content" jdbcType="LONGVARCHAR" property="content" />
- <result column="visible_type" jdbcType="INTEGER" property="visibleType" />
- <result column="visible_value" jdbcType="VARCHAR" property="visibleValue" />
- <result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
- <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
- <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--@mbg.generated-->
- id, `type`, publish_uid, publish_time, expire_time, content, visible_type, visible_value,
- is_deleted, gmt_create, gmt_modified
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- <!--@mbg.generated-->
- select
- <include refid="Base_Column_List" />
- from family_moments
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- <!--@mbg.generated-->
- delete from family_moments
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mirage.mirageservice.domain.FamilyMoments" useGeneratedKeys="true">
- <!--@mbg.generated-->
- insert into family_moments (`type`, publish_uid, publish_time,
- expire_time, content, visible_type,
- visible_value, is_deleted, gmt_create,
- gmt_modified)
- values (#{type,jdbcType=INTEGER}, #{publishUid,jdbcType=BIGINT}, #{publishTime,jdbcType=TIMESTAMP},
- #{expireTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}, #{visibleType,jdbcType=INTEGER},
- #{visibleValue,jdbcType=VARCHAR}, #{isDeleted,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP},
- #{gmtModified,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mirage.mirageservice.domain.FamilyMoments" useGeneratedKeys="true">
- <!--@mbg.generated-->
- insert into family_moments
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="type != null">
- `type`,
- </if>
- <if test="publishUid != null">
- publish_uid,
- </if>
- <if test="publishTime != null">
- publish_time,
- </if>
- <if test="expireTime != null">
- expire_time,
- </if>
- <if test="content != null">
- content,
- </if>
- <if test="visibleType != null">
- visible_type,
- </if>
- <if test="visibleValue != null">
- visible_value,
- </if>
- <if test="isDeleted != null">
- is_deleted,
- </if>
- <if test="gmtCreate != null">
- gmt_create,
- </if>
- <if test="gmtModified != null">
- gmt_modified,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="publishUid != null">
- #{publishUid,jdbcType=BIGINT},
- </if>
- <if test="publishTime != null">
- #{publishTime,jdbcType=TIMESTAMP},
- </if>
- <if test="expireTime != null">
- #{expireTime,jdbcType=BIGINT},
- </if>
- <if test="content != null">
- #{content,jdbcType=LONGVARCHAR},
- </if>
- <if test="visibleType != null">
- #{visibleType,jdbcType=INTEGER},
- </if>
- <if test="visibleValue != null">
- #{visibleValue,jdbcType=VARCHAR},
- </if>
- <if test="isDeleted != null">
- #{isDeleted,jdbcType=INTEGER},
- </if>
- <if test="gmtCreate != null">
- #{gmtCreate,jdbcType=TIMESTAMP},
- </if>
- <if test="gmtModified != null">
- #{gmtModified,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.mirage.mirageservice.domain.FamilyMoments">
- <!--@mbg.generated-->
- update family_moments
- <set>
- <if test="type != null">
- `type` = #{type,jdbcType=INTEGER},
- </if>
- <if test="publishUid != null">
- publish_uid = #{publishUid,jdbcType=BIGINT},
- </if>
- <if test="publishTime != null">
- publish_time = #{publishTime,jdbcType=TIMESTAMP},
- </if>
- <if test="expireTime != null">
- expire_time = #{expireTime,jdbcType=BIGINT},
- </if>
- <if test="content != null">
- content = #{content,jdbcType=LONGVARCHAR},
- </if>
- <if test="visibleType != null">
- visible_type = #{visibleType,jdbcType=INTEGER},
- </if>
- <if test="visibleValue != null">
- visible_value = #{visibleValue,jdbcType=VARCHAR},
- </if>
- <if test="isDeleted != null">
- is_deleted = #{isDeleted,jdbcType=INTEGER},
- </if>
- <if test="gmtCreate != null">
- gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
- </if>
- <if test="gmtModified != null">
- gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.mirage.mirageservice.domain.FamilyMoments">
- <!--@mbg.generated-->
- update family_moments
- set `type` = #{type,jdbcType=INTEGER},
- publish_uid = #{publishUid,jdbcType=BIGINT},
- publish_time = #{publishTime,jdbcType=TIMESTAMP},
- expire_time = #{expireTime,jdbcType=BIGINT},
- content = #{content,jdbcType=LONGVARCHAR},
- visible_type = #{visibleType,jdbcType=INTEGER},
- visible_value = #{visibleValue,jdbcType=VARCHAR},
- is_deleted = #{isDeleted,jdbcType=INTEGER},
- gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
- gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <!--auto generated by MybatisCodeHelper on 2025-10-23-->
- <select id="selectAllByTypeAndExpireTimeGreaterThanOrExpireTimeAndIsDeletedAndVisibleTypeOrderByPublishTimeDesc"
- resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from family_moments
- <where>
- <if test="type != null">
- and `type`=#{type,jdbcType=INTEGER}
- </if>
- <if test="minExpireTime != null">
- and expire_time <![CDATA[>]]> #{minExpireTime,jdbcType=BIGINT}
- </if>
- <if test="expireTime != null">
- or expire_time=#{expireTime,jdbcType=BIGINT}
- </if>
- and is_deleted=#{isDeleted,jdbcType=INTEGER}
- <if test="visibleType != null">
- and visible_type=#{visibleType,jdbcType=INTEGER}
- </if>
- </where>
- order by publish_time desc
- </select>
- <select id="selectAllMoments" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from family_moments
- <where>
- <if test="type != null">
- and `type`=#{type,jdbcType=INTEGER}
- </if>
- and is_deleted=#{isDeleted,jdbcType=INTEGER}
- <if test="visibleType != null">
- and visible_type=#{visibleType,jdbcType=INTEGER}
- </if>
- <if test="id != null">
- and id <![CDATA[<]]> #{id,jdbcType=BIGINT}
- </if>
- </where>
- order by id desc LIMIT #{pageSize,jdbcType=INTEGER}
- </select>
- </mapper>
|