HeadwearMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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.mall.HeadwearMapper" >
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.mall.Headwear" >
  5. <id column="headwear_id" property="headwearId" jdbcType="INTEGER" />
  6. <result column="headwear_name" property="headwearName" jdbcType="VARCHAR" />
  7. <result column="gold_price" property="goldPrice" jdbcType="BIGINT" />
  8. <result column="seq_no" property="seqNo" jdbcType="INTEGER" />
  9. <result column="headwear_status" property="headwearStatus" jdbcType="TINYINT" />
  10. <result column="pic_url" property="picUrl" jdbcType="VARCHAR" />
  11. <result column="has_gif_pic" property="hasGifPic" jdbcType="BIT" />
  12. <result column="gif_url" property="gifUrl" jdbcType="VARCHAR" />
  13. <result column="has_vgg_pic" property="hasVggPic" jdbcType="BIT" />
  14. <result column="vgg_url" property="vggUrl" jdbcType="VARCHAR" />
  15. <result column="is_time_limit" property="isTimeLimit" jdbcType="BIT" />
  16. <result column="effective_time" property="effectiveTime" jdbcType="BIGINT" />
  17. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  18. <result column="allow_purse" property="allowPurse" jdbcType="TINYINT" />
  19. <result column="left_level" property="leftLevel" jdbcType="INTEGER" />
  20. <result column="mark_pic" property="markPic" jdbcType="VARCHAR" />
  21. <result column="buy_type" property="buyType" jdbcType="INTEGER" />
  22. </resultMap>
  23. <sql id="Base_Column_List" >
  24. headwear_id, headwear_name, gold_price, seq_no, headwear_status, pic_url, has_gif_pic,
  25. gif_url, has_vgg_pic, vgg_url, is_time_limit, effective_time, create_time, allow_purse,
  26. left_level, mark_pic,buy_type
  27. </sql>
  28. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  29. select
  30. <include refid="Base_Column_List" />
  31. from headwear
  32. where headwear_id = #{headwearId,jdbcType=INTEGER}
  33. </select>
  34. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Headwear" useGeneratedKeys="true" keyProperty="headwearId" keyColumn="headwear_id">
  35. insert into headwear (headwear_id, headwear_name, gold_price,
  36. seq_no, headwear_status, pic_url,
  37. has_gif_pic, gif_url, has_vgg_pic,
  38. vgg_url, is_time_limit, effective_time,
  39. create_time, allow_purse, left_level,
  40. mark_pic)
  41. values (#{headwearId,jdbcType=INTEGER}, #{headwearName,jdbcType=VARCHAR}, #{goldPrice,jdbcType=BIGINT},
  42. #{seqNo,jdbcType=INTEGER}, #{headwearStatus,jdbcType=TINYINT}, #{picUrl,jdbcType=VARCHAR},
  43. #{hasGifPic,jdbcType=BIT}, #{gifUrl,jdbcType=VARCHAR}, #{hasVggPic,jdbcType=BIT},
  44. #{vggUrl,jdbcType=VARCHAR}, #{isTimeLimit,jdbcType=BIT}, #{effectiveTime,jdbcType=BIGINT},
  45. #{createTime,jdbcType=TIMESTAMP}, #{allowPurse,jdbcType=TINYINT}, #{leftLevel,jdbcType=INTEGER},
  46. #{markPic,jdbcType=VARCHAR})
  47. </insert>
  48. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Headwear" useGeneratedKeys="true" keyProperty="headwearId" keyColumn="headwear_id">
  49. insert into headwear
  50. <trim prefix="(" suffix=")" suffixOverrides="," >
  51. <if test="headwearId != null" >
  52. headwear_id,
  53. </if>
  54. <if test="headwearName != null" >
  55. headwear_name,
  56. </if>
  57. <if test="goldPrice != null" >
  58. gold_price,
  59. </if>
  60. <if test="seqNo != null" >
  61. seq_no,
  62. </if>
  63. <if test="headwearStatus != null" >
  64. headwear_status,
  65. </if>
  66. <if test="picUrl != null" >
  67. pic_url,
  68. </if>
  69. <if test="hasGifPic != null" >
  70. has_gif_pic,
  71. </if>
  72. <if test="gifUrl != null" >
  73. gif_url,
  74. </if>
  75. <if test="hasVggPic != null" >
  76. has_vgg_pic,
  77. </if>
  78. <if test="vggUrl != null" >
  79. vgg_url,
  80. </if>
  81. <if test="isTimeLimit != null" >
  82. is_time_limit,
  83. </if>
  84. <if test="effectiveTime != null" >
  85. effective_time,
  86. </if>
  87. <if test="createTime != null" >
  88. create_time,
  89. </if>
  90. <if test="allowPurse != null" >
  91. allow_purse,
  92. </if>
  93. <if test="leftLevel != null" >
  94. left_level,
  95. </if>
  96. <if test="markPic != null" >
  97. mark_pic,
  98. </if>
  99. <if test="buyType != null" >
  100. buy_type,
  101. </if>
  102. </trim>
  103. <trim prefix="values (" suffix=")" suffixOverrides="," >
  104. <if test="headwearId != null" >
  105. #{headwearId,jdbcType=INTEGER},
  106. </if>
  107. <if test="headwearName != null" >
  108. #{headwearName,jdbcType=VARCHAR},
  109. </if>
  110. <if test="goldPrice != null" >
  111. #{goldPrice,jdbcType=BIGINT},
  112. </if>
  113. <if test="seqNo != null" >
  114. #{seqNo,jdbcType=INTEGER},
  115. </if>
  116. <if test="headwearStatus != null" >
  117. #{headwearStatus,jdbcType=TINYINT},
  118. </if>
  119. <if test="picUrl != null" >
  120. #{picUrl,jdbcType=VARCHAR},
  121. </if>
  122. <if test="hasGifPic != null" >
  123. #{hasGifPic,jdbcType=BIT},
  124. </if>
  125. <if test="gifUrl != null" >
  126. #{gifUrl,jdbcType=VARCHAR},
  127. </if>
  128. <if test="hasVggPic != null" >
  129. #{hasVggPic,jdbcType=BIT},
  130. </if>
  131. <if test="vggUrl != null" >
  132. #{vggUrl,jdbcType=VARCHAR},
  133. </if>
  134. <if test="isTimeLimit != null" >
  135. #{isTimeLimit,jdbcType=BIT},
  136. </if>
  137. <if test="effectiveTime != null" >
  138. #{effectiveTime,jdbcType=BIGINT},
  139. </if>
  140. <if test="createTime != null" >
  141. #{createTime,jdbcType=TIMESTAMP},
  142. </if>
  143. <if test="allowPurse != null" >
  144. #{allowPurse,jdbcType=TINYINT},
  145. </if>
  146. <if test="leftLevel != null" >
  147. #{leftLevel,jdbcType=INTEGER},
  148. </if>
  149. <if test="markPic != null" >
  150. #{markPic,jdbcType=VARCHAR},
  151. </if>
  152. <if test="buyType != null" >
  153. #{buyType,jdbcType=INTEGER},
  154. </if>
  155. </trim>
  156. </insert>
  157. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Headwear" >
  158. update headwear
  159. <set >
  160. <if test="headwearName != null" >
  161. headwear_name = #{headwearName,jdbcType=VARCHAR},
  162. </if>
  163. <if test="goldPrice != null" >
  164. gold_price = #{goldPrice,jdbcType=BIGINT},
  165. </if>
  166. <if test="seqNo != null" >
  167. seq_no = #{seqNo,jdbcType=INTEGER},
  168. </if>
  169. <if test="headwearStatus != null" >
  170. headwear_status = #{headwearStatus,jdbcType=TINYINT},
  171. </if>
  172. <if test="picUrl != null" >
  173. pic_url = #{picUrl,jdbcType=VARCHAR},
  174. </if>
  175. <if test="hasGifPic != null" >
  176. has_gif_pic = #{hasGifPic,jdbcType=BIT},
  177. </if>
  178. <if test="gifUrl != null" >
  179. gif_url = #{gifUrl,jdbcType=VARCHAR},
  180. </if>
  181. <if test="hasVggPic != null" >
  182. has_vgg_pic = #{hasVggPic,jdbcType=BIT},
  183. </if>
  184. <if test="vggUrl != null" >
  185. vgg_url = #{vggUrl,jdbcType=VARCHAR},
  186. </if>
  187. <if test="isTimeLimit != null" >
  188. is_time_limit = #{isTimeLimit,jdbcType=BIT},
  189. </if>
  190. <if test="effectiveTime != null" >
  191. effective_time = #{effectiveTime,jdbcType=BIGINT},
  192. </if>
  193. <if test="createTime != null" >
  194. create_time = #{createTime,jdbcType=TIMESTAMP},
  195. </if>
  196. <if test="allowPurse != null" >
  197. allow_purse = #{allowPurse,jdbcType=TINYINT},
  198. </if>
  199. <if test="leftLevel != null" >
  200. left_level = #{leftLevel,jdbcType=INTEGER},
  201. </if>
  202. <if test="markPic != null" >
  203. mark_pic = #{markPic,jdbcType=VARCHAR},
  204. </if>
  205. <if test="buyType != null" >
  206. buy_type = #{buyType,jdbcType=INTEGER},
  207. </if>
  208. </set>
  209. where headwear_id = #{headwearId,jdbcType=INTEGER}
  210. </update>
  211. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Headwear" >
  212. update headwear
  213. set headwear_name = #{headwearName,jdbcType=VARCHAR},
  214. gold_price = #{goldPrice,jdbcType=BIGINT},
  215. seq_no = #{seqNo,jdbcType=INTEGER},
  216. headwear_status = #{headwearStatus,jdbcType=TINYINT},
  217. pic_url = #{picUrl,jdbcType=VARCHAR},
  218. has_gif_pic = #{hasGifPic,jdbcType=BIT},
  219. gif_url = #{gifUrl,jdbcType=VARCHAR},
  220. has_vgg_pic = #{hasVggPic,jdbcType=BIT},
  221. vgg_url = #{vggUrl,jdbcType=VARCHAR},
  222. is_time_limit = #{isTimeLimit,jdbcType=BIT},
  223. effective_time = #{effectiveTime,jdbcType=BIGINT},
  224. create_time = #{createTime,jdbcType=TIMESTAMP},
  225. allow_purse = #{allowPurse,jdbcType=TINYINT},
  226. left_level = #{leftLevel,jdbcType=INTEGER},
  227. mark_pic = #{markPic,jdbcType=VARCHAR}
  228. where headwear_id = #{headwearId,jdbcType=INTEGER}
  229. </update>
  230. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  231. update headwear set del_flag = 2
  232. where headwear_id = #{headwearId,jdbcType=INTEGER}
  233. </delete>
  234. <select id="selectHeadWearByList" resultMap="BaseResultMap">
  235. select
  236. <include refid="Base_Column_List" />
  237. from headwear
  238. where del_flag = 1
  239. <if test="name != null and name != ''">
  240. and headwear_name LIKE CONCAT('%',#{name},'%')
  241. </if>
  242. <if test="status != null">
  243. and headwear_status = #{status}
  244. </if>
  245. <if test="type != null">
  246. and allow_purse = #{type}
  247. </if>
  248. <if test="buyType != null">
  249. and buy_type = #{buyType}
  250. </if>
  251. order by seq_no asc , create_time desc
  252. </select>
  253. <select id="selectByHeadWearName" resultMap="BaseResultMap">
  254. select
  255. <include refid="Base_Column_List" />
  256. from headwear
  257. where del_flag = 1 and headwear_name = #{headWearName}
  258. </select>
  259. <delete id="deleteHeadWearByIds" parameterType="java.lang.Long">
  260. update headwear set del_flag = 2 where headwear_id in
  261. <foreach collection="array" item="headwearId" open="(" separator="," close=")">
  262. #{headwearId}
  263. </foreach>
  264. </delete>
  265. <select id="selectHeadWearIdByValid" resultType="java.lang.String">
  266. SELECT headwear_id FROM headwear WHERE headwear_status = 1 AND del_flag = 1 ORDER BY seq_no ASC
  267. </select>
  268. <select id="selectHeadWearIdByValidMall" resultType="java.lang.String">
  269. SELECT headwear_id FROM headwear WHERE headwear_status = 1 AND del_flag = 1 AND allow_purse = 1 and buy_type = 1 ORDER BY seq_no ASC
  270. </select>
  271. <select id="selectHeadWearByValid" resultMap="BaseResultMap">
  272. select
  273. <include refid="Base_Column_List" />
  274. from headwear
  275. where del_flag = 1 AND headwear_status = 1 and buy_type = 1
  276. </select>
  277. <select id="selectHeadWearIdByValidPoint" resultType="java.lang.String">
  278. SELECT headwear_id FROM headwear WHERE headwear_status = 1 AND del_flag = 1 AND allow_purse = 1 and buy_type = 2 ORDER BY seq_no ASC
  279. </select>
  280. </mapper>