HomeHotManualRecommMapper.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.juxiao.xchat.module.xbd.mapper.home.HomeHotManualRecommMapper" >
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.home.HomeHotManualRecomm" >
  5. <id column="recomm_id" property="recommId" jdbcType="INTEGER" />
  6. <result column="uid" property="uid" jdbcType="BIGINT" />
  7. <result column="seq_no" property="seqNo" jdbcType="INTEGER" />
  8. <result column="status" property="status" jdbcType="TINYINT" />
  9. <result column="start_valid_time" property="startValidTime" jdbcType="VARCHAR" />
  10. <result column="end_valid_time" property="endValidTime" jdbcType="VARCHAR" />
  11. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  12. <result column="view_type" property="viewType" jdbcType="TINYINT" />
  13. <result column="custom_tag" property="customTag" jdbcType="VARCHAR" />
  14. <result column="type" property="type" jdbcType="TINYINT" />
  15. </resultMap>
  16. <sql id="Base_Column_List" >
  17. recomm_id, uid, seq_no, status, start_valid_time, end_valid_time, create_time, view_type,custom_tag,type
  18. </sql>
  19. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  20. select
  21. <include refid="Base_Column_List" />
  22. from home_hot_manual_recomm
  23. where recomm_id = #{recommId,jdbcType=INTEGER}
  24. </select>
  25. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  26. delete from home_hot_manual_recomm
  27. where recomm_id = #{recommId,jdbcType=INTEGER}
  28. </delete>
  29. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.home.HomeHotManualRecomm" >
  30. insert into home_hot_manual_recomm (recomm_id, uid, seq_no,
  31. status, start_valid_time, end_valid_time,
  32. create_time, view_type,custom_tag,type)
  33. values (#{recommId,jdbcType=INTEGER}, #{uid,jdbcType=BIGINT}, #{seqNo,jdbcType=INTEGER},
  34. #{status,jdbcType=TINYINT}, #{startValidTime,jdbcType=VARCHAR}, #{endValidTime,jdbcType=VARCHAR},
  35. #{createTime,jdbcType=TIMESTAMP}, #{viewType,jdbcType=TINYINT},#{customTag,jdbcType=VARCHAR},#{type,jdbcType=TINYINT})
  36. </insert>
  37. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.home.HomeHotManualRecomm" >
  38. insert into home_hot_manual_recomm
  39. <trim prefix="(" suffix=")" suffixOverrides="," >
  40. <if test="recommId != null" >
  41. recomm_id,
  42. </if>
  43. <if test="uid != null" >
  44. uid,
  45. </if>
  46. <if test="seqNo != null" >
  47. seq_no,
  48. </if>
  49. <if test="status != null" >
  50. status,
  51. </if>
  52. <if test="startValidTime != null and startValidTime != ''" >
  53. start_valid_time,
  54. </if>
  55. <if test="endValidTime != null and endValidTime != ''" >
  56. end_valid_time,
  57. </if>
  58. <if test="createTime != null" >
  59. create_time,
  60. </if>
  61. <if test="viewType != null" >
  62. view_type,
  63. </if>
  64. <if test="customTag != null and customTag != ''" >
  65. custom_tag,
  66. </if>
  67. <if test="type != null" >
  68. type,
  69. </if>
  70. </trim>
  71. <trim prefix="values (" suffix=")" suffixOverrides="," >
  72. <if test="recommId != null" >
  73. #{recommId,jdbcType=INTEGER},
  74. </if>
  75. <if test="uid != null" >
  76. #{uid,jdbcType=BIGINT},
  77. </if>
  78. <if test="seqNo != null" >
  79. #{seqNo,jdbcType=INTEGER},
  80. </if>
  81. <if test="status != null" >
  82. #{status,jdbcType=TINYINT},
  83. </if>
  84. <if test="startValidTime != null" >
  85. #{startValidTime,jdbcType=VARCHAR},
  86. </if>
  87. <if test="endValidTime != null" >
  88. #{endValidTime,jdbcType=VARCHAR},
  89. </if>
  90. <if test="createTime != null" >
  91. #{createTime,jdbcType=TIMESTAMP},
  92. </if>
  93. <if test="viewType != null" >
  94. #{viewType,jdbcType=TINYINT},
  95. </if>
  96. <if test="customTag != null" >
  97. #{customTag,jdbcType=VARCHAR},
  98. </if>
  99. <if test="type != null" >
  100. #{type,jdbcType=TINYINT},
  101. </if>
  102. </trim>
  103. </insert>
  104. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.home.HomeHotManualRecomm" >
  105. update home_hot_manual_recomm
  106. <set >
  107. <if test="uid != null" >
  108. uid = #{uid,jdbcType=BIGINT},
  109. </if>
  110. <if test="seqNo != null" >
  111. seq_no = #{seqNo,jdbcType=INTEGER},
  112. </if>
  113. <if test="status != null" >
  114. status = #{status,jdbcType=TINYINT},
  115. </if>
  116. <if test="startValidTime != null and startValidTime != ''" >
  117. start_valid_time = #{startValidTime,jdbcType=VARCHAR},
  118. </if>
  119. <if test="endValidTime != null and endValidTime != ''" >
  120. end_valid_time = #{endValidTime,jdbcType=VARCHAR},
  121. </if>
  122. <if test="createTime != null" >
  123. create_time = #{createTime,jdbcType=TIMESTAMP},
  124. </if>
  125. <if test="viewType != null" >
  126. view_type = #{viewType,jdbcType=TINYINT},
  127. </if>
  128. <if test="customTag != null and customTag != ''" >
  129. custom_tag = #{customTag,jdbcType=VARCHAR},
  130. </if>
  131. <if test="type != null" >
  132. type = #{type,jdbcType=TINYINT},
  133. </if>
  134. </set>
  135. where recomm_id = #{recommId,jdbcType=INTEGER}
  136. </update>
  137. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.home.HomeHotManualRecomm" >
  138. update home_hot_manual_recomm
  139. set uid = #{uid,jdbcType=BIGINT},
  140. seq_no = #{seqNo,jdbcType=INTEGER},
  141. status = #{status,jdbcType=TINYINT},
  142. start_valid_time = #{startValidTime,jdbcType=VARCHAR},
  143. end_valid_time = #{endValidTime,jdbcType=VARCHAR},
  144. create_time = #{createTime,jdbcType=TIMESTAMP},
  145. view_type = #{viewType,jdbcType=TINYINT},
  146. custom_tag = #{customTag,jdbcType=VARCHAR},
  147. type = #{type,jdbcType=TINYINT}
  148. where recomm_id = #{recommId,jdbcType=INTEGER}
  149. </update>
  150. <select id="selectHomeHotManualRecommByList" resultType="com.juxiao.xchat.module.xbd.vo.HomeHotManualRecommVO">
  151. select h.recomm_id as recommId,h.uid,h.seq_no as seqNo,h.type,h.status,h.start_valid_time as startValidTime,h.end_valid_time as endValidTime,
  152. h.view_type as viewType, r.title, r.is_permit_room as isPermitRoom, u.erban_no as erBanNo,h.create_time as createTime
  153. from home_hot_manual_recomm h
  154. INNER JOIN room r on h.uid = r.uid
  155. INNER JOIN users u on r.uid = u.uid
  156. <where>
  157. 1 = 1
  158. <if test="erBanNo != null">
  159. AND u.erban_no = #{erBanNo}
  160. </if>
  161. <if test="viewType != null">
  162. AND view_type = #{viewType}
  163. </if>
  164. </where>
  165. order by h.start_valid_time desc
  166. </select>
  167. </mapper>