123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797 |
- <?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.ShopMapper">
- <insert id="insertProduct" keyColumn="productID" keyProperty="productId"
- parameterType="com.caimei365.commodity.model.po.ProductPo" useGeneratedKeys="true">
- insert into product (
- groundMall, shopID, name, aliasName, commodityType, bigTypeID, smallTypeID, tinyTypeID, mainImage,
- brandID, productType, tags, includedTax,
- <if test="productCategory != null and productCategory != '' ">
- productCategory,
- </if>
- <if test="serviceNumber != null and serviceNumber != ''">
- serviceNumber,
- </if>
- <if test="supplierTaxPoint != null and supplierTaxPoint != ''">
- supplierTaxPoint,
- </if>
- <if test="addTime != null and addTime != ''">
- addTime,
- </if>
- <if test="hasSkuFlag != null and hasSkuFlag != ''">
- hasSkuFlag,
- </if>
- <if test="sellNumber != null and sellNumber != ''">
- sellNumber,
- </if>
- <if test="sortIndex != null and sortIndex != ''">
- sortIndex,
- </if>
- <if test="featuredFlag != null and featuredFlag != ''">
- featuredFlag,
- </if>
- <if test="recommendType != null and recommendType != ''">
- recommendType,
- </if>
- <if test="priceFlag != null and priceFlag != ''">
- priceFlag,
- </if>
- <if test="actFlag != null and actFlag != ''">
- actFlag,
- </if>
- <if test="visibility != null and visibility != ''">
- visibility,
- </if>
- <if test="commodityDetailsFlag != null and commodityDetailsFlag != ''">
- commodityDetailsFlag,
- </if>
- <if test="productCode != null and productCode != ''">
- productCode,
- </if>
- <if test="searchKey != null and searchKey != ''">
- searchKey,
- </if>
- <if test="allAreaFlag != null and allAreaFlag != ''">
- allAreaFlag,
- </if>
- <if test="step != null and step != ''">
- step,
- </if>
- <if test="provinceIds != null and provinceIds != ''">
- provinceIds,
- </if>
- <if test="machineType != null and machineType != ''">
- machineType,
- </if>
- <if test="qualificationImg != null and qualificationImg != ''">
- qualificationImg,
- </if>
- <if test="invoiceType != null and invoiceType != ''">
- invoiceType,
- </if>
- <if test="qualificationNo != null and qualificationNo != ''">
- qualificationNo,
- </if>
- <if test="productName != null and productName != ''">
- productName,
- </if>
- <if test="qualificationTime != null and qualificationTime != ''">
- qualificationTime,
- </if>
- updateTime,newProductType,showFlag,newvalidFlag
- ) values (
- #{groundMall}, #{shopId}, #{name}, #{aliasName}, #{commodityType}, #{bigTypeId}, #{smallTypeId}, #{tinyTypeId}, #{mainImage},
- #{brandId}, #{productType}, #{tags}, #{includedTax},
- <if test="productCategory != null and productCategory != '' ">
- #{productCategory},
- </if>
- <if test="serviceNumber != null and serviceNumber != ''">
- #{serviceNumber},
- </if>
- <if test="supplierTaxPoint != null and supplierTaxPoint != ''">
- #{supplierTaxPoint},
- </if>
- <if test="addTime != null and addTime != ''">
- #{addTime},
- </if>
- <if test="hasSkuFlag != null and hasSkuFlag != ''">
- #{hasSkuFlag},
- </if>
- <if test="sellNumber != null and sellNumber != ''">
- #{sellNumber},
- </if>
- <if test="sortIndex != null and sortIndex != ''">
- #{sortIndex},
- </if>
- <if test="featuredFlag != null and featuredFlag != ''">
- #{featuredFlag},
- </if>
- <if test="recommendType != null and recommendType != ''">
- #{recommendType},
- </if>
- <if test="priceFlag != null and priceFlag != ''">
- #{priceFlag},
- </if>
- <if test="actFlag != null and actFlag != ''">
- #{actFlag},
- </if>
- <if test="visibility != null and visibility != ''">
- #{visibility},
- </if>
- <if test="commodityDetailsFlag != null and commodityDetailsFlag != ''">
- #{commodityDetailsFlag},
- </if>
- <if test="productCode != null and productCode != ''">
- #{productCode},
- </if>
- <if test="searchKey != null and searchKey != ''">
- #{searchKey},
- </if>
- <if test="allAreaFlag != null and allAreaFlag != ''">
- #{allAreaFlag},
- </if>
- <if test="step != null and step != ''">
- #{step},
- </if>
- <if test="provinceIds != null and provinceIds != ''">
- #{provinceIds},
- </if>
- <if test="machineType != null and machineType != ''">
- #{machineType},
- </if>
- <if test="qualificationImg != null and qualificationImg != ''">
- #{qualificationImg},
- </if>
- <if test="invoiceType != null and invoiceType != ''">
- #{invoiceType},
- </if>
- <if test="qualificationNo != null and qualificationNo != ''">
- #{qualificationNo},
- </if>
- <if test="productName != null and productName != ''">
- #{productName},
- </if>
- <if test="qualificationTime != null and qualificationTime != ''">
- #{qualificationTime},
- </if>
- #{updateTime}, #{newProductType},#{showFlag},3
- )
- </insert>
- <update id="updateProduct">
- update product set
- groundMall = #{groundMall}, shopID = #{shopId}, name = #{name}, aliasName = #{aliasName}, commodityType = #{commodityType},
- bigTypeId = #{bigTypeId}, smallTypeId = #{smallTypeId}, tinyTypeId = #{tinyTypeId}, mainImage = #{mainImage},
- brandId = #{brandId}, productType = #{productType}, tags = #{tags}, includedTax = #{includedTax},newProductType=#{newProductType},
- <if test="qualificationNo !=null and qualificationNo != ''">
- qualificationNo=#{qualificationNo},
- </if>
- <if test="productName !=null and productName != ''">
- productName=#{productName},
- </if>
- <if test="qualificationTime !=null and qualificationTime != ''">
- qualificationTime=#{qualificationTime},
- </if>
- <if test="qualificationLink !=null and qualificationLink != ''">
- qualificationLink=#{qualificationLink},
- </if>
- <if test="productCategory != null and productCategory != ''">
- productCategory = #{productCategory},
- </if>
- <if test="trainingFee != null">
- trainingFee = #{trainingFee},
- </if>
- <if test="serviceNumber != null and serviceNumber != ''">
- serviceNumber = #{serviceNumber},
- </if>
- <if test="supplierTaxPoint != null and supplierTaxPoint != ''">
- supplierTaxPoint = #{supplierTaxPoint},
- </if>
- <if test="addTime != null and addTime != ''">
- addTime = #{addTime},
- </if>
- <if test="hasSkuFlag != null and hasSkuFlag != ''">
- hasSkuFlag = #{hasSkuFlag},
- </if>
- <if test="sellNumber != null and sellNumber != ''">
- sellNumber = #{sellNumber},
- </if>
- <if test="sortIndex != null and sortIndex != ''">
- sortIndex = #{sortIndex},
- </if>
- <if test="featuredFlag != null and featuredFlag != ''">
- featuredFlag = #{featuredFlag},
- </if>
- <if test="recommendType != null and recommendType != ''">
- recommendType = #{recommendType},
- </if>
- <if test="priceFlag != null and priceFlag != ''">
- priceFlag = #{priceFlag},
- </if>
- <if test="actFlag != null and actFlag != ''">
- actFlag = #{actFlag},
- </if>
- <if test="visibility != null and visibility != ''">
- visibility = #{visibility},
- </if>
- <if test="commodityDetailsFlag != null and commodityDetailsFlag != ''">
- commodityDetailsFlag = #{commodityDetailsFlag},
- </if>
- <if test="productCode != null and productCode != ''">
- productCode = #{productCode},
- </if>
- <if test="searchKey != null and searchKey != ''">
- searchKey = #{searchKey},
- </if>
- <if test="allAreaFlag != null and allAreaFlag != ''">
- allAreaFlag = #{allAreaFlag},
- </if>
- <if test="step != null and step != ''">
- step = #{step},
- </if>
- <if test="provinceIds != null and provinceIds != ''">
- provinceIds = #{provinceIds},
- </if>
- <if test="machineType != null and machineType != ''">
- machineType = #{machineType},
- </if>
- <if test="qualificationImg != null and qualificationImg != ''">
- qualificationImg = #{qualificationImg},
- </if>
- <if test="invoiceType != null and invoiceType != ''">
- invoiceType = #{invoiceType},
- </if>
- updateTime = #{updateTime},
- showFlag=#{showFlag}
- where productID = #{productId}
- </update>
- <insert id="insertVaildFlag">
- insert into cm_organize_product_info (organizeId, productId, validFlag)
- values (#{organizeId},#{productId},#{validFlag})
- </insert>
- <update id="updateVaildFlag">
- update cm_organize_product_info
- set validFlag = #{validFlag}
- where productId = #{productId} and organizeId = #{organizeId}
- </update>
- <insert id="insertProductImage">
- insert into productimage (productID, shopID, addTime, image, mainFlag, sortIndex)
- values (#{productId}, #{shopId}, #{addTime}, #{image}, #{mainFlag}, #{sortIndex})
- </insert>
- <insert id="insertProductParameters" parameterType="com.caimei365.commodity.model.po.ProductParameterPo">
- insert into cm_product_related_parameters (productId, paramsName, paramsContent, delFlag)
- values (#{productId}, #{paramsName}, #{paramsContent}, #{delFlag})
- </insert>
- <insert id="insertProductDetailInfo">
- insert into productdetailinfo (productID, propValueAlias, propValueImages,
- detailInfo, serviceInfo, orderInfo, detailInfoTxt, seoTitle,
- seoKeyword, seoDes)
- values (#{productId}, #{propValueAlias}, #{propValueImages},
- #{detailInfo}, #{serviceInfo}, #{orderInfo}, #{detailInfoTxt}, #{seoTitle},
- #{seoKeyword}, #{seoDes})
- </insert>
- <insert id="insertBrand" keyColumn="id" keyProperty="id" parameterType="com.caimei365.commodity.model.po.BrandPo"
- useGeneratedKeys="true">
- insert into cm_brand (name, source, userID, status, delFlag, createDate, updateDate, logo, description)
- values (#{name}, #{source}, #{userId}, #{status}, #{delFlag}, #{createDate}, #{updateDate}, #{logo},
- #{description})
- </insert>
- <insert id="insertSku">
- insert into cm_sku
- (productId,
- organizeId,
- normalPrice,
- price,
- costCheckFlag,
- costprice,
- stock,
- minBuyNumber,
- unit,
- ladderPriceFlag,
- shopPercent,
- organizePercent,
- cmPercent)
- values (#{productId},
- #{organizeId},
- #{normalPrice},
- #{price},
- ifnull(#{costCheckFlag}, 1),
- #{costPrice},
- #{stock},
- #{minBuyNumber},
- #{unit},
- ifnull(#{ladderPriceFlag}, 0),
- #{shopPercent},
- #{organizePercent},
- #{cmPercent})
- </insert>
- <insert id="insertProductInfo">
- insert into cm_organize_product_info (organizeId, productId, validFlag)
- values (#{organizeId}, #{productId}, #{validFlag})
- </insert>
- <update id="updateBrand">
- update cm_brand
- <set>
- <if test="name != null">
- `name` = #{name},
- </if>
- <if test="source != null">
- `source` = #{source},
- </if>
- <if test="userId != null">
- userID = #{userId},
- </if>
- <if test="status != null">
- `status` = #{status},
- </if>
- <if test="delFlag != null">
- delFlag = #{delFlag},
- </if>
- <if test="updateDate != null">
- updateDate = #{updateDate},
- </if>
- <if test="logo != null">
- logo = #{logo},
- </if>
- <if test="description != null">
- description = #{description},
- </if>
- </set>
- where id = #{id}
- </update>
- <update id="updateProductImage">
- update productimage
- set productID = #{productId},
- shopID = #{shopId},
- addTime = #{addTime},
- image = #{image},
- mainFlag = #{mainFlag},
- sortIndex = #{sortIndex}
- where productImageId = #{id}
- </update>
- <update id="updateProductDetailInfo">
- update productdetailinfo
- set propValueAlias = #{propValueAlias},
- propValueImages = #{propValueImages},
- detailInfo = #{detailInfo},
- detailInfoTxt = #{detailInfoTxt},
- seoTitle = #{seoTitle},
- seoKeyword = #{seoKeyword},
- seoDes = #{seoDes},
- serviceInfo = #{serviceInfo},
- orderInfo = #{orderInfo}
- where productDetailInfoID = #{productDetailInfoId}
- </update>
- <update id="updateProductFeatured">
- update product
- set featuredFlag = #{featuredFlag}
- where productID = #{productId}
- and shopID = #{shopId}
- </update>
- <update id="updateProductValidFlag">
- update cm_organize_product_info
- set validFlag = #{validFlag}
- where productId = #{productId}
- <if test="organizeId != 0">
- <if test="organizeId == 1">
- and organizeId = 0
- </if>
- <if test="organizeId == 2">
- and organizeId = 4
- </if>
- </if>
- </update>
- <update id="updateProductCode">
- update product
- set productCode = #{productCode}
- where productID = #{productId}
- </update>
- <update id="updateSku">
- update cm_sku
- set minBuyNumber=#{minBuyNumber},
- costPrice=#{costPrice},
- stock=#{stock},
- price=#{price},
- normalPrice=#{normalPrice},
- unit=#{unit}
- where skuId = #{skuId}
- </update>
- <delete id="deleteProductImage">
- delete
- from productimage
- where productImageID = #{id}
- </delete>
- <delete id="deleteProductParameters">
- delete
- from cm_product_related_parameters
- where productId = #{productId}
- </delete>
- <select id="getMainProducts" resultType="com.caimei365.commodity.model.search.ProductListVo">
- select
- p.productID as productId,
- p.actStatus,
- p.shopID as shopId,
- p.`name` as `name`,
- p.mainImage as image,
- (select price from cm_sku where productId=p.productID and organizeId = 0 order by price asc limit 1) as price,
- (select unit from cm_sku where productId=p.productID and organizeId = 0 order by price asc limit 1) as unit,
- p.priceFlag as priceFlag,
- IFNULL(p.visibility,3) as visibility,
- p.productType
- from product p
- left join cm_organize_product_info copi on copi.productId = p.productID and copi.organizeId = 0
- where p.shopID = #{shopId}
- and p.visibility in
- <foreach collection="visibilityList" item="visibility" index="index" open="(" separator="," close=")">
- #{visibility}
- </foreach>
- and copi.validFlag = 2 and p.featuredFlag=1
- order by p.productID desc limit 4
- </select>
- <select id="getShopProductsSelect" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
- select DISTINCT
- p.productID as productId,
- p.actStatus,
- p.name,
- p.aliasName,
- p.mainImage as image,
- (select unit from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1) as unit,
- p.productCode as code,
- p.priceFlag,
- (select price from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1) as price,
- (select normalPrice from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1) as normalPrice,
- p.searchKey as keyword,
- (select minBuyNumber from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1) as minBuyNumber,
- (select ladderPriceFlag from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1) as ladderPriceFlag,
- p.step,
- p.shopID as shopId,
- p.taxPoint as taxRate,
- p.includedTax,
- p.invoiceType,
- p.productCategory as productCategory,
- IFNULL((SELECT validFlag FROM cm_organize_product_info WHERE productId = p.productID AND organizeId = 0), 999) AS validFlag,
- IFNULL((SELECT validFlag FROM cm_organize_product_info WHERE productId = p.productID AND organizeId = 4), 999) AS mallValidFlag,
- p.featuredFlag,
- p.commodityType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- ifnull(p.newvalidFlag,3) as newvalidFlag,
- ifnull(p.showFlag,0) as showFlag,
- p.groundMall AS groundMall
- from product p
- LEFT JOIN cm_organize_product_info copi ON copi.productId = p.productID
- <where>
- p.shopID = #{shopId}
- <if test="productCode != null and productCode != ''">
- and p.productCode = #{productCode}
- </if>
- <if test="validFlag != null and validFlag != ''">
- and copi.validFlag = #{validFlag}
- </if>
- <if test="featuredFlag != null and featuredFlag != ''">
- and p.featuredFlag = #{featuredFlag}
- </if>
- <if test="tinyTypeId != null and tinyTypeId != 0">
- and p.tinyTypeID = #{tinyTypeId}
- </if>
- <if test="smallTypeId != null and smallTypeId != 0">
- and p.smallTypeID = #{smallTypeId}
- </if>
- <if test="bigTypeId != null and bigTypeId != 0">
- and p.bigTypeID = #{bigTypeId}
- </if>
- <if test="commodityType != null and commodityType != ''">
- and p.commodityType = #{commodityType}
- </if>
- <if test="name != null and name != ''">
- and p.name like CONCAT("%",#{name},"%")
- </if>
- <if test="groundMall != null and groundMall != ''">
- and p.groundMall like concat('%',#{groundMall},'%')
- </if>
- <if test="newvalidFlag !=null and newvalidFlag!=''">
- and newvalidFlag =#{newvalidFlag}
- </if>
- <if test="showFlag != null">
- and showFlag =#{showFlag}
- </if>
- </where>
- order by p.productID desc
- </select>
- <select id="getTypeName" resultType="java.lang.String">
- select CONCAT_WS("-", b.name, s.name, t.name)
- from bigtype b
- left join smalltype s on s.smallTypeID = #{smallTypeId}
- left join tinytype t on t.tinyTypeID = #{tinyTypeId}
- where b.bigTypeID = #{bigTypeId};
- </select>
- <select id="getUserIdByshopId" resultType="java.lang.Integer">
- select userID
- from user
- where shopID = #{shopId}
- </select>
- <select id="getMainProductsCount" resultType="java.lang.Integer">
- select count(*)
- from product p
- left join cm_organize_product_info copi on copi.productId = p.productId
- where p.shopID = #{shopId}
- and copi.validFlag = '2'
- and p.featuredFlag = '1'
- order by p.productID desc
- </select>
- <select id="getCodeByTypeId" resultType="java.lang.String">
- select
- CONCAT(IFNULL(b.bigTypeCode,''), IFNULL(s.smallTypeCode,''), IFNULL(t.tinyTypeCode,''))
- from bigtype b
- left join smalltype s on s.bigTypeID = b.bigTypeID
- left join tinytype t on t.smallTypeID = s.smallTypeID
- <where>
- <if test="bigTypeId != null">
- b.bigTypeID = #{bigTypeId}
- </if>
- <if test="smallTypeId != null">
- and s.smallTypeID = #{smallTypeId}
- </if>
- <if test="tinyTypeId != null">
- and t.tinyTypeID = #{tinyTypeId}
- </if>
- </where>
- </select>
- <select id="getImageByProductId" resultType="com.caimei365.commodity.model.po.ProductImagePo">
- select productImageID as id, productID as productId, shopID as shopId, addTime, image, mainFlag, sortIndex
- from productimage
- where productID = #{productId}
- order by mainFlag DESC
- </select>
- <select id="getProductForm" resultType="com.caimei365.commodity.model.vo.ProductFormVo">
- select productID as productId,
- groundMall,
- shopID as shopId,
- name,
- aliasName,
- commodityType,
- mainImage,
- (select stock from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1) as stock,
- invoiceType,
- bigTypeID as bigTypeId,
- smallTypeID as smallTypeId,
- tinyTypeID as tinyTypeId,
- searchKey,
- visibility,
- brandID as brandId,
- productType,
- tags,
- (select unit from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1)as unit,
- (select normalPrice from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1)as normalPrice,
- (select price from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1)as price,
- includedTax,
- (select minBuyNumber from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1)as minBuyNumber,
- productCategory,
- serviceNumber,
- supplierTaxPoint,
- priceFlag,
- actFlag,
- (select ladderPriceFlag from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1) as ladderPriceFlag,
- addTime,
- hasSkuFlag,
- sellNumber,
- sortIndex,
- featuredFlag,
- (select costCheckFlag from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1)as costCheckFlag,
- recommendType,
- machineType,
- productCode,
- updateTime,
- IFNULL((SELECT validFlag FROM cm_organize_product_info WHERE productId = p.productID AND organizeId = 0), 999) AS validFlag,
- IFNULL((SELECT validFlag FROM cm_organize_product_info WHERE productId = p.productID AND organizeId = 4), 999) AS mallValidFlag,
- searchKey,
- allAreaFlag,
- step,
- (select costPrice from cm_sku where productId=p.productId and organizeId = 0 order by price asc LIMIT 1)as costPrice,
- provinceIds,
- qualificationImg,
- trainingMethod,
- trainingType,
- trainingFee,
- ifnull(newProductType, 2) as newProductType,
- qualificationNo as qualificationNo,
- productName as productName,
- qualificationTime as qualificationTime,
- qualificationLink as qualificationLink
- from product p
- where productID = #{productId}
- </select>
- <select id="getBrandNameById" resultType="java.lang.String">
- select name
- from cm_brand
- where id = #{brandId}
- </select>
- <select id="getProductParameters" resultType="com.caimei365.commodity.model.po.ProductParameterPo">
- select id, productID as productId, paramsName, paramsContent
- from cm_product_related_parameters
- where productId = #{productId}
- AND delFlag = '0'
- </select>
- <select id="getProductImages" resultType="com.caimei365.commodity.model.po.ProductImagePo">
- select productImageID as id, productID as productId, shopId, addTime, image, mainFlag, sortIndex
- from productimage
- where productID = #{productId}
- UNION
- SELECT p.productImageID AS id, p.productID AS productId, p.shopId, p.ADDTIME, p.image, p.mainFlag, p.sortIndex
- FROM productimage p
- LEFT JOIN product pt ON p.productId = pt.productId
- WHERE pt.productId = #{productId}
- order by mainFlag desc
- </select>
- <select id="getProductDetailInfo" resultType="com.caimei365.commodity.model.po.ProductDetailInfoPo">
- select productDetailInfoId,
- productId,
- detailInfo,
- commonDetailInfo,
- serviceInfo,
- orderInfo,
- propValueAlias,
- propValueImages,
- detailInfoTxt,
- seoTitle,
- seoKeyword,
- seoDes
- from productdetailinfo
- where productId = #{productId}
- </select>
- <select id="getProductOrganizeDetailInfo" resultType="com.caimei365.commodity.model.po.ProductDetailInfoPo">
- SELECT p.productDetailInfoId,
- p.productId,
- p.detailInfo,
- p.commonDetailInfo,
- p.serviceInfo,
- p.orderInfo,
- p.propValueAlias,
- p.propValueImages,
- p.detailInfoTxt,
- p.seoTitle,
- p.seoKeyword,
- p.seoDes
- FROM productdetailinfo p
- LEFT JOIN product pt ON pt.productId = p.productId
- WHERE p.productId = #{productId}
- </select>
- <select id="getProductShopById" resultType="com.caimei365.commodity.model.vo.ShopVo">
- select userID as userId,
- shopID as shopId,
- name,
- sname as shortName,
- linkMan,
- contractMobile,
- contractEmail,
- contractEmail as email,
- provinceID as proviceId,
- cityID as cityId,
- townID as townId,
- address,
- socialCreditCode,
- businessLicenseImage as businessLicense,
- firstShopType,
- secondShopType,
- mainpro as mainProduct,
- productDesc as mainProductDesc,
- legalPerson,
- registeredCapital,
- fax as faxNumber,
- nature as companyNature,
- turnover,
- medicalPracticeLicenseImg1 as medicalPracticeLicense,
- info as shopDesc,
- businessScope,
- logo,
- addTime,
- status,
- contractPhone,
- validFlag,
- website,
- wxOfficialAccount,
- wxApplets
- from shop
- where shopID = #{shopId}
- </select>
- <select id="getProductNumById" resultType="java.lang.Integer">
- select COUNT(*) as normalNum
- from product p
- left join cm_organize_product_info copi on copi.productId = p.productID
- where p.shopID = #{shopId}
- and copi.validFlag = 2
- group by p.shopID
- </select>
- <select id="getUserIdentityById" resultType="java.lang.Integer">
- select userIdentity
- from user
- where userID = #{userId}
- </select>
- <select id="getBrandAssociation" resultType="com.caimei365.commodity.model.vo.BrandVo">
- select id, name
- from cm_brand
- where status = '1'
- and delFlag = '0'
- and name like CONCAT("%", #{name}, "%")
- order by case
- when (source = '1' and userID = #{userId})
- then 0
- else 1
- end asc,
- LENGTH(name) asc
- </select>
- <select id="getBrandByName" resultType="com.caimei365.commodity.model.vo.BrandVo">
- select id, name
- from cm_brand
- where name = #{name}
- and delFlag = '0'
- </select>
- <select id="getShopBrandList" resultType="com.caimei365.commodity.model.vo.BrandVo">
- select id, name, source, userId, status, auditNote, sort, delFlag, logo, description, createDate, updateDate
- from cm_brand
- <where>
- userID = #{userId}
- and delFlag = '0'
- <if test="name != null and name != ''">
- and name like CONCAT("%",#{name},"%")
- </if>
- <if test="status != null and status != ''">
- and status = #{status}
- </if>
- </where>
- order by createDate desc
- </select>
- <select id="getPcBeautyStatusById" resultType="java.lang.Integer">
- select i.productId
- from new_page_floor_image i
- left join cm_page_centre c on i.centreId = c.id
- left join cm_page p on c.pageId = p.id
- where i.productId = #{productId}
- and i.pcStatus = 1
- and p.type = 7
- and c.enabledStatus = 1
- and p.enabledStatus = 1
- limit 1
- </select>
- <select id="getAppletsBeautyStatusById" resultType="java.lang.Integer">
- select i.productId
- from new_page_floor_image i
- left join cm_page_centre c on i.centreId = c.id
- left join cm_page p on c.pageId = p.id
- where i.productId = #{productId}
- and i.appletsStatus = 1
- and p.type = 7
- and c.crmEnabledStatus = 1
- and p.enabledStatus = 1
- limit 1
- </select>
- <select id="getShopNameByShopId" resultType="java.lang.String">
- select name
- from shop
- where shopID = #{shopId}
- </select>
- <select id="listingFee" resultType="java.lang.Integer">
- SELECT COUNT(*)
- FROM `cm_discern_receipt`
- WHERE newReceiptType = 1
- AND shopID = #{shopID}
- </select>
- <select id="listingfeeExpire" resultType="java.lang.Integer">
- SELECT COUNT(*)
- FROM `cm_discern_receipt`
- WHERE newReceiptType = 1
- AND shopID = #{shopID}
- AND NOW() > DATE_ADD(receiptDate, INTERVAL 1 YEAR)
- </select>
- <select id="receStatct" resultType="java.lang.Integer">
- SELECT COUNT(*)
- FROM `cm_discern_receipt`
- WHERE newReceiptType = 1
- AND shopID = #{shopID}
- AND receStatct = 2
- </select>
- </mapper>
|