GoodsDao.xml 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  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. <result column="cost_price" property="costPrice"/>
  69. <result property="dailyPrice" column="daily_price"/>
  70. <result column="last_sale_time" property="lastSaleTime" jdbcType="TIMESTAMP"/>
  71. <result column="mychem_id" property="mychemId"/>
  72. <result column="hs_code" property="hsCode"/>
  73. <result column="hs_code_name" property="hsCodeName"/>
  74. <result column="is_sync_hs_code" property="isSyncHsCode"/>
  75. <result column="is_sync_goods_rate" property="isSyncGoodsRate"/>
  76. <result column="imp_consum_tax_rate" property="impConsumTaxRate"/>
  77. <result column="value_added_tax_rate" property="valueAddedTaxRate"/>
  78. <result column="legal_unit1_qty" property="legalUnit1Qty"/>
  79. <result column="legal_unit2_qty" property="legalUnit2Qty"/>
  80. <result column="cosm_threshold_value" property="cosmThresholdValue"/>
  81. <result column="to_be_restored" property="toBeRestored" />
  82. </resultMap>
  83. <select id="queryObject" resultType="com.kmall.admin.entity.GoodsEntity">
  84. SELECT
  85. a.*, CASE
  86. when g.id > 0 then 2 else 0 end as goodsType,
  87. mb.third_party_merch_code,
  88. mb.is_stock_share isStockShare,
  89. mb.is_supplier_goods 'isSupplierGoods'
  90. FROM
  91. mall_goods a
  92. LEFT JOIN mall_goods_group g ON g.goods_id = a.id AND g.open_status != 3
  93. LEFT JOIN third_merchant_biz mb ON a.third_party_merch_code = mb.third_party_merch_code
  94. WHERE a.id = #{value}
  95. </select>
  96. <select id="queryObjectByStoreId" resultMap="goodsMap">
  97. select
  98. a.sku,
  99. a.id,
  100. psr1.category_id,
  101. a.goods_sn,
  102. a.name,
  103. psr1.brand_id,
  104. a.goods_number,
  105. a.keywords,
  106. a.goods_brief,
  107. a.is_on_sale,
  108. a.add_time,
  109. a.sort_order,
  110. a.is_delete,
  111. psr1.attribute_category,
  112. a.counter_price,
  113. a.extra_price,
  114. a.is_new,
  115. a.goods_unit,
  116. a.primary_pic_url,
  117. a.list_pic_url,
  118. psr1.retail_price,
  119. psr1.sell_volume,
  120. a.primary_product_id,
  121. a.unit_price,
  122. a.promotion_desc,
  123. a.promotion_tag,
  124. a.app_exclusive_price,
  125. a.is_app_exclusive,
  126. a.is_limited,
  127. a.is_hot,
  128. a.merch_sn,
  129. a.to_be_restored,
  130. m.merch_name,
  131. psr1.store_id,
  132. psr1.market_price,
  133. psr1.stock_num,
  134. a.goods_desc,a.goods_biz_type,a.goods_rate,
  135. a.sell_volume goods_sell_volume,
  136. mb.third_party_merch_code,
  137. mb.is_stock_share isStockShare,
  138. mb.is_supplier_goods 'isSupplierGoods',
  139. mb2.third_party_merch_code 'supplierThirdMerchCode',
  140. mb2.is_stock_share 'isStockShareBySuppler',
  141. a.hs_code, a.legal_unit1_qty, a.legal_unit2_qty,a.ciq_prod_model
  142. from mall_goods a left join mall_merch m on a.merch_sn = m.merch_sn
  143. LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
  144. LEFT JOIN mall_store s ON s.id = psr1.store_id
  145. LEFT JOIN third_merchant_biz mb on s.third_party_merch_code = mb.third_party_merch_code
  146. LEFT JOIN third_merchant_biz mb2 ON a.third_party_merch_code = mb2.third_party_merch_code
  147. where a.id = #{id} and psr1.store_id = #{storeId}
  148. </select>
  149. <select id="queryGoodsByGoodsSnAndStoreId" resultMap="goodsMap">
  150. select
  151. a.sku,
  152. a.id,
  153. psr1.category_id,
  154. a.goods_sn,
  155. a.name,
  156. psr1.brand_id,
  157. a.goods_number,
  158. a.keywords,
  159. a.goods_brief,
  160. a.is_on_sale,
  161. a.add_time,
  162. a.sort_order,
  163. a.is_delete,
  164. psr1.attribute_category,
  165. a.counter_price,
  166. a.extra_price,
  167. a.is_new,
  168. a.goods_unit,
  169. a.primary_pic_url,
  170. a.list_pic_url,
  171. psr1.retail_price,
  172. psr1.sell_volume,
  173. a.primary_product_id,
  174. a.unit_price,
  175. a.promotion_desc,
  176. a.promotion_tag,
  177. a.app_exclusive_price,
  178. a.is_app_exclusive,
  179. a.is_limited,
  180. a.is_hot,
  181. a.merch_sn,
  182. a.to_be_restored,
  183. m.merch_name,
  184. psr1.store_id,
  185. psr1.market_price,
  186. psr1.stock_num,
  187. a.goods_desc,a.goods_biz_type,a.goods_rate,
  188. a.sell_volume goods_sell_volume,
  189. mb.third_party_merch_code,
  190. mb.is_stock_share isStockShare,
  191. mb.is_supplier_goods 'isSupplierGoods',
  192. mb2.third_party_merch_code 'supplierThirdMerchCode',
  193. mb2.is_stock_share 'isStockShareBySuppler',
  194. a.hs_code, a.legal_unit1_qty, a.legal_unit2_qty,a.ciq_prod_model
  195. from mall_goods a left join mall_merch m on a.merch_sn = m.merch_sn
  196. LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
  197. LEFT JOIN mall_store s ON s.id = psr1.store_id
  198. LEFT JOIN third_merchant_biz mb on s.third_party_merch_code = mb.third_party_merch_code
  199. LEFT JOIN third_merchant_biz mb2 ON a.third_party_merch_code = mb2.third_party_merch_code
  200. where a.goods_sn = #{goodsSn} and psr1.store_id = #{storeId}
  201. </select>
  202. <select id="queryObjectByProdBarcodeAndBizType" resultType="com.kmall.admin.entity.GoodsEntity">
  203. SELECT
  204. 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',
  205. a.hs_code as hsCode , a.legal_unit1_qty as legalUnit1Qty , a.legal_unit2_qty as legalUnit2Qty,a.ciq_prod_model as ciqProdModel,a.to_be_restored
  206. FROM
  207. mall_goods a
  208. LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
  209. inner join mall_store s on r.store_id=s.id
  210. where a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11 and r.store_id = #{storeId}
  211. </select>
  212. <select id="queryObjectByProdBarcodeAndStore" resultType="com.kmall.admin.entity.GoodsEntity">
  213. SELECT
  214. a.id,a.sku,a.goods_number,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',a.goods_rate as goodsRate,
  215. a.hs_code as hsCode , a.legal_unit1_qty as legalUnit1Qty , a.legal_unit2_qty as legalUnit2Qty,a.ciq_prod_model as ciqProdModel,a.to_be_restored
  216. FROM
  217. mall_goods a
  218. LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
  219. inner join mall_store s on r.store_id=s.id
  220. where a.prod_barcode = #{prodBarcode} and r.store_id = #{storeId}
  221. and r.stock_num > 0
  222. limit 1
  223. </select>
  224. <select id="queryObjectByProdBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
  225. SELECT
  226. 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',
  227. a.hs_code as hsCode , a.legal_unit1_qty as legalUnit1Qty , a.legal_unit2_qty as legalUnit2Qty,a.ciq_prod_model as ciqProdModel,a.to_be_restored
  228. FROM
  229. mall_goods a
  230. LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
  231. inner join mall_store s on r.store_id=s.id
  232. where a.prod_barcode = #{prodBarcode} and a.is_delete = 0
  233. <if test="goodsId != null and goodsId != ''">
  234. AND a.id != #{goodsId}
  235. </if>
  236. <if test="merchSn != null and merchSn != ''">
  237. AND a.merch_sn = #{merchSn}
  238. </if>
  239. </select>
  240. <select id="queryGoodsDetailsByProdBarcode" resultType="com.kmall.admin.dto.GoodsDetailsDto">
  241. SELECT distinct
  242. a.goods_sn as GoodsSn,m.retail_price as retailPrice,a.prod_barcode as prodBarcode,a.name,a.brand,a.goods_desc as goodsDesc,a.goods_unit as goodsUnit,a.goods_rate as goodsRate,a.primary_pic_url ,m.stock_num as stockNum,r.value as specification
  243. ,a.hs_code as hsCode , a.legal_unit1_qty as legalUnit1Qty , a.legal_unit2_qty as legalUnit2Qty,a.ciq_prod_model as ciqProdModel,a.to_be_restored
  244. FROM
  245. mall_goods a
  246. LEFT JOIN mall_goods_specification r ON r.goods_id = a.id
  247. left join mall_product_store_rela m on m.goods_id = a.id and r.goods_id = m.goods_id
  248. where a.prod_barcode = #{prodBarcode} and m.store_id = #{storeId}
  249. and m.stock_num > 0 order by m.stock_num desc
  250. limit 1
  251. </select>
  252. <select id="queryObjectBySn" resultType="com.kmall.admin.entity.GoodsEntity">
  253. SELECT
  254. a.*, CASE
  255. when g.id > 0 then 2 else 0 end as goodsType
  256. FROM
  257. mall_goods a
  258. LEFT JOIN mall_goods_group g ON g.goods_id = a.id
  259. AND g.open_status != 3
  260. where a.goods_sn = #{goodsSn}
  261. </select>
  262. <select id="queryList" resultType="com.kmall.admin.entity.GoodsEntity">
  263. select * from (
  264. select
  265. mall_goods.*,
  266. case when mall_goods_group.id > 0 then 2 else 0 end as goodsType,
  267. m.merch_name merchName, mb.is_stock_share isStockShare,
  268. catagory.keywords as categoryName
  269. from mall_goods
  270. left join mall_merch m on mall_goods.merch_sn = m.merch_sn
  271. left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
  272. left join third_merchant_biz mb on mb.third_party_merch_code = mall_goods.third_party_merch_code and
  273. mb.merch_sn=mall_goods.merch_sn
  274. left join mall_category catagory on catagory.id = mall_goods.category_id
  275. WHERE 1=1
  276. <!-- 数据过滤 -->
  277. ${filterSql}
  278. <if test="merchSn != null and merchSn.trim() != ''">
  279. AND mall_goods.merch_sn = #{merchSn}
  280. </if>
  281. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  282. AND mall_goods.prod_barcode = #{prodBarcode}
  283. </if>
  284. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  285. AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
  286. </if>
  287. <if test="thirdMerchSn != null and thirdMerchSn.trim() != ''">
  288. AND mb.third_merch_sn = #{thirdMerchSn}
  289. </if>
  290. <if test="goodsSn != null and goodsSn != ''">
  291. AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
  292. </if>
  293. <if test="name != null and name != ''">
  294. AND mall_goods.name LIKE concat('%',#{name},'%')
  295. </if>
  296. <if test="englishName != null and englishName != ''">
  297. AND mall_goods.english_name LIKE concat('%',#{englishName},'%')
  298. </if>
  299. <!--<if test="brandId != null and brandId != ''">
  300. AND mall_goods.brand_id = #{brandId}
  301. </if>
  302. <if test="freightId != null and freightId != ''">
  303. AND mall_goods.freight_id = #{freightId}
  304. </if>
  305. <if test="categoryId != null and categoryId != ''">
  306. AND mall_goods.category_id = #{categoryId}
  307. </if>
  308. <if test="category != null and category != ''">
  309. AND mall_goods.category_id IN (select id from mall_category where parent_id = #{category})
  310. </if>
  311. <if test="categoryTwo != null and categoryTwo != ''">
  312. AND mall_goods.category_id = #{categoryTwo}
  313. </if>-->
  314. <if test="sku != null and sku != ''">
  315. AND mall_goods.sku LIKE concat('%',#{sku},'%')
  316. </if>
  317. <if test="plu != null and plu != ''">
  318. AND mall_goods.plu LIKE concat('%',#{plu},'%')
  319. </if>
  320. <if test="isDelete != null">
  321. AND mall_goods.is_Delete = #{isDelete}
  322. </if>
  323. <if test="isOnSale != null">
  324. AND mall_goods.is_on_sale = #{isOnSale}
  325. </if>
  326. <if test="goodsBizType != null and goodsBizType != ''">
  327. AND mall_goods.goods_biz_type = #{goodsBizType}
  328. </if>
  329. <if test="id != null and id != ''">
  330. AND mall_goods.id = #{id}
  331. </if>
  332. <if test="storeId != null and storeId != ''">
  333. AND mall_goods.third_party_merch_code = ( SELECT third_party_merch_code FROM mall_store WHERE id =
  334. #{storeId} )
  335. AND mall_goods.id NOT IN (
  336. SELECT
  337. goods_id
  338. FROM
  339. mall_product_store_rela pp
  340. WHERE
  341. store_id = #{storeId}
  342. )
  343. </if>
  344. <if test="storeIdBySupplier != null and storeIdBySupplier != ''">
  345. AND mall_goods.id NOT IN (
  346. SELECT
  347. goods_id
  348. FROM
  349. mall_product_store_rela pp
  350. WHERE
  351. store_id = #{storeIdBySupplier} and supplier_third_id = #{thirdMerchSn}
  352. )
  353. </if>
  354. ) temp where 1=1
  355. <if test="lastSaleTime != null and lastSaleTime != ''">
  356. AND temp.last_sale_time &gt;= #{lastSaleTime} or temp.last_sale_time is null
  357. </if>
  358. <choose>
  359. <when test="sidx != null and sidx.trim() != ''">
  360. order by ${sidx} ${order}
  361. </when>
  362. <otherwise>
  363. order by temp.id desc
  364. </otherwise>
  365. </choose>
  366. <if test="offset != null and limit != null">
  367. limit #{offset}, #{limit}
  368. </if>
  369. </select>
  370. <select id="querySame" resultType="com.kmall.admin.entity.GoodsEntity">
  371. select
  372. mall_goods.*,
  373. case when mall_goods_group.id > 0 then 2 else 0 end as goodsType
  374. from mall_goods
  375. left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
  376. WHERE 1=1
  377. <!-- 数据过滤 -->
  378. ${filterSql}
  379. <if test="isSame != null and isSame != ''">
  380. AND ((mall_goods.sku = #{sku} AND mall_goods.goods_biz_type = #{goodsBizType}) OR mall_goods.goods_sn =
  381. #{goodsSn})
  382. <if test="id != null and id != ''">
  383. AND mall_goods.id != #{id}
  384. </if>
  385. </if>
  386. <choose>
  387. <when test="sidx != null and sidx.trim() != ''">
  388. order by ${sidx} ${order}
  389. </when>
  390. <otherwise>
  391. order by mall_goods.id desc
  392. </otherwise>
  393. </choose>
  394. <if test="offset != null and limit != null">
  395. limit #{offset}, #{limit}
  396. </if>
  397. </select>
  398. <select id="queryTotal" resultType="int">
  399. select count(*) from mall_goods
  400. left join mall_merch m on mall_goods.merch_sn = m.merch_sn
  401. left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
  402. WHERE 1=1
  403. <!-- 数据过滤 -->
  404. ${filterSql}
  405. <if test="merchSn != null and merchSn.trim() != ''">
  406. AND mall_goods.merch_sn = #{merchSn}
  407. </if>
  408. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  409. AND mall_goods.prod_barcode = #{prodBarcode}
  410. </if>
  411. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  412. AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
  413. </if>
  414. <if test="goodsSn != null and goodsSn != ''">
  415. AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
  416. </if>
  417. <if test="name != null and name != ''">
  418. AND mall_goods.name LIKE concat('%',#{name},'%')
  419. </if>
  420. <if test="sku != null and sku != ''">
  421. AND mall_goods.sku LIKE concat('%',#{sku},'%')
  422. </if>
  423. <if test="isDelete != null">
  424. AND mall_goods.is_Delete = #{isDelete}
  425. </if>
  426. <if test="isOnSale != null">
  427. AND mall_goods.is_on_sale = #{isOnSale}
  428. </if>
  429. <if test="goodsBizType != null and goodsBizType != ''">
  430. AND mall_goods.goods_biz_type = #{goodsBizType}
  431. </if>
  432. <if test="storeId != null and storeId != ''">
  433. AND mall_goods.third_party_merch_code = ( SELECT third_party_merch_code FROM mall_store WHERE id =
  434. #{storeId} )
  435. AND mall_goods.id NOT IN (
  436. SELECT
  437. goods_id
  438. FROM
  439. mall_product_store_rela pp
  440. LEFT JOIN mall_goods gg ON pp.goods_id = gg.id
  441. AND pp.merch_sn = gg.merch_sn
  442. AND pp.merch_sn
  443. LEFT JOIN mall_store s ON pp.store_id = s.id
  444. AND s.third_party_merch_code = gg.third_party_merch_code
  445. WHERE
  446. store_id = #{storeId}
  447. )
  448. </if>
  449. </select>
  450. <insert id="save" parameterType="com.kmall.admin.entity.GoodsEntity" useGeneratedKeys="true" keyProperty="id">
  451. insert into mall_goods(
  452. `merch_sn`,
  453. third_party_merch_code,
  454. `supplier_id`,
  455. `goods_sn`,
  456. `prod_barcode`,
  457. `sku`,
  458. `plu`,
  459. `english_name`,
  460. `cost_price`,
  461. `daily_price`,
  462. `goods_biz_type`,
  463. `name`,
  464. `unit_code`,
  465. `brand`,
  466. `goods_number`,
  467. `keywords`,
  468. `goods_brief`,
  469. `goods_desc`,
  470. `cus_goods_code`,
  471. `ciq_prod_model`,
  472. `ori_cnt_code`,
  473. `cus_decl_ele`,
  474. `cus_rec_code`,
  475. `is_on_sale`,
  476. `add_time`,
  477. `sort_order`,
  478. `is_delete`,
  479. `counter_price`,
  480. `extra_price`,
  481. `is_new`,
  482. `goods_unit`,
  483. `primary_pic_url`,
  484. `list_pic_url`,
  485. `goods_rate`,
  486. `sell_volume`,
  487. `primary_product_id`,
  488. `unit_price`,
  489. `promotion_desc`,
  490. `promotion_tag`,
  491. `app_exclusive_price`,
  492. `is_app_exclusive`,
  493. `gross_weight`,
  494. `net_weight`,
  495. is_goods_share_stock,
  496. `is_limited`,
  497. `is_hot`,
  498. `creater_sn`,
  499. `create_time`,
  500. `moder_sn`,
  501. `mod_time`,
  502. `mychem_id`,
  503. `hs_code`,
  504. `hs_code_name`,
  505. `is_sync_hs_code`,
  506. `is_sync_goods_rate`,
  507. `imp_consum_tax_rate`,
  508. `value_added_tax_rate`,
  509. `legal_unit1_qty`,
  510. `legal_unit2_qty`,
  511. `cosm_threshold_value`,
  512. `to_be_restored`,
  513. `tstm`)
  514. values(
  515. #{merchSn},
  516. #{thirdPartyMerchCode},
  517. #{supplierId},
  518. #{goodsSn},
  519. #{prodBarcode},
  520. #{sku},
  521. #{plu},
  522. #{englishName},
  523. #{costPrice},
  524. #{dailyPrice},
  525. #{goodsBizType},
  526. #{name},
  527. #{unitCode},
  528. #{brand},
  529. #{goodsNumber},
  530. #{keywords},
  531. #{goodsBrief},
  532. #{goodsDesc},
  533. #{cusGoodsCode},
  534. #{ciqProdModel},
  535. #{oriCntCode},
  536. #{cusDeclEle},
  537. #{cusRecCode},
  538. #{isOnSale},
  539. #{addTime},
  540. #{sortOrder},
  541. #{isDelete},
  542. #{counterPrice},
  543. #{extraPrice},
  544. #{isNew},
  545. #{goodsUnit},
  546. #{primaryPicUrl},
  547. #{listPicUrl},
  548. #{goodsRate},
  549. #{sellVolume},
  550. #{primaryProductId},
  551. #{unitPrice},
  552. #{promotionDesc},
  553. #{promotionTag},
  554. #{appExclusivePrice},
  555. #{isAppExclusive},
  556. #{grossWeight},
  557. #{netWeight},
  558. #{isGoodsShareStock},
  559. #{isLimited},
  560. #{isHot},
  561. #{createrSn},
  562. #{createTime},
  563. #{moderSn},
  564. #{modTime},
  565. #{mychemId},
  566. #{hsCode},
  567. #{hsCodeName},
  568. '0',
  569. '0',
  570. #{impConsumTaxRate},
  571. #{valueAddedTaxRate},
  572. #{legalUnit1Qty},
  573. #{legalUnit2Qty},
  574. #{cosmThresholdValue},
  575. #{toBeRestored},
  576. #{tstm})
  577. </insert>
  578. <update id="update" parameterType="com.kmall.admin.entity.GoodsEntity">
  579. update mall_goods
  580. <set>
  581. <if test="merchSn != null">`merch_sn` = #{merchSn},</if>
  582. <if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode},</if>
  583. <if test="supplierId != null">`supplier_id` = #{supplierId},</if>
  584. <if test="goodsSn != null">`goods_sn` = #{goodsSn},</if>
  585. <if test="prodBarcode != null">`prod_barcode` = #{prodBarcode},</if>
  586. <if test="sku != null">`sku` = #{sku},</if>
  587. <if test="plu != null">`plu` = #{plu},</if>
  588. <if test="englishName != null">`english_name` = #{englishName},</if>
  589. <if test="costPrice != null">`cost_price` = #{costPrice},</if>
  590. <if test="dailyPrice != null">`daily_price` = #{dailyPrice},</if>
  591. <if test="goodsBizType != null">`goods_biz_type` = #{goodsBizType},</if>
  592. <if test="name != null">`name` = #{name},</if>
  593. <if test="unitCode != null">`unit_code` = #{unitCode},</if>
  594. <if test="brand != null">`brand` = #{brand},</if>
  595. <if test="goodsNumber != null">`goods_number` = #{goodsNumber},</if>
  596. <if test="keywords != null">`keywords` = #{keywords},</if>
  597. <if test="goodsBrief != null">`goods_brief` = #{goodsBrief},</if>
  598. <if test="goodsDesc != null">`goods_desc` = #{goodsDesc},</if>
  599. <if test="cusGoodsCode != null">`cus_goods_code` = #{cusGoodsCode},</if>
  600. <if test="ciqProdModel != null">`ciq_prod_model` = #{ciqProdModel},</if>
  601. <if test="oriCntCode != null">`ori_cnt_code` = #{oriCntCode},</if>
  602. <if test="cusDeclEle != null">`cus_decl_ele` = #{cusDeclEle},</if>
  603. <if test="cusRecCode != null">`cus_rec_code` = #{cusRecCode},</if>
  604. <if test="isOnSale != null">`is_on_sale` = #{isOnSale},</if>
  605. <if test="addTime != null">`add_time` = #{addTime},</if>
  606. <if test="sortOrder != null">`sort_order` = #{sortOrder},</if>
  607. <if test="isDelete != null">`is_delete` = #{isDelete},</if>
  608. <if test="counterPrice != null">`counter_price` = #{counterPrice},</if>
  609. <if test="extraPrice != null">`extra_price` = #{extraPrice},</if>
  610. <if test="isNew != null">`is_new` = #{isNew},</if>
  611. <if test="goodsUnit != null">`goods_unit` = #{goodsUnit},</if>
  612. <if test="primaryPicUrl != null">`primary_pic_url` = #{primaryPicUrl},</if>
  613. <if test="listPicUrl != null">`list_pic_url` = #{listPicUrl},</if>
  614. <if test="goodsRate != null">`goods_rate` = #{goodsRate},</if>
  615. <if test="sellVolume != null">`sell_volume` = #{sellVolume},</if>
  616. <if test="primaryProductId != null">`primary_product_id` = #{primaryProductId},</if>
  617. <if test="unitPrice != null">`unit_price` = #{unitPrice},</if>
  618. <if test="promotionDesc != null">`promotion_desc` = #{promotionDesc},</if>
  619. <if test="promotionTag != null">`promotion_tag` = #{promotionTag},</if>
  620. <if test="appExclusivePrice != null">`app_exclusive_price` = #{appExclusivePrice},</if>
  621. <if test="isAppExclusive != null">`is_app_exclusive` = #{isAppExclusive},</if>
  622. <if test="grossWeight != null">`gross_weight` = #{grossWeight},</if>
  623. <if test="netWeight != null">`net_weight` = #{netWeight},</if>
  624. <if test="isGoodsShareStock != null">`is_goods_share_stock` = #{isGoodsShareStock},</if>
  625. <if test="isLimited != null">`is_limited` = #{isLimited},</if>
  626. <if test="isHot != null">`is_hot` = #{isHot},</if>
  627. <if test="createrSn != null">`creater_sn` = #{createrSn},</if>
  628. <if test="createTime != null">`create_time` = #{createTime},</if>
  629. <if test="moderSn != null">`moder_sn` = #{moderSn},</if>
  630. <if test="modTime != null">`mod_time` = #{modTime},</if>
  631. <if test="tstm != null">`tstm` = #{tstm},</if>
  632. <if test="lastSaleTime != null">`last_sale_time` = #{lastSaleTime},</if>
  633. <if test="mychemId != null">`mychem_id` = #{mychemId},</if>
  634. <if test="hsCode != null">`hs_code` = #{hsCode},</if>
  635. <if test="hsCodeName != null">`hs_code_name` = #{hsCodeName},</if>
  636. <if test="isSyncHsCode != null">`is_sync_hs_code` = #{isSyncHsCode},</if>
  637. <if test="isSyncGoodsRate != null">`is_sync_goods_rate` = #{isSyncGoodsRate},</if>
  638. <if test="impConsumTaxRate != null">`imp_consum_tax_rate` = #{impConsumTaxRate},</if>
  639. <if test="valueAddedTaxRate != null">`value_added_tax_rate` = #{valueAddedTaxRate},</if>
  640. <if test="legalUnit1Qty != null">`legal_unit1_qty` = #{legalUnit1Qty},</if>
  641. <if test="legalUnit2Qty != null">`legal_unit2_qty` = #{legalUnit2Qty},</if>
  642. <if test="cosmThresholdValue != null">`cosm_threshold_value` = #{cosmThresholdValue},</if>
  643. <if test="toBeRestored != null">`to_be_restored` = #{toBeRestored}</if>
  644. </set>
  645. where id = #{id}
  646. </update>
  647. <delete id="delete">
  648. delete from mall_goods where id = #{value}
  649. </delete>
  650. <delete id="deleteBatch">
  651. delete from mall_goods where id in
  652. <foreach item="id" collection="array" open="(" separator="," close=")">
  653. #{id}
  654. </foreach>
  655. </delete>
  656. <select id="queryMaxId" resultType="java.lang.Long" parameterType="map">
  657. SELECT MAX(id) FROM mall_goods
  658. </select>
  659. <select id="searchGoodsPanoramaDtoByKeyword" resultType="com.kmall.admin.dto.GoodsPanoramaDto">
  660. SELECT
  661. g.id id,g.name `name`,g.name simpleName,g.ciq_prod_model ciqProdModel,
  662. g.goods_unit goodsBasicUnit,g.category_id categoryId,c.name categoryName,
  663. g.goods_unit goodsPurchaseUnit,g.supplier_id supplierId,s.child_supplier_name supplierName,
  664. g.prod_barcode prodBarcode,g.plu plu,g.goods_sn goodsSn,g.brand brand
  665. FROM
  666. mall_goods g
  667. INNER JOIN mall_category c
  668. INNER JOIN mall_supplier s
  669. WHERE
  670. g.category_id = c.id
  671. and g.supplier_id = s.id
  672. AND (g.goods_sn=#{keyword} OR g.prod_barcode=#{keyword})
  673. </select>
  674. <select id="queryExportList" resultType="com.kmall.admin.entity.GoodsEntity">
  675. select * from (
  676. select
  677. mall_goods.*,
  678. case when mall_goods_group.id > 0 then 2 else 0 end as goodsType,
  679. m.merch_name merchName, mb.is_stock_share isStockShare,
  680. catagory.keywords as categoryName,
  681. scnc.`name` as oriCntName
  682. from mall_goods
  683. left join mall_merch m on mall_goods.merch_sn = m.merch_sn
  684. left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
  685. left join third_merchant_biz mb on mb.third_party_merch_code = mall_goods.third_party_merch_code and
  686. mb.merch_sn=mall_goods.merch_sn
  687. left join mall_category catagory on catagory.id = mall_goods.category_id
  688. left join sys_cus_nation_code scnc on mall_goods.ori_cnt_code = scnc.code
  689. WHERE 1=1
  690. <!-- 数据过滤 -->
  691. ${filterSql}
  692. <if test="merchSn != null and merchSn.trim() != ''">
  693. AND mall_goods.merch_sn = #{merchSn}
  694. </if>
  695. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  696. AND mall_goods.prod_barcode = #{prodBarcode}
  697. </if>
  698. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  699. AND mall_goods.third_party_merch_code = #{thirdPartyMerchCode}
  700. </if>
  701. <if test="goodsSn != null and goodsSn != ''">
  702. AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
  703. </if>
  704. <if test="name != null and name != ''">
  705. AND mall_goods.name LIKE concat('%',#{name},'%')
  706. </if>
  707. <if test="englishName != null and englishName != ''">
  708. AND mall_goods.english_name LIKE concat('%',#{englishName},'%')
  709. </if>
  710. <if test="goodsBizType != null and goodsBizType != ''">
  711. AND mall_goods.goods_biz_type = #{goodsBizType}
  712. </if>
  713. <if test="isDelete != null">
  714. AND mall_goods.is_Delete = #{isDelete}
  715. </if>
  716. ) temp
  717. where 1=1
  718. <if test="lastSaleTime != null and lastSaleTime != ''">
  719. AND temp.last_sale_time &gt;= #{lastSaleTime} or temp.last_sale_time is null
  720. </if>
  721. </select>
  722. <select id="queryForPDFData" resultType="com.kmall.api.entity.exportpdf.PDFGoodsDto">
  723. select
  724. g.name as productName,
  725. g.english_name as englishName,
  726. rela.retail_price as price,
  727. IFNULL((rela.market_price - rela.retail_price ),0) as savings,
  728. g.goods_rate as startFax,
  729. g.goods_rate as endFax,
  730. g.plu as plu,
  731. g.prod_barcode as barCode
  732. from
  733. mall_goods g
  734. left join mall_product_store_rela rela on g.id = rela.goods_id
  735. <where>
  736. <if test="sku != null and sku != ''">
  737. and g.sku = #{sku}
  738. </if>
  739. <if test="prodBarcode != null and prodBarcode != ''">
  740. and g.prod_barcode = #{prodBarcode}
  741. </if>
  742. <if test="storeId != null and storeId != ''">
  743. and rela.store_id = #{storeId}
  744. </if>
  745. </where>
  746. </select>
  747. <select id="queryByBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
  748. select *
  749. from mall_goods
  750. where prod_barcode = #{barCode}
  751. </select>
  752. <select id="queryBySku" resultType="com.kmall.admin.entity.GoodsEntity">
  753. select *
  754. from mall_goods
  755. where sku = #{sku}
  756. </select>
  757. <select id="queryListByBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
  758. SELECT
  759. a.id,a.sku,a.goods_number,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',a.goods_rate as goodsRate,
  760. a.hs_code as hsCode , a.legal_unit1_qty as legalUnit1Qty , a.legal_unit2_qty as legalUnit2Qty,a.ciq_prod_model as ciqProdModel,a.to_be_restored
  761. FROM
  762. mall_goods a
  763. LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
  764. inner join mall_store s on r.store_id=s.id
  765. where a.prod_barcode = #{prodBarcode} and r.store_id = #{storeId}
  766. and r.stock_num > 0 order by r.stock_num desc
  767. </select>
  768. <select id="queryByName" resultType="com.kmall.admin.entity.GoodsEntity">
  769. SELECT DISTINCT
  770. g.id,
  771. g.NAME,
  772. g.sku,
  773. g.prod_barcode
  774. FROM
  775. mall_product_store_rela r
  776. LEFT JOIN mall_goods g ON g.id = r.goods_id
  777. WHERE
  778. r.store_id = #{storeId}
  779. <if test="goodsName != null and goodsName != ''">
  780. AND g.NAME LIKE concat('%',#{goodsName},'%');
  781. </if>
  782. </select>
  783. <select id="queryNonSyncOmsHsCodeSkuList" resultType="java.lang.String">
  784. select sku
  785. from mall_goods
  786. where is_sync_hs_code = '0'
  787. </select>
  788. <select id="queryListBySku" resultType="com.kmall.admin.entity.GoodsEntity">
  789. select *
  790. from mall_goods
  791. where sku = #{sku}
  792. </select>
  793. <select id="queryNonSyncOmsGoodsRateSkuList" resultType="com.kmall.admin.entity.GoodsEntity">
  794. select *
  795. from mall_goods
  796. where is_sync_goods_rate = '0'
  797. </select>
  798. <select id="queryAllList" resultType="com.kmall.admin.entity.GoodsEntity">
  799. select * from mall_goods
  800. </select>
  801. <select id="queryByBarcodeAndSku" resultType="com.kmall.admin.entity.GoodsEntity">
  802. select * from mall_goods where
  803. goods_sn = #{goodsSn} and prod_barcode = #{prodBarcode}
  804. </select>
  805. <select id="querySpecialCosmetics" resultType="com.kmall.admin.entity.GoodsEntity">
  806. SELECT distinct
  807. a.*,
  808. m.retail_price as retailPrice,
  809. m.stock_num as stockNum,
  810. m.store_id as storeId
  811. FROM
  812. mall_goods a
  813. left join mall_product_store_rela m on m.goods_id = a.id
  814. <where>
  815. a.cus_rec_code in
  816. <foreach collection="hdCodeSet" item="item" open="(" close=")" separator=",">
  817. #{item}
  818. </foreach>
  819. </where>
  820. </select>
  821. <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
  822. insert into mall_goods(
  823. `merch_sn`,
  824. third_party_merch_code,
  825. `supplier_id`,
  826. `goods_sn`,
  827. `prod_barcode`,
  828. `sku`,
  829. `plu`,
  830. `english_name`,
  831. `cost_price`,
  832. `daily_price`,
  833. `goods_biz_type`,
  834. `name`,
  835. `unit_code`,
  836. `brand`,
  837. `goods_number`,
  838. `keywords`,
  839. `goods_brief`,
  840. `goods_desc`,
  841. `cus_goods_code`,
  842. `ciq_prod_model`,
  843. `ori_cnt_code`,
  844. `cus_decl_ele`,
  845. `cus_rec_code`,
  846. `is_on_sale`,
  847. `add_time`,
  848. `sort_order`,
  849. `is_delete`,
  850. `counter_price`,
  851. `extra_price`,
  852. `is_new`,
  853. `goods_unit`,
  854. `primary_pic_url`,
  855. `list_pic_url`,
  856. `goods_rate`,
  857. `sell_volume`,
  858. `primary_product_id`,
  859. `unit_price`,
  860. `promotion_desc`,
  861. `promotion_tag`,
  862. `app_exclusive_price`,
  863. `is_app_exclusive`,
  864. `gross_weight`,
  865. `net_weight`,
  866. is_goods_share_stock,
  867. `is_limited`,
  868. `is_hot`,
  869. `creater_sn`,
  870. `create_time`,
  871. `moder_sn`,
  872. `mod_time`,
  873. `mychem_id`,
  874. `hs_code`,
  875. `hs_code_name`,
  876. `is_sync_hs_code`,
  877. `is_sync_goods_rate`,
  878. `imp_consum_tax_rate`,
  879. `value_added_tax_rate`,
  880. `legal_unit1_qty`,
  881. `legal_unit2_qty`,
  882. `cosm_threshold_value`,
  883. `to_be_restored`,
  884. `tstm`)
  885. values
  886. <foreach collection="list" index="index" item="item" separator=",">
  887. (
  888. #{item.merchSn},
  889. #{item.thirdPartyMerchCode},
  890. #{item.supplierId},
  891. #{item.goodsSn},
  892. #{item.prodBarcode},
  893. #{item.sku},
  894. #{item.plu},
  895. #{item.englishName},
  896. #{item.costPrice},
  897. #{item.dailyPrice},
  898. #{item.goodsBizType},
  899. #{item.name},
  900. #{item.unitCode},
  901. #{item.brand},
  902. #{item.goodsNumber},
  903. #{item.keywords},
  904. #{item.goodsBrief},
  905. #{item.goodsDesc},
  906. #{item.cusGoodsCode},
  907. #{item.ciqProdModel},
  908. #{item.oriCntCode},
  909. #{item.cusDeclEle},
  910. #{item.cusRecCode},
  911. #{item.isOnSale},
  912. #{item.addTime},
  913. #{item.sortOrder},
  914. #{item.isDelete},
  915. #{item.counterPrice},
  916. #{item.extraPrice},
  917. #{item.isNew},
  918. #{item.goodsUnit},
  919. #{item.primaryPicUrl},
  920. #{item.listPicUrl},
  921. #{item.goodsRate},
  922. #{item.sellVolume},
  923. #{item.primaryProductId},
  924. #{item.unitPrice},
  925. #{item.promotionDesc},
  926. #{item.promotionTag},
  927. #{item.appExclusivePrice},
  928. #{item.isAppExclusive},
  929. #{item.grossWeight},
  930. #{item.netWeight},
  931. #{item.isGoodsShareStock},
  932. #{item.isLimited},
  933. #{item.isHot},
  934. #{item.createrSn},
  935. #{item.createTime},
  936. #{item.moderSn},
  937. #{item.modTime},
  938. #{item.mychemId},
  939. #{item.hsCode},
  940. #{item.hsCodeName},
  941. '0',
  942. '0',
  943. #{item.impConsumTaxRate},
  944. #{item.valueAddedTaxRate},
  945. #{item.legalUnit1Qty},
  946. #{item.legalUnit2Qty},
  947. #{item.cosmThresholdValue},
  948. #{item.toBeRestored},
  949. #{item.tstm})
  950. </foreach>
  951. </insert>
  952. <update id="updateBatch" parameterType="java.util.List">
  953. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  954. update mall_goods
  955. <set>
  956. <if test="item.merchSn != null">`merch_sn` = #{item.merchSn},</if>
  957. <if test="item.thirdPartyMerchCode != null">`third_party_merch_code` = #{item.thirdPartyMerchCode},</if>
  958. <if test="item.supplierId != null">`supplier_id` = #{item.supplierId},</if>
  959. <if test="item.goodsSn != null">`goods_sn` = #{item.goodsSn},</if>
  960. <if test="item.prodBarcode != null">`prod_barcode` = #{item.prodBarcode},</if>
  961. <if test="item.sku != null">`sku` = #{item.sku},</if>
  962. <if test="item.plu != null">`plu` = #{item.plu},</if>
  963. <if test="item.englishName != null">`english_name` = #{item.englishName},</if>
  964. <if test="item.costPrice != null">`cost_price` = #{item.costPrice},</if>
  965. <if test="item.dailyPrice != null">`daily_price` = #{item.dailyPrice},</if>
  966. <if test="item.goodsBizType != null">`goods_biz_type` = #{item.goodsBizType},</if>
  967. <if test="item.name != null">`name` = #{item.name},</if>
  968. <if test="item.unitCode != null">`unit_code` = #{item.unitCode},</if>
  969. <if test="item.brand != null">`brand` = #{item.brand},</if>
  970. <if test="item.goodsNumber != null">`goods_number` = #{item.goodsNumber},</if>
  971. <if test="item.keywords != null">`keywords` = #{item.keywords},</if>
  972. <if test="item.goodsBrief != null">`goods_brief` = #{item.goodsBrief},</if>
  973. <if test="item.goodsDesc != null">`goods_desc` = #{item.goodsDesc},</if>
  974. <if test="item.cusGoodsCode != null">`cus_goods_code` = #{item.cusGoodsCode},</if>
  975. <if test="item.ciqProdModel != null">`ciq_prod_model` = #{item.ciqProdModel},</if>
  976. <if test="item.oriCntCode != null">`ori_cnt_code` = #{item.oriCntCode},</if>
  977. <if test="item.cusDeclEle != null">`cus_decl_ele` = #{item.cusDeclEle},</if>
  978. <if test="item.cusRecCode != null">`cus_rec_code` = #{item.cusRecCode},</if>
  979. <if test="item.isOnSale != null">`is_on_sale` = #{item.isOnSale},</if>
  980. <if test="item.addTime != null">`add_time` = #{item.addTime},</if>
  981. <if test="item.sortOrder != null">`sort_order` = #{item.sortOrder},</if>
  982. <if test="item.isDelete != null">`is_delete` = #{item.isDelete},</if>
  983. <if test="item.counterPrice != null">`counter_price` = #{item.counterPrice},</if>
  984. <if test="item.extraPrice != null">`extra_price` = #{item.extraPrice},</if>
  985. <if test="item.isNew != null">`is_new` = #{item.isNew},</if>
  986. <if test="item.goodsUnit != null">`goods_unit` = #{item.goodsUnit},</if>
  987. <if test="item.primaryPicUrl != null">`primary_pic_url` = #{item.primaryPicUrl},</if>
  988. <if test="item.listPicUrl != null">`list_pic_url` = #{item.listPicUrl},</if>
  989. <if test="item.goodsRate != null">`goods_rate` = #{item.goodsRate},</if>
  990. <if test="item.sellVolume != null">`sell_volume` = #{item.sellVolume},</if>
  991. <if test="item.primaryProductId != null">`primary_product_id` = #{item.primaryProductId},</if>
  992. <if test="item.unitPrice != null">`unit_price` = #{item.unitPrice},</if>
  993. <if test="item.promotionDesc != null">`promotion_desc` = #{item.promotionDesc},</if>
  994. <if test="item.promotionTag != null">`promotion_tag` = #{item.promotionTag},</if>
  995. <if test="item.appExclusivePrice != null">`app_exclusive_price` = #{item.appExclusivePrice},</if>
  996. <if test="item.isAppExclusive != null">`is_app_exclusive` = #{item.isAppExclusive},</if>
  997. <if test="item.grossWeight != null">`gross_weight` = #{item.grossWeight},</if>
  998. <if test="item.netWeight != null">`net_weight` = #{item.netWeight},</if>
  999. <if test="item.isGoodsShareStock != null">`is_goods_share_stock` = #{item.isGoodsShareStock},</if>
  1000. <if test="item.isLimited != null">`is_limited` = #{item.isLimited},</if>
  1001. <if test="item.isHot != null">`is_hot` = #{item.isHot},</if>
  1002. <if test="item.createrSn != null">`creater_sn` = #{item.createrSn},</if>
  1003. <if test="item.createTime != null">`create_time` = #{item.createTime},</if>
  1004. <if test="item.moderSn != null">`moder_sn` = #{item.moderSn},</if>
  1005. <if test="item.modTime != null">`mod_time` = #{item.modTime},</if>
  1006. <if test="item.tstm != null">`tstm` = #{item.tstm},</if>
  1007. <if test="item.lastSaleTime != null">`last_sale_time` = #{item.lastSaleTime},</if>
  1008. <if test="item.mychemId != null">`mychem_id` = #{item.mychemId},</if>
  1009. <if test="item.hsCode != null">`hs_code` = #{item.hsCode},</if>
  1010. <if test="item.hsCodeName != null">`hs_code_name` = #{item.hsCodeName},</if>
  1011. <if test="item.isSyncHsCode != null">`is_sync_hs_code` = #{item.isSyncHsCode},</if>
  1012. <if test="item.isSyncGoodsRate != null">`is_sync_goods_rate` = #{item.isSyncGoodsRate},</if>
  1013. <if test="item.impConsumTaxRate != null">`imp_consum_tax_rate` = #{item.impConsumTaxRate},</if>
  1014. <if test="item.valueAddedTaxRate != null">`value_added_tax_rate` = #{item.valueAddedTaxRate},</if>
  1015. <if test="item.legalUnit1Qty != null">`legal_unit1_qty` = #{item.legalUnit1Qty},</if>
  1016. <if test="item.legalUnit2Qty != null">`legal_unit2_qty` = #{item.legalUnit2Qty},</if>
  1017. <if test="item.cosmThresholdValue != null">`cosm_threshold_value` = #{item.cosmThresholdValue},</if>
  1018. <if test="item.toBeRestored != null">`to_be_restored` = #{item.toBeRestored}</if>
  1019. </set>
  1020. where id = #{item.id}
  1021. </foreach>
  1022. </update>
  1023. </mapper>