LotMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  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="cn.hobbystocks.auc.mapper.LotMapper">
  6. <resultMap type="cn.hobbystocks.auc.domain.Lot" id="LotResult">
  7. <result property="id" column="id" />
  8. <result property="goodsId" column="goods_id" />
  9. <result property="auctionId" column="auction_id" />
  10. <result property="name" column="name" />
  11. <result property="num" column="num" />
  12. <result property="unit" column="unit" />
  13. <result property="imgs" column="imgs" />
  14. <result property="detail" column="detail" />
  15. <result property="pubStatus" column="pub_status" />
  16. <result property="pubTime" column="pub_time" />
  17. <result property="status" column="status" />
  18. <result property="startTime" column="start_time" />
  19. <result property="endTime" column="end_time" />
  20. <result property="realEndTime" column="real_end_time" />
  21. <result property="ruleType" column="rule_type" />
  22. <result property="ruleContent" column="rule_content" />
  23. <result property="lastPrice" column="last_price" />
  24. <result property="lastPriceTime" column="last_price_time" />
  25. <result property="dealPrice" column="deal_price" />
  26. <result property="dealTime" column="deal_time" />
  27. <result property="dealAccountId" column="deal_account_id" />
  28. <result property="dealAccount" column="deal_account" />
  29. <result property="paid" column="paid" />
  30. <result property="bidCount" column="bid_count" />
  31. <result property="bidPersionCount" column="bid_persion_count" />
  32. <result property="delFlag" column="del_flag" />
  33. <result property="createBy" column="create_by" />
  34. <result property="createTime" column="create_time" />
  35. <result property="updateBy" column="update_by" />
  36. <result property="updateTime" column="update_time" />
  37. <result property="sort" column="sort" />
  38. <result property="carouselImgs" column="carousel_imgs"/>
  39. <result property="merchantId" column="merchant_id"/>
  40. <result property="merchantName" column="merchant_name"/>
  41. <result property="merchantAvatar" column="merchant_avatar"/>
  42. <result property="goodsName" column="goods_name"/>
  43. <result property="goodsType" column="goods_type"/>
  44. <result property="privateDomain" column="private_domain"/>
  45. <result property="delayPublish" column="delay_publish"/>
  46. <result property="groupId" column="group_id"/>
  47. <result property="deposit" column="deposit"/>
  48. <result property="serviceTariff" column="service_tariff"/>
  49. <result property="payTimeLimit" column="pay_time_limit"/>
  50. </resultMap>
  51. <sql id="selectLotVo">
  52. select id, goods_id, auction_id, name, num, unit, imgs, detail, pub_status, pub_time, status, start_time, end_time, real_end_time, rule_type, rule_content, last_price, last_price_time, deal_price, deal_time, deal_account_id, deal_account, paid, bid_count, bid_persion_count, del_flag, create_by, create_time, update_by, update_time, sort,
  53. carousel_imgs,merchant_id,merchant_name,merchant_avatar,goods_name,goods_type,private_domain,delay_publish,pub_status,group_id,deposit,service_tariff,pay_time_limit
  54. from lot
  55. </sql>
  56. <sql id="selectLotVoEx">
  57. select l.id, l.goods_id, l.auction_id, l.name, l.num, l.unit, l.imgs, l.detail,
  58. l.pub_status, l.pub_time, l.status, l.start_time, l.end_time, l.real_end_time, l.rule_type,
  59. l.rule_content, l.last_price, l.last_price_time, l.deal_price, l.deal_time, l.deal_account_id,
  60. l.deal_account, l.paid, l.bid_count, l.bid_persion_count, l.del_flag, l.create_by,
  61. l.create_time, l.update_by, l.update_time, l.sort,l.carousel_imgs,l.merchant_id,l.merchant_name,
  62. l.merchant_avatar,l.goods_name,l.goods_type,l.private_domain,l.group_id,l.live_id
  63. from
  64. lot l left join bid b on b.lot_id = l.id
  65. </sql>
  66. <select id="selectLotList" parameterType="cn.hobbystocks.auc.domain.Lot" resultMap="LotResult">
  67. <include refid="selectLotVo"/>
  68. <where>
  69. <if test="lot.name != null and lot.name != ''"> and name like concat('%', #{lot.name}, '%')</if>
  70. <if test="lot.pubStatus != null "> and pub_status = #{lot.pubStatus}</if>
  71. <if test="lot.auctionId!=null">and auction_id=#{lot.auctionId}</if>
  72. </where>
  73. order by sort desc,id desc
  74. </select>
  75. <select id="selectLotByGroupIds" parameterType="Long" resultMap="LotResult">
  76. <include refid="selectLotVo"/>
  77. <where>
  78. <foreach collection="lotGroupIds" index="index" item="lotGroupId" open="id in (" separator="," close=")">
  79. #{lotGroupId}
  80. </foreach>
  81. and del_flag &lt;&gt; 1
  82. </where>
  83. </select>
  84. <select id="selectLotById" parameterType="Long" resultMap="LotResult">
  85. <include refid="selectLotVo"/>
  86. where id = #{id} and del_flag &lt;&gt; 1
  87. </select>
  88. <select id="selectLotByAucId" parameterType="Long" resultMap="LotResult">
  89. <include refid="selectLotVo"/>
  90. where auction_id = #{id} and del_flag &lt;&gt; 1
  91. order by last_price_time desc
  92. </select>
  93. <insert id="insertLot" parameterType="cn.hobbystocks.auc.domain.Lot" useGeneratedKeys="true" keyProperty="id">
  94. insert into lot
  95. <trim prefix="(" suffix=")" suffixOverrides=",">
  96. <if test="id != null">id,</if>
  97. <if test="goodsId != null">goods_id,</if>
  98. <if test="auctionId != null">auction_id,</if>
  99. <if test="name != null">name,</if>
  100. <if test="num != null">num,</if>
  101. <if test="unit != null">unit,</if>
  102. <if test="imgs != null">imgs,</if>
  103. <if test="detail != null">detail,</if>
  104. <if test="pubStatus != null">pub_status,</if>
  105. <if test="pubTime != null">pub_time,</if>
  106. <if test="status != null">status,</if>
  107. <if test="startTime != null">start_time,</if>
  108. <if test="endTime != null">end_time,</if>
  109. <if test="realEndTime != null">real_end_time,</if>
  110. <if test="ruleType != null and ruleType != ''">rule_type,</if>
  111. <if test="ruleContent != null and ruleContent != ''">rule_content,</if>
  112. <if test="lastPrice != null">last_price,</if>
  113. <if test="lastPriceTime != null">last_price_time,</if>
  114. <if test="dealPrice != null">deal_price,</if>
  115. <if test="dealTime != null">deal_time,</if>
  116. <if test="dealAccountId != null">deal_account_id,</if>
  117. <if test="dealAccount != null">deal_account,</if>
  118. <if test="paid != null">paid,</if>
  119. <if test="bidCount != null">bid_count,</if>
  120. <if test="bidPersionCount != null">bid_persion_count,</if>
  121. <if test="delFlag != null">del_flag,</if>
  122. <if test="createBy != null">create_by,</if>
  123. <if test="createTime != null">create_time,</if>
  124. <if test="updateBy != null">update_by,</if>
  125. <if test="updateTime != null">update_time,</if>
  126. <if test="sort != null">sort,</if>
  127. <if test="carouselImgs != null">carousel_imgs,</if>
  128. <if test="merchantId != null">merchant_id,</if>
  129. <if test="merchantName != null">merchant_name,</if>
  130. <if test="merchantAvatar != null">merchant_avatar,</if>
  131. <if test="goodsName != null">goods_name,</if>
  132. <if test="goodsType != null">goods_type,</if>
  133. <if test="privateDomain != null">private_domain,</if>
  134. <if test="delayPublish != null">delay_publish,</if>
  135. <if test="groupId != null ">group_id,</if>
  136. <if test="deposit !=null ">deposit,</if>
  137. <if test="serviceTariff !=null ">service_tariff,</if>
  138. <if test="payTimeLimit!=null">pay_limit_time,</if>
  139. </trim>
  140. <trim prefix="values (" suffix=")" suffixOverrides=",">
  141. <if test="id != null">#{id},</if>
  142. <if test="goodsId != null">#{goodsId},</if>
  143. <if test="auctionId != null">#{auctionId},</if>
  144. <if test="name != null">#{name},</if>
  145. <if test="num != null">#{num},</if>
  146. <if test="unit != null">#{unit},</if>
  147. <if test="imgs != null">#{imgs},</if>
  148. <if test="detail != null">#{detail},</if>
  149. <if test="pubStatus != null">#{pubStatus},</if>
  150. <if test="pubTime != null">#{pubTime},</if>
  151. <if test="status != null">#{status},</if>
  152. <if test="startTime != null">#{startTime},</if>
  153. <if test="endTime != null">#{endTime},</if>
  154. <if test="realEndTime != null">#{realEndTime},</if>
  155. <if test="ruleType != null and ruleType != ''">#{ruleType},</if>
  156. <if test="ruleContent != null and ruleContent != ''">#{ruleContent},</if>
  157. <if test="lastPrice != null">#{lastPrice},</if>
  158. <if test="lastPriceTime != null">#{lastPriceTime},</if>
  159. <if test="dealPrice != null">#{dealPrice},</if>
  160. <if test="dealTime != null">#{dealTime},</if>
  161. <if test="dealAccountId != null">#{dealAccountId},</if>
  162. <if test="dealAccount != null">#{dealAccount},</if>
  163. <if test="paid != null">#{paid},</if>
  164. <if test="bidCount != null">#{bidCount},</if>
  165. <if test="bidPersionCount != null">#{bidPersionCount},</if>
  166. <if test="delFlag != null">#{delFlag},</if>
  167. <if test="createBy != null">#{createBy},</if>
  168. <if test="createTime != null">#{createTime},</if>
  169. <if test="updateBy != null">#{updateBy},</if>
  170. <if test="updateTime != null">#{updateTime},</if>
  171. <if test="sort != null">#{sort},</if>
  172. <if test="carouselImgs != null">#{carouselImgs},</if>
  173. <if test="merchantId != null">#{merchantId},</if>
  174. <if test="merchantName != null">#{merchantName},</if>
  175. <if test="merchantAvatar != null">#{merchantAvatar},</if>
  176. <if test="goodsName != null">#{goodsName},</if>
  177. <if test="goodsType != null">#{goodsType},</if>
  178. <if test="privateDomain != null">#{privateDomain},</if>
  179. <if test="delayPublish != null">#{delayPublish},</if>
  180. <if test="groupId != null ">#{groupId},</if>
  181. <if test="deposit !=null ">#{deposit},</if>
  182. <if test="serviceTariff !=null ">#{serviceTariff},</if>
  183. <if test="payTimeLimit!=null">#{payTimeLimit},</if>
  184. </trim>
  185. </insert>
  186. <insert id="insertLotClone" parameterType="cn.hobbystocks.auc.domain.Lot" useGeneratedKeys="true" keyProperty="id">
  187. insert into lot
  188. <trim prefix="(" suffix=")" suffixOverrides=",">
  189. <if test="goodsId != null">goods_id,</if>
  190. <if test="auctionId != null">auction_id,</if>
  191. <if test="name != null">name,</if>
  192. <if test="num != null">num,</if>
  193. <if test="unit != null">unit,</if>
  194. <if test="imgs != null">imgs,</if>
  195. <if test="detail != null">detail,</if>
  196. <if test="pubStatus != null">pub_status,</if>
  197. <if test="status != null">status,</if>
  198. <if test="startTime != null">start_time,</if>
  199. <if test="endTime != null">end_time,</if>
  200. <if test="ruleType != null and ruleType != ''">rule_type,</if>
  201. <if test="ruleContent != null and ruleContent != ''">rule_content,</if>
  202. <if test="delFlag != null">del_flag,</if>
  203. <if test="createBy != null">create_by,</if>
  204. <if test="createTime != null">create_time,</if>
  205. <if test="sort != null">sort,</if>
  206. <if test="carouselImgs != null">carousel_imgs,</if>
  207. <if test="merchantId != null">merchant_id,</if>
  208. <if test="merchantName != null">merchant_name,</if>
  209. <if test="merchantAvatar != null">merchant_avatar,</if>
  210. <if test="goodsName != null">goods_name,</if>
  211. <if test="goodsType != null">goods_type,</if>
  212. <if test="privateDomain != null">private_domain,</if>
  213. <if test="delayPublish != null">delay_publish,</if>
  214. <if test="groupId != null ">group_id,</if>
  215. <if test="deposit !=null ">deposit,</if>
  216. <if test="serviceTariff !=null ">service_tariff,</if>
  217. <if test="payTimeLimit!=null">pay_time_limit,</if>
  218. </trim>
  219. <trim prefix="values (" suffix=")" suffixOverrides=",">
  220. <if test="goodsId != null">#{goodsId},</if>
  221. <if test="auctionId != null">#{auctionId},</if>
  222. <if test="name != null">#{name},</if>
  223. <if test="num != null">#{num},</if>
  224. <if test="unit != null">#{unit},</if>
  225. <if test="imgs != null">#{imgs},</if>
  226. <if test="detail != null">#{detail},</if>
  227. <if test="pubStatus != null">#{pubStatus},</if>
  228. <if test="status != null">#{status},</if>
  229. <if test="startTime != null">#{startTime},</if>
  230. <if test="endTime != null">#{endTime},</if>
  231. <if test="ruleType != null and ruleType != ''">#{ruleType},</if>
  232. <if test="ruleContent != null and ruleContent != ''">#{ruleContent},</if>
  233. <if test="delFlag != null">#{delFlag},</if>
  234. <if test="createBy != null">#{createBy},</if>
  235. <if test="createTime != null">#{createTime},</if>
  236. <if test="sort != null">#{sort},</if>
  237. <if test="carouselImgs != null">#{carouselImgs},</if>
  238. <if test="merchantId != null">#{merchantId},</if>
  239. <if test="merchantName != null">#{merchantName},</if>
  240. <if test="merchantAvatar != null">#{merchantAvatar},</if>
  241. <if test="goodsName != null">#{goodsName},</if>
  242. <if test="goodsType != null">#{goodsType},</if>
  243. <if test="privateDomain != null">#{privateDomain},</if>
  244. <if test="delayPublish != null">#{delayPublish},</if>
  245. <if test="groupId != null ">#{groupId},</if>
  246. <if test="deposit !=null ">#{deposit},</if>
  247. <if test="serviceTariff !=null ">#{serviceTariff},</if>
  248. <if test="payTimeLimit!=null">#{payTimeLimit},</if>
  249. </trim>
  250. </insert>
  251. <update id="updateLot" parameterType="cn.hobbystocks.auc.domain.Lot">
  252. update lot
  253. <trim prefix="SET" suffixOverrides=",">
  254. <if test="goodsId != null">goods_id = #{goodsId},</if>
  255. <if test="auctionId != null">auction_id = #{auctionId},</if>
  256. <if test="name != null">name = #{name},</if>
  257. <if test="num != null">num = #{num},</if>
  258. <if test="unit != null">unit = #{unit},</if>
  259. <if test="imgs != null">imgs = #{imgs},</if>
  260. <if test="detail != null">detail = #{detail},</if>
  261. <if test="pubStatus != null">pub_status = #{pubStatus},</if>
  262. <if test="pubTime != null">pub_time = #{pubTime},</if>
  263. <if test="status != null">status = #{status},</if>
  264. <if test="startTime != null">start_time = #{startTime},</if>
  265. <if test="endTime != null">end_time = #{endTime},</if>
  266. <if test="realEndTime != null">real_end_time = #{realEndTime},</if>
  267. <if test="ruleType != null and ruleType != ''">rule_type = #{ruleType},</if>
  268. <if test="ruleContent != null and ruleContent != ''">rule_content = #{ruleContent},</if>
  269. <if test="lastPrice != null">last_price = #{lastPrice},</if>
  270. <if test="lastPriceTime != null">last_price_time = #{lastPriceTime},</if>
  271. <if test="dealPrice != null">deal_price = #{dealPrice},</if>
  272. <if test="dealTime != null">deal_time = #{dealTime},</if>
  273. <if test="dealAccountId != null">deal_account_id = #{dealAccountId},</if>
  274. <if test="dealAccount != null">deal_account = #{dealAccount},</if>
  275. <if test="paid != null">paid = #{paid},</if>
  276. <if test="bidCount != null">bid_count = #{bidCount},</if>
  277. <if test="bidPersionCount != null">bid_persion_count = #{bidPersionCount},</if>
  278. <if test="delFlag != null">del_flag = #{delFlag},</if>
  279. <if test="createBy != null">create_by = #{createBy},</if>
  280. <if test="createTime != null">create_time = #{createTime},</if>
  281. <if test="updateBy != null">update_by = #{updateBy},</if>
  282. <if test="updateTime != null">update_time = #{updateTime},</if>
  283. <if test="sort != null">sort = #{sort},</if>
  284. <if test="carouselImgs != null">carousel_imgs = #{carouselImgs},</if>
  285. <if test="merchantId != null">merchant_id = #{merchantId},</if>
  286. <if test="merchantName != null">merchant_name = #{merchantName},</if>
  287. <if test="merchantAvatar != null">merchant_avatar = #{merchantAvatar},</if>
  288. <if test="goodsName != null">goods_name = #{goodsName},</if>
  289. <if test="goodsType != null">goods_type = #{goodsType},</if>
  290. <if test="privateDomain != null">private_domain = #{privateDomain},</if>
  291. <if test="delayPublish != null">delay_publish = #{delayPublish},</if>
  292. <if test="groupId != null ">group_id = #{groupId},</if>
  293. <if test="deposit !=null ">deposit=#{deposit},</if>
  294. <if test="serviceTariff !=null ">service_tariff=#{serviceTariff},</if>
  295. <if test="payTimeLimit!=null">pay_time_limit=#{payTimeLimit},</if>
  296. </trim>
  297. where id = #{id}
  298. </update>
  299. <update id="updateLotView" parameterType="cn.hobbystocks.auc.domain.Lot">
  300. update lot
  301. <trim prefix="SET" suffixOverrides=",">
  302. <if test="goodsId != null">goods_id = #{goodsId},</if>
  303. <if test="auctionId != null">auction_id = #{auctionId},</if>
  304. <if test="name != null">name = #{name},</if>
  305. <if test="num != null">num = #{num},</if>
  306. <if test="unit != null">unit = #{unit},</if>
  307. <if test="imgs != null">imgs = #{imgs},</if>
  308. <if test="detail != null">detail = #{detail},</if>
  309. <if test="pubStatus != null">pub_status = #{pubStatus},</if>
  310. <if test="pubTime != null">pub_time = #{pubTime},</if>
  311. <if test="status != null">status = #{status},</if>
  312. <if test="startTime != null">start_time = #{startTime},</if>
  313. <if test="endTime != null">end_time = #{endTime},</if>
  314. <if test="realEndTime != null">real_end_time = #{realEndTime},</if>
  315. <if test="ruleType != null and ruleType != ''">rule_type = #{ruleType},</if>
  316. <if test="ruleContent != null and ruleContent != ''">rule_content = #{ruleContent},</if>
  317. <if test="lastPrice != null">last_price = #{lastPrice},</if>
  318. <if test="lastPriceTime != null">last_price_time = #{lastPriceTime},</if>
  319. <if test="dealPrice != null">deal_price = #{dealPrice},</if>
  320. <if test="dealTime != null">deal_time = #{dealTime},</if>
  321. <if test="dealAccountId != null">deal_account_id = #{dealAccountId},</if>
  322. <if test="dealAccount != null">deal_account = #{dealAccount},</if>
  323. <if test="paid != null">paid = #{paid},</if>
  324. <if test="bidCount != null">bid_count = #{bidCount},</if>
  325. <if test="bidPersionCount != null">bid_persion_count = #{bidPersionCount},</if>
  326. <if test="delFlag != null">del_flag = #{delFlag},</if>
  327. <if test="createBy != null">create_by = #{createBy},</if>
  328. <if test="createTime != null">create_time = #{createTime},</if>
  329. <if test="updateBy != null">update_by = #{updateBy},</if>
  330. <if test="updateTime != null">update_time = #{updateTime},</if>
  331. <if test="sort != null">sort = #{sort},</if>
  332. <if test="carouselImgs != null">carousel_imgs = #{carouselImgs},</if>
  333. <if test="merchantId != null">merchant_id = #{merchantId},</if>
  334. <if test="merchantName != null">merchant_name = #{merchantName},</if>
  335. <if test="merchantAvatar != null">merchant_avatar = #{merchantAvatar},</if>
  336. <if test="goodsName != null">goods_name = #{goodsName},</if>
  337. <if test="goodsType != null">goods_type = #{goodsType},</if>
  338. <if test="privateDomain != null">private_domain = #{privateDomain},</if>
  339. <if test="1==1">delay_publish = #{delayPublish},</if>
  340. <if test="groupId != null ">group_id = #{groupId},</if>
  341. <if test="deposit !=null ">deposit=#{deposit},</if>
  342. <if test="serviceTariff !=null ">service_tariff=#{serviceTariff},</if>
  343. <if test="payTimeLimit!=null">pay_time_limit=#{payTimeLimit},</if>
  344. </trim>
  345. where id = #{id}
  346. </update>
  347. <select id="selectBidding" resultMap="LotResult">
  348. select id, auction_id
  349. from
  350. lot
  351. where
  352. status in ('Waiting','Starting','Bidding') and del_flag &lt;&gt; 1 and pub_status = 1
  353. and start_time is not null and end_time is not null
  354. </select>
  355. <select id="selectByLiveIdAndInStatus" resultMap="LotResult">
  356. select id
  357. from
  358. lot
  359. where
  360. status in
  361. <foreach item="status" collection="statusList" open="(" separator="," close=")">
  362. #{status}
  363. </foreach>
  364. and del_flag &lt;&gt; 1 and pub_status = 1
  365. </select>
  366. <select id="selectLotFinishOrWin" resultMap="LotResult">
  367. <include refid="selectLotVoEx"/>
  368. where
  369. l.status = 'Sold'
  370. and b.account_id = #{userId}
  371. <if test="win != null and win == 1">
  372. and b.status = 1
  373. </if>
  374. group by l.id
  375. order by l.last_price_time desc
  376. </select>
  377. <select id="selectCancel" resultMap="LotResult">
  378. select id, auction_id
  379. from
  380. lot
  381. where
  382. status = 'Cancelled' and del_flag &lt;&gt; 1
  383. </select>
  384. <select id="selectLotByGroupId" resultMap="LotResult">
  385. <include refid="selectLotVo"/>
  386. where group_id = #{groupId} and del_flag &lt;&gt; 1 order by id desc
  387. </select>
  388. <update id="updatePay">
  389. update lot set paid = #{paid} where id = #{lotId}
  390. </update>
  391. <update id="updateLotEx" parameterType="cn.hobbystocks.auc.domain.Lot">
  392. update lot
  393. <trim prefix="SET" suffixOverrides=",">
  394. <if test="goodsId != null">goods_id = #{goodsId},</if>
  395. <if test="name != null">name = #{name},</if>
  396. <if test="num != null">num = #{num},</if>
  397. <if test="unit != null">unit = #{unit},</if>
  398. <if test="imgs != null">imgs = #{imgs},</if>
  399. <if test="detail != null">detail = #{detail},</if>
  400. <if test="startTime != null">start_time = #{startTime},</if>
  401. <if test="endTime != null">end_time = #{endTime},</if>
  402. <if test="updateBy != null">update_by = #{updateBy},</if>
  403. <if test="updateTime != null">update_time = #{updateTime},</if>
  404. <if test="sort != null">sort = #{sort},</if>
  405. <if test="carouselImgs != null">carousel_imgs = #{carouselImgs},</if>
  406. <if test="merchantId != null">merchant_id = #{merchantId},</if>
  407. <if test="merchantName != null">merchant_name = #{merchantName},</if>
  408. <if test="merchantAvatar != null">merchant_avatar = #{merchantAvatar},</if>
  409. <if test="goodsName != null">goods_name = #{goodsName},</if>
  410. <if test="goodsType != null">goods_type = #{goodsType},</if>
  411. <if test="privateDomain != null">private_domain = #{privateDomain},</if>
  412. <if test="1 == 1">delay_publish = #{delayPublish},</if>
  413. <if test="groupId != null ">group_id = #{groupId},</if>
  414. <if test="deposit !=null ">deposit=#{deposit},</if>
  415. <if test="serviceTariff !=null ">service_tariff=#{serviceTariff},</if>
  416. <if test="payTimeLimit!=null">pay_time_limit=#{payTimeLimit},</if>
  417. </trim>
  418. where id = #{id}
  419. </update>
  420. <delete id="deleteLotById" parameterType="Long">
  421. delete from lot where id = #{id}
  422. </delete>
  423. <delete id="deleteLotByIds" parameterType="String">
  424. delete from lot where id in
  425. <foreach item="id" collection="array" open="(" separator="," close=")">
  426. #{id}
  427. </foreach>
  428. </delete>
  429. <select id="dynamicLot" resultMap="LotResult">
  430. <include refid="selectLotVo"/>
  431. where delay_publish is not null and delay_publish &lt;&gt; '' and del_flag &lt;&gt; 1
  432. </select>
  433. <select id="selectNotEndLotList" resultMap="LotResult">
  434. select id, auction_id
  435. from
  436. lot
  437. where
  438. status in ('Waiting','Starting','Bidding') and del_flag &lt;&gt; 1 and pub_status = 1
  439. and auction_id=#{auctionId}
  440. </select>
  441. <select id="countLotByAucId" resultType="long" parameterType="long">
  442. select count(*) from lot where auction_id=#{auctionId} and del_flag &lt;&gt; 1
  443. </select>
  444. </mapper>