1
0

GoodsDao.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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.kmall.admin.dao.GoodsDao">
  4. <resultMap type="com.kmall.admin.entity.GoodsEntity" id="goodsMap">
  5. <result property="id" column="id"/>
  6. <result property="merchSn" column="merch_sn"/>
  7. <!--<result property="categoryId" column="category_id"/>-->
  8. <result property="goodsSn" column="goods_sn"/>
  9. <result property="name" column="name"/>
  10. <!--<result property="brandId" column="brand_id"/>-->
  11. <!--<result property="freightId" column="freight_id"/>-->
  12. <result property="brand" column="brand"/>
  13. <result property="goodsNumber" column="goods_number"/>
  14. <result property="keywords" column="keywords"/>
  15. <result property="goodsBrief" column="goods_brief"/>
  16. <result property="goodsDesc" column="goods_desc"/>
  17. <result property="isOnSale" column="is_on_sale"/>
  18. <result property="addTime" column="add_time"/>
  19. <result property="sortOrder" column="sort_order"/>
  20. <result property="isDelete" column="is_delete"/>
  21. <!--<result property="attributeCategory" column="attribute_category"/>-->
  22. <result property="counterPrice" column="counter_price"/>
  23. <result property="extraPrice" column="extra_price"/>
  24. <result property="isNew" column="is_new"/>
  25. <result property="goodsUnit" column="goods_unit"/>
  26. <result property="primaryPicUrl" column="primary_pic_url"/>
  27. <result property="listPicUrl" column="list_pic_url"/>
  28. <!--<result property="retailPrice" column="retail_price"/>-->
  29. <result property="sellVolume" column="sell_volume"/>
  30. <result property="primaryProductId" column="primary_product_id"/>
  31. <result property="unitPrice" column="unit_price"/>
  32. <result property="promotionDesc" column="promotion_desc"/>
  33. <result property="promotionTag" column="promotion_tag"/>
  34. <result property="appExclusivePrice" column="app_exclusive_price"/>
  35. <result property="isAppExclusive" column="is_app_exclusive"/>
  36. <result property="isLimited" column="is_limited"/>
  37. <result property="isHot" column="is_hot"/>
  38. <!--<result property="marketPrice" column="market_price"/>-->
  39. <result property="goodsType" column="goodsType"/>
  40. <result property="sku" column="sku"/>
  41. <result property="goodsBizType" column="goods_biz_type"/>
  42. <result column="creater_sn" property="createrSn" jdbcType="VARCHAR" />
  43. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  44. <result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
  45. <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
  46. <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
  47. <result property="prodBarcode" column="prod_barcode"/>
  48. <result property="unitCode" column="unit_code"/>
  49. <result property="goodsDesc" column="goods_desc"/>
  50. <result property="cusGoodsCode" column="cus_goods_code"/>
  51. <result property="ciqProdModel" column="ciq_prod_model"/>
  52. <result property="oriCntCode" column="ori_cnt_code"/>
  53. <result property="cusDeclEle" column="cus_decl_ele"/>
  54. <result property="cusRecCode" column="cus_rec_code"/>
  55. <result property="supplierId" column="supplier_id"/>
  56. <result property="stockNum" column="stock_num"/>
  57. <result property="storeName" column="store_name"/>
  58. <result property="productId" column="productId"/>
  59. <result property="storeId" column="storeId"/>
  60. <result column="merch_name" property="merchName" />
  61. <result column="storeMarketPrice" property="storeMarketPrice" />
  62. <result column="storeRetailPrice" property="storeRetailPrice" />
  63. <result column="third_party_merch_code" property="thirdPartyMerchCode" />
  64. <result column="isStockShare" property="isStockShare" />
  65. <result column="gross_weight" property="grossWeight" />
  66. <result column="net_weight" property="netWeight" />
  67. </resultMap>
  68. <select id="queryObject" resultType="com.kmall.admin.entity.GoodsEntity">
  69. SELECT
  70. a.*, CASE
  71. when g.id > 0 then 2 else 0 end as goodsType,
  72. mb.third_party_merch_code,
  73. mb.is_stock_share isStockShare,
  74. mb.is_supplier_goods 'isSupplierGoods'
  75. FROM
  76. mall_goods a
  77. LEFT JOIN mall_goods_group g ON g.goods_id = a.id AND g.open_status != 3
  78. LEFT JOIN third_merchant_biz mb ON a.third_party_merch_code = mb.third_party_merch_code
  79. WHERE a.id = #{value}
  80. </select>
  81. <select id="queryObjectByStoreId" resultMap="goodsMap">
  82. select
  83. a.sku,
  84. a.id,
  85. psr1.category_id,
  86. a.goods_sn,
  87. a.name,
  88. psr1.brand_id,
  89. a.goods_number,
  90. a.keywords,
  91. a.goods_brief,
  92. a.is_on_sale,
  93. a.add_time,
  94. a.sort_order,
  95. a.is_delete,
  96. psr1.attribute_category,
  97. a.counter_price,
  98. a.extra_price,
  99. a.is_new,
  100. a.goods_unit,
  101. a.primary_pic_url,
  102. a.list_pic_url,
  103. psr1.retail_price,
  104. psr1.sell_volume,
  105. a.primary_product_id,
  106. a.unit_price,
  107. a.promotion_desc,
  108. a.promotion_tag,
  109. a.app_exclusive_price,
  110. a.is_app_exclusive,
  111. a.is_limited,
  112. a.is_hot,
  113. a.merch_sn,
  114. m.merch_name,
  115. psr1.store_id,
  116. psr1.market_price,
  117. psr1.stock_num,
  118. a.goods_desc,a.goods_biz_type,a.goods_rate,
  119. a.sell_volume goods_sell_volume,
  120. mb.third_party_merch_code,
  121. mb.is_stock_share isStockShare,
  122. mb.is_supplier_goods 'isSupplierGoods',
  123. mb2.third_party_merch_code 'supplierThirdMerchCode',
  124. mb2.is_stock_share 'isStockShareBySuppler'
  125. from mall_goods a left join mall_merch m on a.merch_sn = m.merch_sn
  126. LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
  127. LEFT JOIN mall_store s ON s.id = psr1.store_id
  128. LEFT JOIN third_merchant_biz mb on s.third_party_merch_code = mb.third_party_merch_code
  129. LEFT JOIN third_merchant_biz mb2 ON a.third_party_merch_code = mb2.third_party_merch_code
  130. where a.id = #{id} and psr1.store_id = #{storeId}
  131. </select>
  132. <select id="queryObjectByProdBarcodeAndBizType" resultType="com.kmall.admin.entity.GoodsEntity">
  133. SELECT
  134. a.id,a.sku,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode,r.market_price storeMarketPrice,r.retail_price storeRetailPrice ,r.stock_num,s.store_name,r.product_id,s.id 'storeId'
  135. FROM
  136. mall_goods a
  137. LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
  138. inner join mall_store s on r.store_id=s.id
  139. where a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11 and r.store_id = #{storeId}
  140. </select>
  141. <select id="queryObjectByProdBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
  142. SELECT
  143. a.id,a.sku,a.goods_sn,a.name,a.list_pic_url,a.prod_barcode
  144. FROM
  145. mall_goods a
  146. where a.prod_barcode = #{prodBarcode}
  147. <if test="goodsId != null and goodsId != ''">
  148. AND a.id != #{goodsId}
  149. </if>
  150. <if test="merchSn != null and merchSn != ''">
  151. AND a.merch_sn = #{merchSn}
  152. </if>
  153. </select>
  154. <select id="queryObjectBySn" resultType="com.kmall.admin.entity.GoodsEntity">
  155. SELECT
  156. a.*, CASE
  157. when g.id > 0 then 2 else 0 end as goodsType
  158. FROM
  159. mall_goods a
  160. LEFT JOIN mall_goods_group g ON g.goods_id = a.id
  161. AND g.open_status != 3
  162. where a.goods_sn = #{goodsSn}
  163. </select>
  164. <select id="queryList" resultType="com.kmall.admin.entity.GoodsEntity">
  165. select
  166. mall_goods.*,
  167. case when mall_goods_group.id > 0 then 2 else 0 end as goodsType,
  168. m.merch_name merchName, mb.is_stock_share isStockShare
  169. from mall_goods
  170. left join mall_merch m on mall_goods.merch_sn = m.merch_sn
  171. left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
  172. left join third_merchant_biz mb on mb.third_party_merch_code = mall_goods.third_party_merch_code and mb.merch_sn=mall_goods.merch_sn
  173. WHERE 1=1
  174. <!-- 数据过滤 -->
  175. ${filterSql}
  176. <if test="merchSn != null and merchSn.trim() != ''">
  177. AND mall_goods.merch_sn = #{merchSn}
  178. </if>
  179. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  180. AND mall_goods.prod_barcode = #{prodBarcode}
  181. </if>
  182. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  183. AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
  184. </if>
  185. <if test="thirdMerchSn != null and thirdMerchSn.trim() != ''">
  186. AND mb.third_merch_sn = #{thirdMerchSn}
  187. </if>
  188. <if test="goodsSn != null and goodsSn != ''">
  189. AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
  190. </if>
  191. <if test="name != null and name != ''">
  192. AND mall_goods.name LIKE concat('%',#{name},'%')
  193. </if>
  194. <!--<if test="freightId != null and freightId != ''">
  195. AND mall_goods.freight_id = #{freightId}
  196. </if>
  197. <if test="brandId != null and brandId != ''">
  198. AND mall_goods.brand_id = #{brandId}
  199. </if>
  200. <if test="categoryId != null and categoryId != ''">
  201. AND mall_goods.category_id = #{categoryId}
  202. </if>-->
  203. <if test="sku != null and sku != ''">
  204. AND mall_goods.sku LIKE concat('%',#{sku},'%')
  205. </if>
  206. <!--<if test="category != null and category != ''">
  207. AND mall_goods.category_id IN (select id from mall_category where parent_id = #{category})
  208. </if>
  209. <if test="categoryTwo != null and categoryTwo != ''">
  210. AND mall_goods.category_id = #{categoryTwo}
  211. </if>-->
  212. <if test="isDelete != null">
  213. AND mall_goods.is_Delete = #{isDelete}
  214. </if>
  215. <if test="isOnSale != null">
  216. AND mall_goods.is_on_sale = #{isOnSale}
  217. </if>
  218. <if test="goodsBizType != null and goodsBizType != ''">
  219. AND mall_goods.goods_biz_type = #{goodsBizType}
  220. </if>
  221. <if test="id != null and id != ''">
  222. AND mall_goods.id = #{id}
  223. </if>
  224. <if test="storeId != null and storeId != ''">
  225. AND mall_goods.third_party_merch_code = ( SELECT third_party_merch_code FROM mall_store WHERE id = #{storeId} )
  226. AND mall_goods.id NOT IN (
  227. SELECT
  228. goods_id
  229. FROM
  230. mall_product_store_rela pp
  231. WHERE
  232. store_id = #{storeId}
  233. )
  234. </if>
  235. <if test="storeIdBySupplier != null and storeIdBySupplier != ''">
  236. AND mall_goods.id NOT IN (
  237. SELECT
  238. goods_id
  239. FROM
  240. mall_product_store_rela pp
  241. WHERE
  242. store_id = #{storeIdBySupplier} and supplier_third_id = #{thirdMerchSn}
  243. )
  244. </if>
  245. <choose>
  246. <when test="sidx != null and sidx.trim() != ''">
  247. order by ${sidx} ${order}
  248. </when>
  249. <otherwise>
  250. order by mall_goods.id desc
  251. </otherwise>
  252. </choose>
  253. <if test="offset != null and limit != null">
  254. limit #{offset}, #{limit}
  255. </if>
  256. </select>
  257. <select id="querySame" resultType="com.kmall.admin.entity.GoodsEntity">
  258. select
  259. mall_goods.*,
  260. case when mall_goods_group.id > 0 then 2 else 0 end as goodsType
  261. from mall_goods
  262. left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
  263. WHERE 1=1
  264. <!-- 数据过滤 -->
  265. ${filterSql}
  266. <if test="isSame != null and isSame != ''">
  267. AND ((mall_goods.sku = #{sku} AND mall_goods.goods_biz_type = #{goodsBizType}) OR mall_goods.goods_sn = #{goodsSn})
  268. <if test="id != null and id != ''">
  269. AND mall_goods.id != #{id}
  270. </if>
  271. </if>
  272. <choose>
  273. <when test="sidx != null and sidx.trim() != ''">
  274. order by ${sidx} ${order}
  275. </when>
  276. <otherwise>
  277. order by mall_goods.id desc
  278. </otherwise>
  279. </choose>
  280. <if test="offset != null and limit != null">
  281. limit #{offset}, #{limit}
  282. </if>
  283. </select>
  284. <select id="queryTotal" resultType="int">
  285. select count(*) from mall_goods
  286. left join mall_merch m on mall_goods.merch_sn = m.merch_sn
  287. left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
  288. WHERE 1=1
  289. <!-- 数据过滤 -->
  290. ${filterSql}
  291. <if test="merchSn != null and merchSn.trim() != ''">
  292. AND mall_goods.merch_sn = #{merchSn}
  293. </if>
  294. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  295. AND mall_goods.prod_barcode = #{prodBarcode}
  296. </if>
  297. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  298. AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
  299. </if>
  300. <if test="goodsSn != null and goodsSn != ''">
  301. AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
  302. </if>
  303. <if test="name != null and name != ''">
  304. AND mall_goods.name LIKE concat('%',#{name},'%')
  305. </if>
  306. <if test="sku != null and sku != ''">
  307. AND mall_goods.sku LIKE concat('%',#{sku},'%')
  308. </if>
  309. <if test="isDelete != null">
  310. AND mall_goods.is_Delete = #{isDelete}
  311. </if>
  312. <if test="isOnSale != null">
  313. AND mall_goods.is_on_sale = #{isOnSale}
  314. </if>
  315. <if test="goodsBizType != null and goodsBizType != ''">
  316. AND mall_goods.goods_biz_type = #{goodsBizType}
  317. </if>
  318. <if test="storeId != null and storeId != ''">
  319. AND mall_goods.third_party_merch_code = ( SELECT third_party_merch_code FROM mall_store WHERE id = #{storeId} )
  320. AND mall_goods.id NOT IN (
  321. SELECT
  322. goods_id
  323. FROM
  324. mall_product_store_rela pp
  325. LEFT JOIN mall_goods gg ON pp.goods_id = gg.id
  326. AND pp.merch_sn = gg.merch_sn
  327. AND pp.merch_sn
  328. LEFT JOIN mall_store s ON pp.store_id = s.id
  329. AND s.third_party_merch_code = gg.third_party_merch_code
  330. WHERE
  331. store_id = #{storeId}
  332. )
  333. </if>
  334. </select>
  335. <insert id="save" parameterType="com.kmall.admin.entity.GoodsEntity" useGeneratedKeys="true" keyProperty="id">
  336. insert into mall_goods(
  337. `merch_sn`,
  338. third_party_merch_code,
  339. `supplier_id`,
  340. `goods_sn`,
  341. `prod_barcode`,
  342. `sku`,
  343. `goods_biz_type`,
  344. `name`,
  345. `unit_code`,
  346. `brand`,
  347. `goods_number`,
  348. `keywords`,
  349. `goods_brief`,
  350. `goods_desc`,
  351. `cus_goods_code`,
  352. `ciq_prod_model`,
  353. `ori_cnt_code`,
  354. `cus_decl_ele`,
  355. `cus_rec_code`,
  356. `is_on_sale`,
  357. `add_time`,
  358. `sort_order`,
  359. `is_delete`,
  360. `counter_price`,
  361. `extra_price`,
  362. `is_new`,
  363. `goods_unit`,
  364. `primary_pic_url`,
  365. `list_pic_url`,
  366. `goods_rate`,
  367. `sell_volume`,
  368. `primary_product_id`,
  369. `unit_price`,
  370. `promotion_desc`,
  371. `promotion_tag`,
  372. `app_exclusive_price`,
  373. `is_app_exclusive`,
  374. `gross_weight`,
  375. `net_weight`,
  376. `is_limited`,
  377. `is_hot`,
  378. `creater_sn`,
  379. `create_time`,
  380. `moder_sn`,
  381. `mod_time`,
  382. `tstm`)
  383. values(
  384. #{merchSn},
  385. #{thirdPartyMerchCode},
  386. #{supplierId},
  387. #{goodsSn},
  388. #{prodBarcode},
  389. #{sku},
  390. #{goodsBizType},
  391. #{name},
  392. #{unitCode},
  393. #{brand},
  394. #{goodsNumber},
  395. #{keywords},
  396. #{goodsBrief},
  397. #{goodsDesc},
  398. #{cusGoodsCode},
  399. #{ciqProdModel},
  400. #{oriCntCode},
  401. #{cusDeclEle},
  402. #{cusRecCode},
  403. #{isOnSale},
  404. #{addTime},
  405. #{sortOrder},
  406. #{isDelete},
  407. #{counterPrice},
  408. #{extraPrice},
  409. #{isNew},
  410. #{goodsUnit},
  411. #{primaryPicUrl},
  412. #{listPicUrl},
  413. #{goodsRate},
  414. #{sellVolume},
  415. #{primaryProductId},
  416. #{unitPrice},
  417. #{promotionDesc},
  418. #{promotionTag},
  419. #{appExclusivePrice},
  420. #{isAppExclusive},
  421. #{grossWeight},
  422. #{netWeight},
  423. #{isLimited},
  424. #{isHot},
  425. #{createrSn},
  426. #{createTime},
  427. #{moderSn},
  428. #{modTime},
  429. #{tstm})
  430. </insert>
  431. <update id="update" parameterType="com.kmall.admin.entity.GoodsEntity">
  432. update mall_goods
  433. <set>
  434. <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
  435. <if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
  436. <if test="supplierId != null">`supplier_id` = #{supplierId}, </if>
  437. <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
  438. <if test="prodBarcode != null">`prod_barcode` = #{prodBarcode}, </if>
  439. <if test="sku != null">`sku` = #{sku}, </if>
  440. <if test="goodsBizType != null">`goods_biz_type` = #{goodsBizType}, </if>
  441. <if test="name != null">`name` = #{name}, </if>
  442. <if test="unitCode != null">`unit_code` = #{unitCode}, </if>
  443. <if test="brand != null">`brand` = #{brand}, </if>
  444. <if test="goodsNumber != null">`goods_number` = #{goodsNumber}, </if>
  445. <if test="keywords != null">`keywords` = #{keywords}, </if>
  446. <if test="goodsBrief != null">`goods_brief` = #{goodsBrief}, </if>
  447. <if test="goodsDesc != null">`goods_desc` = #{goodsDesc}, </if>
  448. <if test="cusGoodsCode != null">`cus_goods_code` = #{cusGoodsCode}, </if>
  449. <if test="ciqProdModel != null">`ciq_prod_model` = #{ciqProdModel}, </if>
  450. <if test="oriCntCode != null">`ori_cnt_code` = #{oriCntCode}, </if>
  451. <if test="cusDeclEle != null">`cus_decl_ele` = #{cusDeclEle}, </if>
  452. <if test="cusRecCode != null">`cus_rec_code` = #{cusRecCode}, </if>
  453. <if test="isOnSale != null">`is_on_sale` = #{isOnSale}, </if>
  454. <if test="addTime != null">`add_time` = #{addTime}, </if>
  455. <if test="sortOrder != null">`sort_order` = #{sortOrder}, </if>
  456. <if test="isDelete != null">`is_delete` = #{isDelete}, </if>
  457. <if test="counterPrice != null">`counter_price` = #{counterPrice}, </if>
  458. <if test="extraPrice != null">`extra_price` = #{extraPrice}, </if>
  459. <if test="isNew != null">`is_new` = #{isNew}, </if>
  460. <if test="goodsUnit != null">`goods_unit` = #{goodsUnit}, </if>
  461. <if test="primaryPicUrl != null">`primary_pic_url` = #{primaryPicUrl}, </if>
  462. <if test="listPicUrl != null">`list_pic_url` = #{listPicUrl}, </if>
  463. <if test="goodsRate != null">`goods_rate` = #{goodsRate}, </if>
  464. <if test="sellVolume != null">`sell_volume` = #{sellVolume}, </if>
  465. <if test="primaryProductId != null">`primary_product_id` = #{primaryProductId}, </if>
  466. <if test="unitPrice != null">`unit_price` = #{unitPrice}, </if>
  467. <if test="promotionDesc != null">`promotion_desc` = #{promotionDesc}, </if>
  468. <if test="promotionTag != null">`promotion_tag` = #{promotionTag}, </if>
  469. <if test="appExclusivePrice != null">`app_exclusive_price` = #{appExclusivePrice}, </if>
  470. <if test="isAppExclusive != null">`is_app_exclusive` = #{isAppExclusive}, </if>
  471. <if test="grossWeight != null">`gross_weight` = #{grossWeight}, </if>
  472. <if test="netWeight != null">`net_weight` = #{netWeight}, </if>
  473. <if test="isLimited != null">`is_limited` = #{isLimited}, </if>
  474. <if test="isHot != null">`is_hot` = #{isHot}, </if>
  475. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  476. <if test="createTime != null">`create_time` = #{createTime}, </if>
  477. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  478. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  479. <if test="tstm != null">`tstm` = #{tstm}</if>
  480. </set>
  481. where id = #{id}
  482. </update>
  483. <delete id="delete">
  484. delete from mall_goods where id = #{value}
  485. </delete>
  486. <delete id="deleteBatch">
  487. delete from mall_goods where id in
  488. <foreach item="id" collection="array" open="(" separator="," close=")">
  489. #{id}
  490. </foreach>
  491. </delete>
  492. <select id="queryMaxId" resultType="java.lang.Long" parameterType="map">
  493. SELECT MAX(id) FROM mall_goods
  494. </select>
  495. </mapper>