PrettyErBanNoMapper.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.juxiao.xchat.module.xbd.mapper.users.PrettyErBanNoMapper">
  6. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.PrettyErbanNo" >
  7. <id column="pretty_id" property="prettyId" jdbcType="INTEGER" />
  8. <result column="pretty_erban_no" property="prettyErbanNo" jdbcType="BIGINT" />
  9. <result column="status" property="status" jdbcType="TINYINT" />
  10. <result column="use_for" property="useFor" jdbcType="TINYINT" />
  11. <result column="user_uid" property="userUid" jdbcType="BIGINT" />
  12. <result column="user_erban_no" property="userErbanNo" jdbcType="BIGINT" />
  13. <result column="pretty_desc" property="prettyDesc" jdbcType="VARCHAR" />
  14. <result column="start_valid_time" property="startValidTime" jdbcType="TIMESTAMP" />
  15. <result column="end_valid_time" property="endValidTime" jdbcType="TIMESTAMP" />
  16. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  17. </resultMap>
  18. <sql id="Base_Column_List" >
  19. pretty_id, pretty_erban_no, status, use_for, user_uid, user_erban_no, pretty_desc,
  20. start_valid_time, end_valid_time, create_time
  21. </sql>
  22. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  23. select
  24. <include refid="Base_Column_List" />
  25. from pretty_erban_no
  26. where pretty_id = #{prettyId,jdbcType=INTEGER}
  27. </select>
  28. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.PrettyErbanNo" >
  29. <selectKey resultType="java.lang.Integer" keyProperty="prettyId" order="AFTER" >
  30. SELECT LAST_INSERT_ID()
  31. </selectKey>
  32. insert into pretty_erban_no (pretty_erban_no, status, use_for,
  33. user_uid, user_erban_no, pretty_desc,
  34. start_valid_time, end_valid_time, create_time
  35. )
  36. values (#{prettyErbanNo,jdbcType=BIGINT}, #{status,jdbcType=TINYINT}, #{useFor,jdbcType=TINYINT},
  37. #{userUid,jdbcType=BIGINT}, #{userErbanNo,jdbcType=BIGINT}, #{prettyDesc,jdbcType=VARCHAR},
  38. #{startValidTime,jdbcType=TIMESTAMP}, #{endValidTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
  39. )
  40. </insert>
  41. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.PrettyErbanNo" >
  42. <selectKey resultType="java.lang.Integer" keyProperty="prettyId" order="AFTER" >
  43. SELECT LAST_INSERT_ID()
  44. </selectKey>
  45. insert into pretty_erban_no
  46. <trim prefix="(" suffix=")" suffixOverrides="," >
  47. <if test="prettyErbanNo != null" >
  48. pretty_erban_no,
  49. </if>
  50. <if test="status != null" >
  51. status,
  52. </if>
  53. <if test="useFor != null" >
  54. use_for,
  55. </if>
  56. <if test="userUid != null" >
  57. user_uid,
  58. </if>
  59. <if test="userErbanNo != null" >
  60. user_erban_no,
  61. </if>
  62. <if test="prettyDesc != null" >
  63. pretty_desc,
  64. </if>
  65. <if test="startValidTime != null" >
  66. start_valid_time,
  67. </if>
  68. <if test="endValidTime != null" >
  69. end_valid_time,
  70. </if>
  71. <if test="createTime != null" >
  72. create_time,
  73. </if>
  74. </trim>
  75. <trim prefix="values (" suffix=")" suffixOverrides="," >
  76. <if test="prettyErbanNo != null" >
  77. #{prettyErbanNo,jdbcType=BIGINT},
  78. </if>
  79. <if test="status != null" >
  80. #{status,jdbcType=TINYINT},
  81. </if>
  82. <if test="useFor != null" >
  83. #{useFor,jdbcType=TINYINT},
  84. </if>
  85. <if test="userUid != null" >
  86. #{userUid,jdbcType=BIGINT},
  87. </if>
  88. <if test="userErbanNo != null" >
  89. #{userErbanNo,jdbcType=BIGINT},
  90. </if>
  91. <if test="prettyDesc != null" >
  92. #{prettyDesc,jdbcType=VARCHAR},
  93. </if>
  94. <if test="startValidTime != null" >
  95. #{startValidTime,jdbcType=TIMESTAMP},
  96. </if>
  97. <if test="endValidTime != null" >
  98. #{endValidTime,jdbcType=TIMESTAMP},
  99. </if>
  100. <if test="createTime != null" >
  101. #{createTime,jdbcType=TIMESTAMP},
  102. </if>
  103. </trim>
  104. </insert>
  105. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.PrettyErbanNo" >
  106. update pretty_erban_no
  107. <set >
  108. <if test="prettyErbanNo != null" >
  109. pretty_erban_no = #{prettyErbanNo,jdbcType=BIGINT},
  110. </if>
  111. <if test="status != null" >
  112. status = #{status,jdbcType=TINYINT},
  113. </if>
  114. <if test="useFor != null" >
  115. use_for = #{useFor,jdbcType=TINYINT},
  116. </if>
  117. <if test="userUid != null" >
  118. user_uid = #{userUid,jdbcType=BIGINT},
  119. </if>
  120. <if test="userErbanNo != null" >
  121. user_erban_no = #{userErbanNo,jdbcType=BIGINT},
  122. </if>
  123. <if test="prettyDesc != null" >
  124. pretty_desc = #{prettyDesc,jdbcType=VARCHAR},
  125. </if>
  126. <if test="startValidTime != null" >
  127. start_valid_time = #{startValidTime,jdbcType=TIMESTAMP},
  128. </if>
  129. <if test="endValidTime != null" >
  130. end_valid_time = #{endValidTime,jdbcType=TIMESTAMP},
  131. </if>
  132. <if test="createTime != null" >
  133. create_time = #{createTime,jdbcType=TIMESTAMP},
  134. </if>
  135. </set>
  136. where pretty_id = #{prettyId,jdbcType=INTEGER}
  137. </update>
  138. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.PrettyErbanNo" >
  139. update pretty_erban_no
  140. set pretty_erban_no = #{prettyErbanNo,jdbcType=BIGINT},
  141. status = #{status,jdbcType=TINYINT},
  142. use_for = #{useFor,jdbcType=TINYINT},
  143. user_uid = #{userUid,jdbcType=BIGINT},
  144. user_erban_no = #{userErbanNo,jdbcType=BIGINT},
  145. pretty_desc = #{prettyDesc,jdbcType=VARCHAR},
  146. start_valid_time = #{startValidTime,jdbcType=TIMESTAMP},
  147. end_valid_time = #{endValidTime,jdbcType=TIMESTAMP},
  148. create_time = #{createTime,jdbcType=TIMESTAMP}
  149. where pretty_id = #{prettyId,jdbcType=INTEGER}
  150. </update>
  151. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  152. delete from pretty_erban_no
  153. where pretty_id = #{prettyId,jdbcType=INTEGER}
  154. </delete>
  155. <select id="selectByErBanNo" resultMap="BaseResultMap">
  156. select
  157. <include refid="Base_Column_List" />
  158. from pretty_erban_no
  159. where pretty_erban_no = #{prettyErBanNo}
  160. </select>
  161. <delete id="deleteByPrettyErBanNoORStatus">
  162. delete from pretty_erban_no
  163. where pretty_erban_no = #{prettyErBanNo} and status = #{status}
  164. </delete>
  165. </mapper>