1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.caimei365.commodity.mapper.PageMapper">
- <delete id="delSku">
- delete
- from cm_sku
- where skuId = #{skuId}
- </delete>
- <select id="getPageTypeSort" resultType="java.lang.Integer">
- select typeSort
- from cm_page
- where id = #{pageId}
- and enabledStatus = '1'
- </select>
- <select id="getPageLabel" resultType="java.lang.String">
- select contentLabel
- from cm_page
- where id = #{pageId}
- and enabledStatus = '1'
- </select>
- <select id="getHotSearchByPageId" resultType="com.caimei365.commodity.model.vo.HotSearchVo">
- select
- id, pageId, name, isHot, link, pcStatus, sort, appletsStatus, creationTime
- from
- cm_page_hot_search
- where
- pageId = #{pageId}
- <if test="source == 1">
- and pcStatus = 1
- </if>
- <if test="source == 2">
- and appletsStatus = 1
- </if>
- order by -sort desc, creationTime desc
- </select>
- <select id="getHotSearchByPageIds" resultType="com.caimei365.commodity.model.vo.HotSearchVo">
- select id, pageId, name, isHot, link, pcStatus, sort, appletsStatus, creationTime
- from cm_page_hot_search
- where appletsStatus = 1
- <if test="pageIds.size() > 0">
- and pageId in
- <foreach collection="pageIds" open="(" separator="," close=")" item="pageId">
- #{pageId}
- </foreach>
- </if>
- order by -sort desc, creationTime desc
- </select>
- <select id="getHomePageFloor" resultType="com.caimei365.commodity.model.vo.PageFloorVo">
- select id, type, floorTitle as title, floorDetail as detail
- from new_page_floor
- where delFlag = 0
- <if test="source == 1">
- AND wwwEnabledStatus = 1
- </if>
- <if test="source == 2">
- AND crmEnabledStatus = 1
- </if>
- order by -sort desc,createDate desc
- </select>
- <select id="getPageFloor" resultType="com.caimei365.commodity.model.vo.PageFloorVo">
- select id, type, floorTitle as title, floorDetail as detail,floorType
- from new_page_floor
- where delFlag = 0
- <if test="source == 1">
- AND wwwEnabledStatus = 1
- </if>
- <if test="source == 2">
- AND crmEnabledStatus = 1
- </if>
- and floorType is not null
- order by -sort desc,createDate desc
- </select>
- <select id="getFloorByPageId" resultType="com.caimei365.commodity.model.vo.PageFloorVo">
- select id, title ,description as detail
- from cm_page_centre
- where pageId = #{pageId}
- <if test="source == 1">
- and enabledStatus = 1
- </if>
- <if test="source == 2">
- and crmEnabledStatus = 1
- </if>
- order by -sort desc, createDate desc
- </select>
- <select id="getFloorContentById" resultType="com.caimei365.commodity.model.vo.FloorContentVo">
- select id,
- floorId,
- centreId,
- templateType,
- pcAdsImage1,
- pcAdsImage2,
- pcAdsImage3,
- appletsAdsImage1,
- appletsAdsImage2,
- appletsAdsImage3,
- adsLink1,
- adsLink2,
- adsLink3
- from new_page_floor_content
- where floorId = #{id}
- </select>
- <select id="getFloorImageById" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
- select
- id, floorId, centreId, productId, name, link, image, appletsImage, label, pcStatus, appletsStatus, sort,
- createDate
- from new_page_floor_image
- where floorId = #{id}
- <if test="source == 1">
- and pcStatus = 1
- </if>
- <if test="source == 2">
- and appletsStatus = 1
- </if>
- order by -sort desc, createDate desc
- </select>
- <select id="getFloorContentByCentreId" resultType="com.caimei365.commodity.model.vo.FloorContentVo">
- select id,
- floorId,
- centreId,
- templateType,
- pcAdsImage1,
- pcAdsImage2,
- pcAdsImage3,
- pcAdsImage4,
- pcAdsImage5,
- appletsAdsImage1,
- appletsAdsImage2,
- appletsAdsImage3,
- appletsAdsImage4,
- appletsAdsImage5,
- adsLink1,
- adsLink2,
- adsLink3,
- adsLink4,
- adsLink5,
- displayDate1,
- displayDate2,
- displayDate3
- from new_page_floor_content
- where centreId = #{id}
- </select>
- <select id="getFloorImageByCentreId" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
- select
- id, floorId, centreId, productId, name, link, image, appletsImage, label, pcStatus, appletsStatus, sort,
- displaySort, createDate, content
- from new_page_floor_image
- where centreId = #{id}
- <if test="source == 1">
- and pcStatus = 1
- </if>
- <if test="source == 2">
- and appletsStatus = 1
- </if>
- order by -sort desc, createDate desc
- <if test="limitNum != null">
- limit ${limitNum}
- </if>
- </select>
- <select id="getProductItemById" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
- select p.productID as productId,
- p.actStatus,
- p.name,
- p.aliasName,
- p.mainImage as image,
- p.productCode as code,
- p.priceFlag,
- (select unit from cm_sku where productID = #{productId} order by price asc LIMIT 1) as unit,
- (select price from cm_sku where productID = #{productId} order by price asc LIMIT 1) as price,
- (select price
- from cm_sku
- where productID = #{productId}
- order by price asc
- LIMIT 1) as originalPrice,
- p.shopID as shopId,
- p.searchKey as keyword,
- (select minBuyNumber
- from cm_sku
- where productID = #{productId}
- order by price asc
- LIMIT 1) as minBuyNumber,
- (select ladderPriceFlag
- from cm_sku
- where productID = #{productId}
- order by price asc
- LIMIT 1) as ladderPriceFlag,
- (select normalPrice
- from cm_sku
- where productID = #{productId}
- order by price asc
- LIMIT 1) as normalPrice,
- p.step,
- p.shopID as shopId,
- p.taxPoint as taxRate,
- p.includedTax,
- p.invoiceType,
- p.productCategory as productCategory,
- p.validFlag,
- p.featuredFlag,
- p.commodityType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- p.visibility as visibility,
- cshd.detailTalkFlag as detailTalkFlag,
- p.productType
- from product p
- left join cm_second_hand_detail cshd on p.productID = cshd.productID
- where p.productID = #{productId}
- and p.validFlag = 2
- </select>
- <select id="getSupplierFloorImage" resultType="com.caimei365.commodity.model.vo.ShopFloorVo">
- select id, crmImage, wwwImage, wwwLink
- from new_page_quality_supplier_image
- limit 1
- </select>
- <select id="getSupplierImage" resultType="com.caimei365.commodity.model.vo.ShopImageVo">
- select
- id, supplierName, image, link, sort, wwwEnabledStatus, crmEnabledStatus,
- createBy, createDate, updateBy, updateDate, delFlag
- from
- new_page_quality_supplier
- where
- delFlag = 0
- <if test="source == 1">
- and wwwEnabledStatus = 1
- </if>
- <if test="source == 2">
- and crmEnabledStatus = 1
- </if>
- order by - sort desc,createDate desc
- </select>
- <select id="getOrganizeId" resultType="java.lang.Integer">
- SELECT userOrganizeID FROM USER WHERE userId = #{userId}
- </select>
- <select id="getProductDetails" resultType="com.caimei365.commodity.model.vo.ProductDetailVo">
- select p.productID as productId,
- p.shopID as shopId,
- (select normalPrice
- from cm_sku
- where productId = #{productId}
- order by price asc
- limit 1) as normalPrice,
- ifnull((select stock from cm_sku where productId = #{productId} order by price asc limit 1), 0) as stock,
- (select minBuyNumber
- from cm_sku
- where productId = #{productId}
- order by price asc
- limit 1) as minBuyNumber,
- (select unit from cm_sku where productId = #{productId} order by price asc limit 1) as unit,
- p.name,
- p.aliasName,
- p.commodityType,
- p.mainImage,
- p.invoiceType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- p.searchKey,
- p.visibility,
- p.commodityDetailsFlag,
- p.brandID as brandId,
- p.productType,
- p.tags,
- p.includedTax,
- p.productCategory,
- p.serviceNumber,
- p.taxPoint,
- p.supplierTaxPoint,
- p.priceFlag,
- p.actFlag,
- p.addTime,
- p.hasSkuFlag,
- p.sellNumber,
- p.sortIndex,
- p.featuredFlag,
- p.recommendType,
- p.machineType,
- p.productCode,
- p.updateTime,
- p.validFlag,
- p.searchKey,
- p.allAreaFlag,
- p.step,
- p.provinceIds,
- p.qualificationImg,
- p.trainingMethod,
- p.trainingType,
- p.trainingFee,
- p.productRemarks,
- p.productDetail as productDetailChose,
- s.shopType as shopType,
- p.qualificationNo as qualificationNo,
- p.productName as productName,
- p.qualificationTime as qualificationTime,
- p.qualificationLink as qualificationLink,
- p.returnGoodsStutas,
- P.relatedLabels
- from product p
- left join shop s on s.shopId = p.shopId
- where p.productID = #{productId}
- </select>
- <select id="getProductOrganizeDetails" resultType="com.caimei365.commodity.model.vo.ProductDetailVo">
- select p.productID as productId,
- p.shopID as shopId,
- (select normalPrice
- from cm_sku
- where productId = #{productId}
- order by price asc
- limit 1) as normalPrice,
- ifnull((select stock from cm_sku where productId = #{productId} order by price asc limit 1), 0) as stock,
- (select minBuyNumber
- from cm_mall_product_sku
- where productId = #{productId} or mallProductId = #{productId}
- order by price asc
- limit 1) as minBuyNumber,
- (select cs.unit from cm_sku cs
- left join cm_mall_product_sku cmps on cs.skuId = cmps.skuId
- where cmps.productId = #{productId} or cmps.mallProductId = #{productId} order by cs.price asc limit 1) as unit,
- p.name,
- p.aliasName,
- p.commodityType,
- p.mainImage,
- p.invoiceType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- p.searchKey,
- p.visibility,
- p.commodityDetailsFlag,
- p.brandID as brandId,
- p.productType,
- p.tags,
- p.includedTax,
- p.productCategory,
- p.serviceNumber,
- p.taxPoint,
- p.supplierTaxPoint,
- p.priceFlag,
- p.actFlag,
- p.addTime,
- p.hasSkuFlag,
- p.sellNumber,
- p.sortIndex,
- p.featuredFlag,
- p.recommendType,
- p.machineType,
- p.productCode,
- p.updateTime,
- p.validFlag,
- p.searchKey,
- p.allAreaFlag,
- p.step,
- p.provinceIds,
- p.qualificationImg,
- p.trainingMethod,
- p.trainingType,
- p.trainingFee,
- p.productRemarks,
- p.productDetail as productDetailChose,
- s.shopType as shopType,
- p.qualificationNo as qualificationNo,
- p.productName as productName,
- p.qualificationTime as qualificationTime,
- p.qualificationLink as qualificationLink,
- p.returnGoodsStutas,
- P.relatedLabels
- from product p
- left join cm_mall_organize_products cmop on p.productId = cmop.productId
- left join shop s on s.shopId = p.shopId
- where p.productID = #{productId} or cmop.id = #{productId}
- </select>
- <select id="getBuyAgainProducts" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
- select p.productID as productId,
- p.actStatus,
- p.name,
- p.aliasName,
- p.mainImage as image,
- rpp.skuId,
- cs.unit,
- p.productCode as code,
- p.priceFlag,
- cs.price,
- cs.costPrice,
- ifnull(cs.costCheckFlag, 1) as costCheckFlag,
- p.searchKey as keyword,
- cs.minBuyNumber as minBuyNumber,
- cs.ladderPriceFlag,
- cs.normalPrice,
- p.step,
- p.shopID as shopId,
- p.taxPoint as taxRate,
- p.includedTax,
- p.invoiceType,
- p.productCategory as productCategory,
- p.validFlag,
- p.featuredFlag,
- p.commodityType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- rpp.currentPrice as discountPrice,
- p.productType
- from repeat_purchase_price rpp
- left join product p on rpp.productId = p.productID
- left join cm_sku cs on rpp.skuId = cs.skuId
- where rpp.delFlag = '0'
- and p.validFlag = '2'
- and rpp.userId = #{userId}
- order by rpp.createTime desc
- </select>
- <select id="getPageDetails" resultType="com.caimei365.commodity.model.vo.PageDetailVo">
- select a.id,
- a.type,
- a.title,
- a.keywords,
- a.description,
- a.headImage as image,
- a.headText as content,
- a.buttonName,
- a.buttonLink,
- a.backgroundColour,
- a.backgroundImage,
- a.backgroundImageWay,
- a.contentLabel,
- a.backgroundType
- from cm_page a
- where a.id = #{id}
- and a.type = #{type}
- and a.enabledStatus = 1
- </select>
- <select id="getEquipmentParametersByType" resultType="com.caimei365.commodity.model.vo.EquipmentParameterVo">
- select id, pageId as parentId, name, content, type
- from cm_page_name_content
- where pageId = #{equipmentId}
- and type = #{typeId}
- </select>
- <select id="getImageLinkByFloorId" resultType="com.caimei365.commodity.model.vo.ImageLinkVo">
- select a.id,
- a.title,
- a.link,
- a.image
- from cm_page_image a
- right join cm_page_centre_image b on b.imageId = a.id
- where b.centreId = #{floorId}
- and a.enabledStatus = 1
- order by a.sort desc, a.createDate desc
- </select>
- <select id="getProductRecommendsById" resultType="com.caimei365.commodity.model.search.ProductListVo">
- select p.productID as productId,
- p.actStatus,
- p.`name` as `name`,
- p.mainImage as image,
- IFNULL(p.visibility, 3) as visibility,
- p.productType
- from product as p
- left join cm_product_recommend as pr on pr.recommendProductID = p.productID
- where pr.productID = #{productId}
- and p.validFlag = 2
- order by pr.sort desc
- </select>
- <select id="getAutoProductRecommends" resultType="com.caimei365.commodity.model.search.ProductListVo">
- select p.productID as productId,
- p.actStatus,
- p.`name` as `name`,
- p.mainImage as image,
- IFNULL(p.visibility, 3) as visibility,
- p.productType
- from product as p
- where p.validFlag = 2
- and p.commodityType = (select commodityType from product as p1 where p1.productID = #{productId})
- and p.smallTypeID = (select smallTypeID from product as p2 where p2.productID = #{productId})
- order by p.sellNumber desc
- limit 0,7
- </select>
- <select id="findCmPageById" resultType="com.caimei365.commodity.model.vo.CmPageVo">
- select id,
- type,
- title,
- keywords,
- description,
- headImage,
- crmHeadImage,
- headLink,
- headText,
- redPacketBeginTime,
- redPacketEndTime,
- infoBarStatus,
- backgroundColour,
- backgroundImage,
- backgroundImageWay,
- contentLabel,
- backgroundType
- from cm_page
- where id = #{pageId}
- and enabledStatus = '1'
- </select>
- <select id="getSearchKeyword" resultType="java.lang.String">
- select name
- from keyword
- where validFlag = 1
- order by sortIndex desc
- </select>
- <select id="getTopMenus" resultType="com.caimei365.commodity.model.vo.TopMenuVo">
- select
- id,
- navigationName as name,
- link,
- icon,
- sort
- from new_page_first_navigation
- where delFlag = 0
- <if test="source == 1">
- and wwwEnabledStatus = 1
- </if>
- <if test="source == 2">
- and crmEnabledStatus = 1
- </if>
- order by -sort desc,createDate desc
- limit 8
- </select>
- <select id="getHelpPageTypes" resultType="com.caimei365.commodity.model.vo.BaseLinkVo">
- select c_helpPageTypeID as id,
- c_helpPageTypeName as name
- from c_helpPageType
- </select>
- <select id="getHelpPagesByType" resultType="com.caimei365.commodity.model.vo.BaseLinkVo">
- select helpPageID as id,
- helpPageTypeID as typeId,
- title as name
- from helpPage
- where validFlag = 1
- and helpPageTypeID = #{typeId}
- order by sortIndex
- </select>
- <select id="getFriendLinks" resultType="com.caimei365.commodity.model.vo.BaseLinkVo">
- select id, name, link
- from new_page_friendship_link
- where delFlag = 0
- order by id
- </select>
- <select id="getMaintenanceIdByCode" resultType="java.lang.Integer">
- select cmInstrumentMaintenanceId
- from cm_instrument_maintenance_links
- where linkCode = #{code}
- </select>
- <select id="getMaintenanceById" resultType="com.caimei365.commodity.model.vo.ProductRepairVo">
- SELECT a.id AS "id",
- a.orderNo AS "orderNo",
- a.userId AS "userId",
- a.instrumentName AS "instrumentName",
- a.manufacturer AS "manufacturer",
- a.instrumentBrand AS "instrumentBrand",
- a.maintenanceNum AS "maintenanceNum",
- a.instrumentImage1 AS "instrumentImage1",
- a.instrumentImage2 AS "instrumentImage2",
- a.instrumentImage3 AS "instrumentImage3",
- a.instrumentImage4 AS "instrumentImage4",
- a.instrumentImage5 AS "instrumentImage5",
- a.problemDescription AS "problemDescription",
- a.userAccount AS "userAccount",
- a.userName AS "userName",
- a.userContact AS "userContact",
- a.userMobile AS "userMobile",
- concat(a.provinceName, a.cityName, a.townName, a.userAddress) AS userAddress,
- a.maintainerName AS "maintainerName",
- a.maintainerMobile AS "maintainerMobile",
- a.maintainerAddress AS "maintainerAddress",
- a.status AS "status",
- a.authenticity AS "authenticity",
- a.serviceRating AS "serviceRating",
- a.serviceEvaluate AS "serviceEvaluate",
- a.solveStatus AS "solveStatus",
- a.cancelReason AS "cancelReason",
- a.submitDate AS "submitDate",
- a.dockingDate AS "dockingDate",
- a.evaluateDate AS "evaluateDate",
- a.cancelDate AS "cancelDate",
- a.provinceName AS "provinceName",
- a.cityName AS "cityName",
- a.townName AS "townName",
- b.type AS "viewerType"
- FROM cm_instrument_maintenance a
- LEFT JOIN cm_instrument_maintenance_links b on a.id = b.cmInstrumentMaintenanceId
- WHERE a.id = #{id}
- limit 1
- </select>
- <select id="findAllCoupon" resultType="com.caimei365.commodity.model.vo.CouponVo">
- SELECT
- `id` AS "couponId",
- `couponAmount`,
- `touchPrice`,
- `startDate`,
- `endDate`,
- `couponType`,
- `userId`,
- `shopId`,
- `productType`,
- `categoryType`
- FROM
- cm_coupon
- WHERE
- delFlag = 0 AND vipFlag != 1
- AND status != 2
- AND couponsMode = 0
- <if test="userId == null or userId == 0">
- AND couponType != 2
- AND NOW() <![CDATA[ > ]]> startDate
- AND NOW() <![CDATA[ < ]]> if(receiveFlag = 1,endDate,date_add(startDate,interval receivePeriod day))
- </if>
- <if test="userId > 0">
- AND (couponType IN (0,1,3)
- OR couponType = 2 AND userId = #{userId}
- OR (SELECT registerTime FROM USER WHERE userID = #{userId}) <![CDATA[ >= ]]> startDate)
- and NOW() <![CDATA[ > ]]> startDate
- and NOW() <![CDATA[ < ]]> if(receiveFlag = 1,endDate,
- date_add(if(#{registerTime} <![CDATA[ > ]]> startDate and #{registerTime} <![CDATA[ < ]]>
- endDate,#{registerTime},startDate),interval receivePeriod day)
- )
- </if>
- ORDER BY
- createDate DESC
- </select>
- <select id="findAllProductId" resultType="integer">
- SELECT
- productId
- FROM
- cm_coupon_product
- WHERE
- couponId = #{couponId}
- <if test="source == 1">
- AND pcStatus = 1
- </if>
- <if test="source == 2">
- AND appletsStatus = 1
- </if>
- </select>
- <select id="getProductArchiveList" resultType="com.caimei365.commodity.model.vo.ArchiveVo">
- select cpa.id AS "archiveId",
- cpa.productId AS "productId",
- if(cpa.productId is not null, p.name, cpa.productName) AS "productName",
- if(cpa.productId is not null, s.name, cpa.shopName) AS "shopName",
- if(cpa.productId is not null, p.mainImage, cpa.productImage) AS "productImage",
- if(cpa.productId is not null, ifnull(p.commodityType, cpa.productType),cpa.productType) AS "productType",
- if(cpa.productId is not null,1,2) AS "redirectType"
- from cm_product_archive cpa
- left join product p on cpa.productId = p.productID
- left join shop s on p.shopID = s.shopID
- <where>
- <if test="keyword != null and keyword != ''">
- and (cpa.productName LIKE concat('%', #{keyword}, '%') or p.name like concat('%', #{keyword}, '%')
- or cpa.shopName LIKE concat('%', #{keyword}, '%') or s.name like concat('%', #{keyword}, '%'))
- </if>
- <if test="productType != null and productType != 0">
- and if(cpa.productId is not null and p.commodityType is not null,p.commodityType = #{productType},
- cpa.productType = #{productType})
- </if>
- </where>
- order by cpa.addTime desc
- </select>
- <select id="getImageArchiveList" resultType="com.caimei365.commodity.model.vo.ArchiveContentVo">
- select id as archiveContentId, title, addTime
- from cm_product_archive_content
- where productArchiveId = #{archiveId}
- and type = 1
- order by addTime desc
- </select>
- <select id="getVideoArchiveList" resultType="com.caimei365.commodity.model.vo.ArchiveContentVo">
- select id as archiveContentId, title, addTime
- from cm_product_archive_content
- where productArchiveId = #{archiveId}
- and type = 2
- order by addTime desc
- </select>
- <select id="getFileArchiveList" resultType="com.caimei365.commodity.model.vo.ArchiveContentVo">
- select id as archiveContentId, title, addTime
- from cm_product_archive_content
- where productArchiveId = #{archiveId}
- and type = 3
- order by addTime desc
- </select>
- <select id="getArchiveImageList" resultType="java.lang.String">
- select ifnull(waterOssUrl, ossUrl) as ossUrl
- from cm_product_archive_file
- where archiveContentId = #{archiveContentId}
- </select>
- <select id="getArchiveFile" resultType="com.caimei365.commodity.model.po.ArchiveFilePo">
- select fileName, if(cc.type = 2, ossName, ifnull(waterOssName, ossName)) as ossName, uploadTime
- from cm_product_archive_file cf
- left join cm_product_archive_content cc on cf.archiveContentId = cc.id
- where archiveContentId = #{archiveContentId}
- </select>
- <select id="getArchiveByArchiveId" resultType="com.caimei365.commodity.model.po.ArchivePo">
- select cpa.id AS "archiveId",
- cpa.productId AS "productId",
- if(cpa.productId is not null, p.name, cpa.productName) AS "productName",
- if(cpa.productId is not null, s.name, cpa.shopName) AS "shopName",
- if(cpa.productId is not null, p.mainImage, cpa.productImage) AS "productImage",
- cpa.archiveLevel AS "archiveLevel",
- if(cpa.productId is not null, ifnull(p.commodityType, cpa.productType),
- cpa.productType) AS "productType",
- cpa.productClassify AS "productClassify",
- cpa.labelIds AS "labelIds"
- from cm_product_archive cpa
- left join product p on cpa.productId = p.productID
- left join shop s on p.shopID = s.shopID
- where cpa.id = #{archiveId}
- </select>
- <select id="keyWordList" resultType="java.lang.String">
- select keyword from cm_user_search_frequency
- where
- id in
- <foreach collection="ids" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </select>
- <select id="getClubTypeByUserId" resultType="java.lang.Integer">
- select ifnull(firstClubType, 0)
- from club
- where userID = #{userId}
- </select>
- <select id="getArchiveIdById" resultType="java.lang.Integer">
- select id
- from cm_product_archive
- where productId = #{productId}
- </select>
- <select id="findBeansHistoryByArchiveId" resultType="java.lang.Integer">
- select id
- from user_beans_history
- where userId = #{userId}
- and archiveId = #{archiveId}
- </select>
- <select id="getSvipProductAdsImage" resultType="java.lang.String">
- select if(#{source} = 1, pcImage, appletsImage)
- from cm_svip_product_adsimage
- limit 1
- </select>
- <select id="getSvipProductList" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
- select p.productID as productId,
- p.actStatus,
- p.name,
- p.aliasName,
- p.mainImage as image,
- (select unit from cm_sku where productId = csp.productId order by price asc limit 1) as unit,
- p.productCode as code,
- p.priceFlag,
- (select price from cm_sku where productId = csp.productId order by price asc limit 1) as price,
- p.shopID as shopId,
- p.searchKey as keyword,
- (select minBuyNumber
- from cm_sku
- where productId = csp.productId
- order by price asc
- limit 1) as minBuyNumber,
- (select ladderPriceFlag
- from cm_sku
- where productId = csp.productId
- order by price asc
- limit 1) as ladderPriceFlag,
- (select normalPrice
- from cm_sku
- where productId = csp.productId
- order by price asc
- limit 1) as normalPrice,
- p.step,
- p.shopID as shopId,
- p.taxPoint as taxRate,
- p.includedTax,
- p.invoiceType,
- p.productCategory as productCategory,
- p.validFlag,
- p.featuredFlag,
- p.commodityType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- p.visibility as visibility
- from cm_svip_product csp
- left join product p on p.productID = csp.productId
- where p.validFlag = 2
- order by -csp.sort desc, csp.addTime desc
- </select>
- <select id="getSvipUserIdByUserId" resultType="java.lang.Integer">
- select userId
- from cm_svip_user
- where userId = #{userId}
- and delFlag = '0'
- and now() <![CDATA[ < ]]> endTime
- </select>
- <select id="getBannerImages" resultType="com.caimei365.commodity.model.vo.ImageLinkVo">
- select id, title, link, crmImage as image, crmImage, crmLink, crmTitle
- from new_page_homeimage
- where crmEnabledStatus = 1
- order by sort desc, createDate desc
- </select>
- <select id="getAfterSale" resultType="com.caimei365.commodity.model.vo.AfterSaleVo">
- SELECT id,
- organizeName,
- organizeLinkName,
- mobile,
- contactNumber,
- systemName,
- systemImage,
- introduction,
- afterSale,
- shoppingNotes,
- updateTime,
- addTime,
- delFlag
- FROM cm_mall_organize
- WHERE id = 0
- AND delFlag = '0'
- </select>
- <select id="getPageIdByTypeSort" resultType="java.lang.Integer">
- SELECT id
- FROM cm_page
- WHERE enabledStatus = 1
- AND typeSort = #{typeSort}
- </select>
- <select id="getSidebarLive" resultType="com.caimei365.commodity.model.vo.LiveVo">
- SELECT
- id,
- liveTitle,
- homePageImage,
- advertisingImage,
- link,
- wwwValidFlag,
- crmValidFlag,
- topPosition,
- createTime,
- startTime,
- endTime,
- liveStatus,
- delFlag
- FROM
- new_page_live
- WHERE
- topPosition IN (1, 2, 3)
- AND delFlag = '0'
- <if test="source == 1">
- AND wwwValidFlag = '1'
- </if>
- <if test="source == 2">
- AND crmValidFlag = '1'
- </if>
- ORDER BY topPosition
- </select>
- <select id="getSidebarInfo" resultType="com.caimei365.commodity.model.vo.InfoVo">
- SELECT id,
- typeId,
- title,
- label,
- publisher,
- source,
- keyword,
- recommendContent,
- infoContent,
- guidanceImage,
- homePageImage,
- pubdate,
- recommendStatus,
- enabledStatus,
- basePraise,
- basePv,
- priorityIndex,
- createBy,
- createDate,
- updateBy,
- updateDate,
- topPosition
- FROM info
- WHERE topPosition IN (1, 2, 3)
- AND enabledStatus = '1'
- ORDER BY topPosition
- </select>
- <select id="getSidebarPageImage" resultType="com.caimei365.commodity.model.vo.PageImageVo">
- SELECT
- id,
- title,
- link,
- appLink,
- image,
- homePageImage,
- appletsImage,
- appletsLink,
- appletsEnabledStatus,
- sort,
- type,
- enabledStatus,
- crmEnabledStatus,
- beginTime,
- endTime,
- actType,
- createBy,
- createDate,
- updateBy,
- updateDate,
- topPosition
- FROM
- cm_page_image
- WHERE
- topPosition IN (1, 2, 3)
- <if test="source == 1">
- AND enabledstatus = '1'
- </if>
- <if test="source == 2">
- AND appletsEnabledStatus = '1'
- </if>
- ORDER BY topPosition
- </select>
- <select id="getLiveAdvertisingImage" resultType="java.lang.String">
- SELECT advertisingImage
- FROM new_page_live_advertising_image
- LIMIT 1;
- </select>
- <select id="getAuthProductByProductId" resultType="com.caimei365.commodity.model.vo.AuthProductVo">
- select p.name as productName,
- p.snCode,
- p.pcImage,
- p.appletsImage,
- p.pcCertificateImage,
- p.appletsCertificateImage,
- p.brandId,
- b.authLogo,
- b.name as brandName,
- c.name as productionPlace,
- a.id as authId,
- a.authParty,
- u.authUserId as authUserId,
- u.name as shopName,
- u.shopType,
- u.qrCodeImage,
- i.securityLink,
- i.statementType,
- i.statementContent,
- i.statementLink,
- i.statementImage
- from cm_brand_auth_product p
- left join cm_brand_auth a on p.authId = a.id
- left join cm_brand_auth_user u on a.authUserId = u.authUserId
- left join cm_brand_auth_shop_info i on u.authUserId = i.authUserId and p.brandId = i.brandId
- left join cm_brand b on i.brandId = b.id
- left join country c on i.countryId = c.countryId
- where p.id = #{productId}
- and u.status = 1
- and a.status = 1
- and p.status = 1
- and a.auditStatus = 1
- and p.auditStatus = 1
- </select>
- <select id="getStatementFile" resultType="com.caimei365.commodity.model.vo.StatementFileVo">
- select name, ossName, md5Hex, uploadTime
- from cm_brand_auth_file
- where authUserId = #{authUserId}
- and brandId = #{brandId}
- limit 1
- </select>
- <select id="getAuthProductParams" resultType="com.caimei365.commodity.model.po.BrandProductParamPo">
- select name, content
- from cm_brand_product_param
- where productId = #{productId}
- </select>
- <select id="getSidebarBaike" resultType="com.caimei365.commodity.model.vo.BaikeProductVo">
- select id as productId, id, commodityType, name, image, publishTime
- from cm_baike_product
- WHERE topPosition IN (1, 2, 3)
- and status = 1
- and NOW() > publishTime
- order by topPosition
- </select>
- <select id="getBaikeTypeList" resultType="com.caimei365.commodity.model.vo.BaikeTypeVo">
- select id as typeId, name
- from cm_baike_type
- where if(#{commodityType} = 1, typeSort = 1, typeSort = 2)
- and status = 1
- order by -sort desc, addTime desc
- </select>
- <select id="getBaikeProducts" resultType="com.caimei365.commodity.model.vo.BaikeProductVo">
- select id as productId, id,commodityType, image, name, discription, publishTime, (basePv + actualPv) as pv
- from cm_baike_product
- <where>
- status = 1 and NOW() > publishTime and delFlag = 0 and auditStatus = 2 and onlineStatus = 2
- <if test="typeId != null">
- and typeId = #{typeId}
- </if>
- <if test="keyword != null">
- and name like concat ('%',#{keyword},'%')
- </if>
- </where>
- order by addTime desc
- <if test="limitNum != null">
- limit #{limitNum}
- </if>
- </select>
- <select id="getBaikeQuestionList" resultType="java.lang.String">
- select question
- from cm_baike_product_question
- where productId = #{productId}
- limit 3
- </select>
- <select id="findHeheHomePage" resultType="com.caimei365.commodity.model.vo.CmPageVo">
- select id,
- type,
- title,
- keywords,
- description,
- headImage,
- crmHeadImage,
- headLink,
- headText,
- redPacketBeginTime,
- redPacketEndTime,
- infoBarStatus
- from cm_page
- where type = 8
- and enabledStatus = '1'
- limit 1
- </select>
- <select id="getNewFloorRecommend" resultType="com.caimei365.commodity.model.po.ProductPo">
- SELECT DISTINCT
- p.productID,
- p.actStatus,
- p.name,
- p.aliasName,
- p.visibility,
- p.mainImage,
- (select unit from cm_sku where productId=p.productID order by price asc limit 1)as unit,
- p.productCode as code,
- p.priceFlag,
- p.shopID as shopId,
- p.searchKey as keyword,
- (select minBuyNumber from cm_sku where productId=p.productID order by price asc limit 1)as minBuyNumber,
- (select ladderPriceFlag from cm_sku where productId=p.productID order by price asc limit 1)as ladderPriceFlag,
- (select normalPrice from cm_sku where productId=p.productID order by price asc limit 1)as normalPrice,
- p.step,
- p.taxPoint as taxRate,
- p.includedTax,
- p.invoiceType,
- p.productCategory as productCategory,
- p.validFlag,
- p.featuredFlag,
- p.commodityType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- p.productType,
- p.brandID,
- (select price from cm_sku where productId=p.productID order by price asc limit 1)as price
- from product p
- <where>
- and p.showFlag!=5
- and p.newvalidFlag = 1
- and p.newProductType=1
- and p.validFlag = 2
- and p.showFlag!=2
- and p.recommend=1
- </where>
- order by p.sortIndex desc,newshowTime desc
- limit 5
- </select>
- <select id="getNewFloorList" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
- SELECT DISTINCT
- (select price from cm_sku where productID=p.productID order by price asc limit 1)as price,
- (select unit from cm_sku where productID=p.productID order by price asc limit 1)as unit,
- (select normalPrice from cm_sku where productID=p.productID order by price asc limit 1)as normalPrice,
- (select minBuyNumber from cm_sku where productID=p.productID order by price asc limit 1)as minBuyNumber,
- (select ladderPriceFlag from cm_sku where productID=p.productID order by price asc limit 1)as ladderPriceFlag,
- p.productID,
- p.actStatus,
- p.name,
- p.aliasName,
- p.visibility,
- p.mainImage as image,
- p.productCode as code,
- p.priceFlag,
- p.shopID as shopId,
- p.searchKey as keyword,
- p.step,
- p.taxPoint as taxRate,
- p.includedTax,
- p.invoiceType,
- p.productCategory as productCategory,
- p.validFlag,
- p.featuredFlag,
- p.commodityType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- p.productType,
- p.brandID
- from product p
- <where>
- and p.showFlag!=5
- and p.newvalidFlag = 1
- and p.newProductType=1
- and p.validFlag = 2
- and p.showFlag!=2
- <if test="brandID != null and brandID.size > 0">
- and
- <foreach collection="brandID" item="item" index="index" open="(" close=")" separator="OR">
- p.brandID LIKE CONCAT('%',#{item},'%')
- </foreach>
- </if>
- </where>
- order by p.sortIndex desc,newshowTime desc
- <if test="status == 1">
- limit 20
- </if>
- </select>
- <select id="getNewFloor" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
- SELECT
- p.productID,
- p.actStatus,
- p.name,
- p.aliasName,
- p.visibility,
- p.mainImage as image,
- (select unit from cm_sku where productId=p.productID order by price asc limit 1)as unit,
- p.productCode as code,
- p.priceFlag,
- (select price from cm_sku where productId=p.productID order by price asc limit 1)as price,
- p.shopID as shopId,
- p.searchKey as keyword,
- (select minBuyNumber from cm_sku where productId=p.productID order by price asc limit 1)as minBuyNumber,
- (select ladderPriceFlag from cm_sku where productId=p.productID order by price asc limit 1)as ladderPriceFlag,
- (select normalPrice from cm_sku where productId=p.productID order by price asc limit 1)as normalPrice,
- p.step,
- p.taxPoint as taxRate,
- p.includedTax,
- p.invoiceType,
- p.productCategory as productCategory,
- p.validFlag,
- p.featuredFlag,
- p.commodityType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- p.productType,
- p.brandID,
- (select price from cm_sku where productId=p.productID order by price asc limit 1)as price
- from product p
- <where>
- <if test="productID != null and productID!=''">
- and productID=#{productID}
- </if>
- and p.newvalidFlag = 1
- and p.newProductType=1
- and p.validFlag = 2
- </where>
- # order by p.combinationSort != 0 desc, p.combinationSort asc
- # 在设置重点关注时给排序值1000为了让重点关注始终在列表前端
- <if test="sortIndex==1000">
- ORDER BY p.newshowTime DESC
- </if>
- <if test="sortIndex!=1000">
- ORDER BY p.sortIndex desc
- </if>
- </select>
- <select id="getNewFloorBrand" resultType="com.caimei365.commodity.model.vo.BrandVo">
- SELECT DISTINCT s.`id`, s.`name`
- FROM product a
- LEFT JOIN `cm_brand` s ON s.id = a.brandID
- WHERE a.newvalidFlag = 1
- AND a.newProductType = 1
- AND a.validFlag = 2
- AND a.showFlag != 2
- AND s.id IS NOT NULL
- AND s.name IS NOT NULL
- AND s.id IS NOT NULL
- AND s.name IS NOT NULL
- </select>
- <select id="findLink" resultType="java.lang.String">
- select link
- from new_page_floor_image
- where productId = #{productId}
- limit 1
- </select>
- <select id="getAuthUserList" resultType="com.caimei365.commodity.model.vo.BaikeProductVo">
- select
- p.id as productId,
- p.id,
- p.commodityType,
- p.name,
- p.discription,
- p.typeId,
- p.actualPv as pv,
- p.auditStatus,
- p.onlineStatus,
- p.status,
- p.publishTime,
- p.publishSource,
- p.shopId,
- p.image,
- t.name as typeName,
- p.addTime
- from cm_baike_product p
- left join cm_baike_type t on p.typeId=t.id
- where 1=1
- <if test="null !=productId">
- and p.id=#{productId}
- </if>
- <if test="null !=typeId">
- and p.typeId=#{typeId}
- </if>
- <if test="null !=auditStatus">
- and p.auditStatus=#{auditStatus}
- </if>
- <if test="null !=onlineStatus">
- and p.onlineStatus=#{onlineStatus}
- </if>
- <if test="null !=status">
- and p.status=#{status}
- </if>
- <if test="null !=shopId">
- and p.shopId=#{shopId}
- </if>
- <if test="null !=name and '' != name">
- and p.name like concat('%',#{name},'%')
- </if>
- order by p.addTime desc
- </select>
- <update id="upEntryStatusById">
- update cm_baike_product
- set status=#{status},
- publishTime=#{publishTime}
- where id = #{id};
- </update>
- <delete id="delEntryStatusById">
- delete
- from cm_baike_product
- where id = #{id};
- </delete>
- <select id="getEntryInfoById" resultType="com.caimei365.commodity.model.vo.BaikeProductVo">
- select p.id as productId,
- p.id,
- p.commodityType,
- p.name,
- p.discription,
- p.typeId,
- p.actualPv as pv,
- p.auditStatus,
- p.onlineStatus,
- p.status,
- p.publishTime,
- p.addTime,
- p.alias,
- p.image,
- t.name as typeName,
- p.publishSource,
- p.shopId,
- p.seoKeyword,
- p.labelIds
- from cm_baike_product p
- left join cm_baike_type t on p.typeId = t.id
- where p.id = #{id}
- </select>
- <select id="getImageListById" resultType="com.caimei365.commodity.model.vo.BaikeImageVo">
- select id, productId as entryId, image
- from cm_baike_product_image
- where productId = #{id}
- </select>
- <select id="getInfoListById" resultType="com.caimei365.commodity.model.vo.BaikeInfoVo">
- select id, productId as entryId, name as infoName, content as infoContent
- from cm_baike_product_param
- where productId = #{id}
- </select>
- <select id="getTextInfoListById" resultType="com.caimei365.commodity.model.vo.BaikeTextInfoVo">
- select id, productId as entryId, textType, dictionaryContent, referenceId, parentId, dictionaryType
- from cm_baike_text_info
- where productId = #{id}
- </select>
- <select id="getReferenceListById" resultType="com.caimei365.commodity.model.vo.CmBaikeReferenceInfo">
- select id,
- referenceType,
- website,
- articleName,
- websiteName,
- publishTime,
- acitationTime,
- author,
- workName,
- publicationPlace,
- press,
- publicationYear,
- acitationWeb,
- referenceDescription,
- imageDescription,
- imageUrl,
- ctrlId,
- productId as entryId,
- productType as entryType
- from cm_baike_reference_info
- where productId = #{id}
- </select>
- <select id="geTypeList" resultType="com.caimei365.commodity.model.vo.BaikeTypeVo">
- select id as typeId, name
- from cm_baike_type
- </select>
- <select id="getVideoListById" resultType="com.caimei365.commodity.model.vo.BaikeVideoVo">
- select id, productId as entryId, fileTitle, fileName, ossName, ossUrl
- from cm_baike_product_file
- where productId = #{id}
- </select>
- <delete id="delReferenceById">
- delete
- from cm_baike_reference_info
- where id = #{id}
- </delete>
- <select id="getReferenceById" resultType="com.caimei365.commodity.model.vo.CmBaikeReferenceInfo">
- select id,
- referenceType,
- website,
- articleName,
- websiteName,
- publishTime,
- acitationTime,
- author,
- workName,
- publicationPlace,
- press,
- publicationYear,
- acitationWeb,
- referenceDescription,
- imageDescription,
- imageUrl,
- ctrlId,
- productId as entryId,
- productType as entryType
- from cm_baike_reference_info
- where id = #{id}
- </select>
- <update id="upReferenceInfoByid">
- update cm_baike_reference_info
- set referenceType=#{referenceType},
- website=#{website},
- articleName=#{articleName},
- websiteName=#{websiteName},
- publishTime=#{publishTimeStr},
- acitationTime=#{acitationTimeStr},
- author=#{author},
- workName=#{workName},
- publicationPlace=#{publicationPlace},
- press=#{press},
- publicationYear=#{publicationYearStr},
- acitationWeb=#{acitationWeb},
- ctrlId=#{ctrlId},
- referenceDescription=#{referenceDescription},
- imageDescription=#{imageDescription},
- imageUrl=#{imageUrl}
- where id = #{id}
- </update>
- <insert id="insertReferenceInfo">
- insert into cm_baike_reference_info(referenceType, website, articleName, websiteName, publishTime,
- acitationTime, author, workName, publicationPlace, press, publicationYear,
- acitationWeb, referenceDescription, imageDescription, imageUrl, productId,
- productType, ctrlId)
- values (#{referenceType}, #{website}, #{articleName}, #{websiteName}, #{publishTimeStr}, #{acitationTimeStr},
- #{author}, #{workName}, #{publicationPlace}, #{press}, #{publicationYearStr}, #{acitationWeb},
- #{referenceDescription}, #{imageDescription}, #{imageUrl}, #{entryId}, #{entryType}, #{ctrlId})
- </insert>
- <update id="upEntryInfo">
- update cm_baike_product
- set commodityType=#{commodityType},
- name=#{name},
- discription=#{discription},
- typeId=#{typeId},
- auditStatus =1,
- onlineStatus=1,
- status=#{status},
- publishTime=#{publishTime},
- addTime=NOW(),
- alias=#{alias},
- image=#{image},
- publishSource=#{publishSource},
- shopId=#{shopId},
- seoKeyword=#{seoKeyword},
- labelIds = #{labelIds},
- relatedLabels = #{labelStrs}
- where id = #{id}
- </update>
- <insert id="insertEntryInfo" useGeneratedKeys="true" keyProperty="id">
- insert into cm_baike_product
- (commodityType, name, discription, typeId, actualPv, auditStatus, onlineStatus, status, publishTime, addTime,
- alias, image, seoKeyword, publishSource, shopId, labelIds, relatedLabels)
- values (#{commodityType}, #{name}, #{discription}, #{typeId}, 0, 1, 1, #{status}, #{publishTime}, NOW(),
- #{alias}, #{image}, #{seoKeyword}, #{publishSource}, #{shopId}, #{labelIds}, #{labelStrs})
- </insert>
- <delete id="delImageListByEntryId">
- delete
- from cm_baike_product_image
- where productId = #{id}
- </delete>
- <delete id="delVideoListByEntryId">
- delete
- from cm_baike_product_file
- where productId = #{id}
- </delete>
- <delete id="delInfoListByEntryId">
- delete
- from cm_baike_product_param
- where productId = #{id}
- </delete>
- <delete id="delTextListByEntryId">
- delete
- from cm_baike_text_info
- where productId = #{id}
- </delete>
- <delete id="delreferenceByEntryId">
- delete
- from cm_baike_reference_info
- where productId = #{id}
- </delete>
- <insert id="insertImage">
- insert into cm_baike_product_image(productId, image)
- values (#{entryId}, #{image})
- </insert>
- <insert id="insertVideo">
- insert into cm_baike_product_file(productId, fileTitle, fileName, ossName, ossUrl)
- values (#{entryId}, #{fileTitle}, #{fileName}, #{ossName}, #{ossUrl})
- </insert>
- <insert id="insertInfo">
- insert into cm_baike_product_param(productId, name, content)
- values (#{entryId}, #{infoName}, #{infoContent})
- </insert>
- <insert id="insertText">
- insert into cm_baike_text_info(textType, productId, dictionaryContent, referenceId, parentId, dictionaryType)
- values (#{textType}, #{entryId}, #{dictionaryContent}, #{referenceId}, #{parentId}, #{dictionaryType})
- </insert>
- <insert id="insertreference">
- insert into cm_baike_reference_info(referenceType, website, articleName, websiteName, publishTime,
- acitationTime, author, workName, publicationPlace, press, publicationYear,
- acitationWeb, referenceDescription, imageDescription, imageUrl, productId,
- productType, ctrlId)
- values (#{referenceType}, #{website}, #{articleName}, #{websiteName}, #{publishTimeStr}, #{acitationTimeStr},
- #{author}, #{workName}, #{publicationPlace}, #{press}, #{publicationYearStr}, #{acitationWeb},
- #{referenceDescription}, #{imageDescription}, #{imageUrl}, #{entryId}, #{entryType}, #{ctrlId})
- </insert>
- <select id="getShopid" resultType="java.lang.Integer">
- select cmShopId
- from cm_brand_auth_user
- where authUserId = #{authUserId}
- </select>
- <select id="getHelpContent" resultType="java.lang.String">
- select content
- from helppage
- where helpPageID = #{helpId}
- </select>
- <select id="findLabels" resultType="java.lang.String">
- select keyword
- from cm_user_search_frequency
- where trueStatus = 1
- and delStatus = 1
- and id in (#{labelIds})
- </select>
- <select id="findKeyWordId" resultType="java.lang.String">
- select keyword
- from cm_user_search_frequency
- where id = #{id}
- </select>
- </mapper>
|