LotMapper.xml 24 KB

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