FamilyMomentsMapper.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.mirage.mirageservice.mapper.mysql.FamilyMomentsMapper">
  4. <resultMap id="BaseResultMap" type="com.mirage.mirageservice.domain.FamilyMoments">
  5. <!--@mbg.generated-->
  6. <!--@Table family_moments-->
  7. <id column="id" jdbcType="BIGINT" property="id" />
  8. <result column="type" jdbcType="INTEGER" property="type" />
  9. <result column="publish_uid" jdbcType="BIGINT" property="publishUid" />
  10. <result column="publish_time" jdbcType="TIMESTAMP" property="publishTime" />
  11. <result column="expire_time" jdbcType="BIGINT" property="expireTime" />
  12. <result column="content" jdbcType="LONGVARCHAR" property="content" />
  13. <result column="visible_type" jdbcType="INTEGER" property="visibleType" />
  14. <result column="visible_value" jdbcType="VARCHAR" property="visibleValue" />
  15. <result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
  16. <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
  17. <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
  18. </resultMap>
  19. <sql id="Base_Column_List">
  20. <!--@mbg.generated-->
  21. id, `type`, publish_uid, publish_time, expire_time, content, visible_type, visible_value,
  22. is_deleted, gmt_create, gmt_modified
  23. </sql>
  24. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  25. <!--@mbg.generated-->
  26. select
  27. <include refid="Base_Column_List" />
  28. from family_moments
  29. where id = #{id,jdbcType=BIGINT}
  30. </select>
  31. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  32. <!--@mbg.generated-->
  33. delete from family_moments
  34. where id = #{id,jdbcType=BIGINT}
  35. </delete>
  36. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mirage.mirageservice.domain.FamilyMoments" useGeneratedKeys="true">
  37. <!--@mbg.generated-->
  38. insert into family_moments (`type`, publish_uid, publish_time,
  39. expire_time, content, visible_type,
  40. visible_value, is_deleted, gmt_create,
  41. gmt_modified)
  42. values (#{type,jdbcType=INTEGER}, #{publishUid,jdbcType=BIGINT}, #{publishTime,jdbcType=TIMESTAMP},
  43. #{expireTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}, #{visibleType,jdbcType=INTEGER},
  44. #{visibleValue,jdbcType=VARCHAR}, #{isDeleted,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP},
  45. #{gmtModified,jdbcType=TIMESTAMP})
  46. </insert>
  47. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mirage.mirageservice.domain.FamilyMoments" useGeneratedKeys="true">
  48. <!--@mbg.generated-->
  49. insert into family_moments
  50. <trim prefix="(" suffix=")" suffixOverrides=",">
  51. <if test="type != null">
  52. `type`,
  53. </if>
  54. <if test="publishUid != null">
  55. publish_uid,
  56. </if>
  57. <if test="publishTime != null">
  58. publish_time,
  59. </if>
  60. <if test="expireTime != null">
  61. expire_time,
  62. </if>
  63. <if test="content != null">
  64. content,
  65. </if>
  66. <if test="visibleType != null">
  67. visible_type,
  68. </if>
  69. <if test="visibleValue != null">
  70. visible_value,
  71. </if>
  72. <if test="isDeleted != null">
  73. is_deleted,
  74. </if>
  75. <if test="gmtCreate != null">
  76. gmt_create,
  77. </if>
  78. <if test="gmtModified != null">
  79. gmt_modified,
  80. </if>
  81. </trim>
  82. <trim prefix="values (" suffix=")" suffixOverrides=",">
  83. <if test="type != null">
  84. #{type,jdbcType=INTEGER},
  85. </if>
  86. <if test="publishUid != null">
  87. #{publishUid,jdbcType=BIGINT},
  88. </if>
  89. <if test="publishTime != null">
  90. #{publishTime,jdbcType=TIMESTAMP},
  91. </if>
  92. <if test="expireTime != null">
  93. #{expireTime,jdbcType=BIGINT},
  94. </if>
  95. <if test="content != null">
  96. #{content,jdbcType=LONGVARCHAR},
  97. </if>
  98. <if test="visibleType != null">
  99. #{visibleType,jdbcType=INTEGER},
  100. </if>
  101. <if test="visibleValue != null">
  102. #{visibleValue,jdbcType=VARCHAR},
  103. </if>
  104. <if test="isDeleted != null">
  105. #{isDeleted,jdbcType=INTEGER},
  106. </if>
  107. <if test="gmtCreate != null">
  108. #{gmtCreate,jdbcType=TIMESTAMP},
  109. </if>
  110. <if test="gmtModified != null">
  111. #{gmtModified,jdbcType=TIMESTAMP},
  112. </if>
  113. </trim>
  114. </insert>
  115. <update id="updateByPrimaryKeySelective" parameterType="com.mirage.mirageservice.domain.FamilyMoments">
  116. <!--@mbg.generated-->
  117. update family_moments
  118. <set>
  119. <if test="type != null">
  120. `type` = #{type,jdbcType=INTEGER},
  121. </if>
  122. <if test="publishUid != null">
  123. publish_uid = #{publishUid,jdbcType=BIGINT},
  124. </if>
  125. <if test="publishTime != null">
  126. publish_time = #{publishTime,jdbcType=TIMESTAMP},
  127. </if>
  128. <if test="expireTime != null">
  129. expire_time = #{expireTime,jdbcType=BIGINT},
  130. </if>
  131. <if test="content != null">
  132. content = #{content,jdbcType=LONGVARCHAR},
  133. </if>
  134. <if test="visibleType != null">
  135. visible_type = #{visibleType,jdbcType=INTEGER},
  136. </if>
  137. <if test="visibleValue != null">
  138. visible_value = #{visibleValue,jdbcType=VARCHAR},
  139. </if>
  140. <if test="isDeleted != null">
  141. is_deleted = #{isDeleted,jdbcType=INTEGER},
  142. </if>
  143. <if test="gmtCreate != null">
  144. gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
  145. </if>
  146. <if test="gmtModified != null">
  147. gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
  148. </if>
  149. </set>
  150. where id = #{id,jdbcType=BIGINT}
  151. </update>
  152. <update id="updateByPrimaryKey" parameterType="com.mirage.mirageservice.domain.FamilyMoments">
  153. <!--@mbg.generated-->
  154. update family_moments
  155. set `type` = #{type,jdbcType=INTEGER},
  156. publish_uid = #{publishUid,jdbcType=BIGINT},
  157. publish_time = #{publishTime,jdbcType=TIMESTAMP},
  158. expire_time = #{expireTime,jdbcType=BIGINT},
  159. content = #{content,jdbcType=LONGVARCHAR},
  160. visible_type = #{visibleType,jdbcType=INTEGER},
  161. visible_value = #{visibleValue,jdbcType=VARCHAR},
  162. is_deleted = #{isDeleted,jdbcType=INTEGER},
  163. gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
  164. gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
  165. where id = #{id,jdbcType=BIGINT}
  166. </update>
  167. <!--auto generated by MybatisCodeHelper on 2025-10-23-->
  168. <select id="selectAllByTypeAndExpireTimeGreaterThanOrExpireTimeAndIsDeletedAndVisibleTypeOrderByPublishTimeDesc"
  169. resultMap="BaseResultMap">
  170. select
  171. <include refid="Base_Column_List"/>
  172. from family_moments
  173. <where>
  174. <if test="type != null">
  175. and `type`=#{type,jdbcType=INTEGER}
  176. </if>
  177. <if test="minExpireTime != null">
  178. and expire_time <![CDATA[>]]> #{minExpireTime,jdbcType=BIGINT}
  179. </if>
  180. <if test="expireTime != null">
  181. or expire_time=#{expireTime,jdbcType=BIGINT}
  182. </if>
  183. and is_deleted=#{isDeleted,jdbcType=INTEGER}
  184. <if test="visibleType != null">
  185. and visible_type=#{visibleType,jdbcType=INTEGER}
  186. </if>
  187. </where>
  188. order by publish_time desc
  189. </select>
  190. <select id="selectAllMoments" resultMap="BaseResultMap">
  191. select
  192. <include refid="Base_Column_List"/>
  193. from family_moments
  194. <where>
  195. <if test="type != null">
  196. and `type`=#{type,jdbcType=INTEGER}
  197. </if>
  198. and is_deleted=#{isDeleted,jdbcType=INTEGER}
  199. <if test="visibleType != null">
  200. and visible_type=#{visibleType,jdbcType=INTEGER}
  201. </if>
  202. <if test="id != null">
  203. and id <![CDATA[<]]> #{id,jdbcType=BIGINT}
  204. </if>
  205. </where>
  206. order by id desc LIMIT #{pageSize,jdbcType=INTEGER}
  207. </select>
  208. </mapper>