GoodsDao.xml 21 KB

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