GoodsDao.xml 45 KB

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