|
@@ -1,233 +1,238 @@
|
|
|
<?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 id="insertProduct" keyColumn="productID" keyProperty="productId"
|
|
|
+ parameterType="com.caimei365.commodity.model.po.ProductPo" useGeneratedKeys="true">
|
|
|
insert into product (
|
|
|
- shopID, name, aliasName, commodityType, bigTypeID, smallTypeID, tinyTypeID, mainImage,
|
|
|
- brandID, productType, tags, unit, normalPrice, price, includedTax, minBuyNumber, stock
|
|
|
+ shopID, name, aliasName, commodityType, bigTypeID, smallTypeID, tinyTypeID, mainImage,
|
|
|
+ brandID, productType, tags, unit, normalPrice, price, includedTax, minBuyNumber, stock,
|
|
|
|
|
|
- <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="costCheckFlag != null and costCheckFlag != ''">
|
|
|
- costCheckFlag,
|
|
|
- </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="ladderPriceFlag != null and ladderPriceFlag != ''">
|
|
|
- ladderPriceFlag,
|
|
|
- </if>
|
|
|
- <if test="visibility != null and visibility != ''">
|
|
|
- visibility,
|
|
|
- </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="costPrice != null and costPrice != ''">
|
|
|
- costPrice,
|
|
|
- </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>
|
|
|
- updateTime, validFlag,newvalidFlag
|
|
|
+ <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="costCheckFlag != null and costCheckFlag != ''">
|
|
|
+ costCheckFlag,
|
|
|
+ </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="ladderPriceFlag != null and ladderPriceFlag != ''">
|
|
|
+ ladderPriceFlag,
|
|
|
+ </if>
|
|
|
+ <if test="visibility != null and visibility != ''">
|
|
|
+ visibility,
|
|
|
+ </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="costPrice != null and costPrice != ''">
|
|
|
+ costPrice,
|
|
|
+ </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>
|
|
|
+ updateTime,validFlag,newProductType
|
|
|
) values (
|
|
|
- #{shopId}, #{name}, #{aliasName}, #{commodityType}, #{bigTypeId}, #{smallTypeId}, #{tinyTypeId}, #{mainImage},
|
|
|
- #{brandId}, #{productType}, #{tags}, #{unit}, #{normalPrice}, #{price}, #{includedTax}, #{minBuyNumber}, #{stock},
|
|
|
- <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="costCheckFlag != null and costCheckFlag != ''">
|
|
|
- #{costCheckFlag},
|
|
|
- </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="ladderPriceFlag != null and ladderPriceFlag != ''">
|
|
|
- #{ladderPriceFlag},
|
|
|
- </if>
|
|
|
- <if test="visibility != null and visibility != ''">
|
|
|
- #{visibility},
|
|
|
- </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="costPrice != null and costPrice != ''">
|
|
|
- #{costPrice},
|
|
|
- </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>
|
|
|
- #{updateTime}, #{validFlag},#{newvalidFlag}
|
|
|
+ #{shopId}, #{name}, #{aliasName}, #{commodityType}, #{bigTypeId}, #{smallTypeId}, #{tinyTypeId}, #{mainImage},
|
|
|
+ #{brandId}, #{productType}, #{tags}, #{unit}, #{normalPrice}, #{price}, #{includedTax}, #{minBuyNumber},
|
|
|
+ #{stock},
|
|
|
+ <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="costCheckFlag != null and costCheckFlag != ''">
|
|
|
+ #{costCheckFlag},
|
|
|
+ </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="ladderPriceFlag != null and ladderPriceFlag != ''">
|
|
|
+ #{ladderPriceFlag},
|
|
|
+ </if>
|
|
|
+ <if test="visibility != null and visibility != ''">
|
|
|
+ #{visibility},
|
|
|
+ </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="costPrice != null and costPrice != ''">
|
|
|
+ #{costPrice},
|
|
|
+ </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>
|
|
|
+ #{updateTime}, #{validFlag},#{newProductType}
|
|
|
)
|
|
|
</insert>
|
|
|
<update id="updateProduct">
|
|
|
update product set
|
|
|
- shopID = #{shopId}, name = #{name}, aliasName = #{aliasName}, commodityType = #{commodityType},
|
|
|
- bigTypeId = #{bigTypeId}, smallTypeId = #{smallTypeId}, tinyTypeId = #{tinyTypeId}, mainImage = #{mainImage},
|
|
|
- brandId = #{brandId}, productType = #{productType}, tags = #{tags}, unit = #{unit}, normalPrice = #{normalPrice},
|
|
|
- price = #{price}, price = #{price}, includedTax = #{includedTax}, minBuyNumber = #{minBuyNumber}, stock = #{stock},
|
|
|
- newvalidFlag=#{newvalidFlag}
|
|
|
- <if test="productCategory != null and productCategory != ''">
|
|
|
- productCategory = #{productCategory},
|
|
|
- </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="costCheckFlag != null and costCheckFlag != ''">
|
|
|
- costCheckFlag = #{costCheckFlag},
|
|
|
- </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="ladderPriceFlag != null and ladderPriceFlag != ''">
|
|
|
- ladderPriceFlag = #{ladderPriceFlag},
|
|
|
- </if>
|
|
|
- <if test="visibility != null and visibility != ''">
|
|
|
- visibility = #{visibility},
|
|
|
- </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="costPrice != null and costPrice != ''">
|
|
|
- costPrice = #{costPrice},
|
|
|
- </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}, validFlag = #{validFlag}
|
|
|
+ shopID = #{shopId}, name = #{name}, aliasName = #{aliasName}, commodityType = #{commodityType},
|
|
|
+ bigTypeId = #{bigTypeId}, smallTypeId = #{smallTypeId}, tinyTypeId = #{tinyTypeId}, mainImage = #{mainImage},
|
|
|
+ brandId = #{brandId}, productType = #{productType}, tags = #{tags}, unit = #{unit}, normalPrice = #{normalPrice},
|
|
|
+ price = #{price}, price = #{price}, includedTax = #{includedTax}, minBuyNumber = #{minBuyNumber}, stock =
|
|
|
+ #{stock},
|
|
|
+ newProductType=#{newProductType},
|
|
|
+ <if test="productCategory != null and productCategory != ''">
|
|
|
+ productCategory = #{productCategory},
|
|
|
+ </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="costCheckFlag != null and costCheckFlag != ''">
|
|
|
+ costCheckFlag = #{costCheckFlag},
|
|
|
+ </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="ladderPriceFlag != null and ladderPriceFlag != ''">
|
|
|
+ ladderPriceFlag = #{ladderPriceFlag},
|
|
|
+ </if>
|
|
|
+ <if test="visibility != null and visibility != ''">
|
|
|
+ visibility = #{visibility},
|
|
|
+ </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="costPrice != null and costPrice != ''">
|
|
|
+ costPrice = #{costPrice},
|
|
|
+ </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},
|
|
|
+ validFlag = #{validFlag},
|
|
|
+ showFlag=#{showFlag}
|
|
|
where productID = #{productId}
|
|
|
</update>
|
|
|
<insert id="insertProductImage">
|
|
@@ -239,19 +244,18 @@
|
|
|
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 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 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})
|
|
|
+ values (#{name}, #{source}, #{userId}, #{status}, #{delFlag}, #{createDate}, #{updateDate}, #{logo},
|
|
|
+ #{description})
|
|
|
</insert>
|
|
|
<update id="updateBrand">
|
|
|
update cm_brand
|
|
@@ -284,54 +288,67 @@
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
<update id="updateProductImage">
|
|
|
- update productimage set productID = #{productId}, shopID = #{shopId}, addTime = #{addTime},
|
|
|
- image = #{image}, mainFlag = #{mainFlag}, sortIndex = #{sortIndex}
|
|
|
+ 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 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}
|
|
|
+ update product
|
|
|
+ set featuredFlag = #{featuredFlag}
|
|
|
where productID = #{productId}
|
|
|
- and shopID = #{shopId}
|
|
|
+ and shopID = #{shopId}
|
|
|
</update>
|
|
|
<update id="updateProductValidFlag">
|
|
|
- update product set validFlag = #{validFlag} where productID = #{productId}
|
|
|
+ update product
|
|
|
+ set validFlag = #{validFlag}
|
|
|
+ where productID = #{productId}
|
|
|
</update>
|
|
|
<update id="updateProductCode">
|
|
|
- update product set productCode = #{productCode} where productID = #{productId}
|
|
|
+ update product
|
|
|
+ set productCode = #{productCode}
|
|
|
+ where productID = #{productId}
|
|
|
</update>
|
|
|
<delete id="deleteProductImage">
|
|
|
- delete from productimage where productImageID = #{id}
|
|
|
+ delete
|
|
|
+ from productimage
|
|
|
+ where productImageID = #{id}
|
|
|
</delete>
|
|
|
<delete id="deleteProductParameters">
|
|
|
- delete from cm_product_related_parameters where productId = #{productId}
|
|
|
+ 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,
|
|
|
- p.price as price,
|
|
|
- p.unit as unit,
|
|
|
- p.priceFlag as priceFlag,
|
|
|
- IFNULL(p.visibility,3) as visibility,
|
|
|
- p.productType
|
|
|
- from product p
|
|
|
+ select
|
|
|
+ p.productID as productId,
|
|
|
+ p.actStatus,
|
|
|
+ p.shopID as shopId,
|
|
|
+ p.`name` as `name`,
|
|
|
+ p.mainImage as image,
|
|
|
+ p.price as price,
|
|
|
+ p.unit as unit,
|
|
|
+ p.priceFlag as priceFlag,
|
|
|
+ IFNULL(p.visibility,3) as visibility,
|
|
|
+ p.productType
|
|
|
+ from product p
|
|
|
where p.shopID = #{shopId}
|
|
|
and p.visibility in
|
|
|
<foreach collection="visibilityList" item="visibility" index="index" open="(" separator="," close=")">
|
|
@@ -342,34 +359,34 @@
|
|
|
</select>
|
|
|
<select id="getShopProductsSelect" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
|
|
|
select
|
|
|
- p.productID as productId,
|
|
|
- p.actStatus,
|
|
|
- p.name,
|
|
|
- p.aliasName,
|
|
|
- p.mainImage as image,
|
|
|
- p.unit,
|
|
|
- p.productCode as code,
|
|
|
- p.priceFlag,
|
|
|
- p.price,
|
|
|
- p.shopID as shopId,
|
|
|
- p.searchKey as keyword,
|
|
|
- p.minBuyNumber as minBuyNumber,
|
|
|
- p.maxBuyNumber as maxBuyNumber,
|
|
|
- p.ladderPriceFlag,
|
|
|
- p.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.newvalidFlag
|
|
|
+ p.productID as productId,
|
|
|
+ p.actStatus,
|
|
|
+ p.name,
|
|
|
+ p.aliasName,
|
|
|
+ p.mainImage as image,
|
|
|
+ p.unit,
|
|
|
+ p.productCode as code,
|
|
|
+ p.priceFlag,
|
|
|
+ p.price,
|
|
|
+ p.searchKey as keyword,
|
|
|
+ p.minBuyNumber as minBuyNumber,
|
|
|
+ p.maxBuyNumber as maxBuyNumber,
|
|
|
+ p.ladderPriceFlag,
|
|
|
+ p.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,
|
|
|
+ ifnull(p.newvalidFlag,3) as newvalidFlag,
|
|
|
+ ifnull(p.showFlag,0) as showFlag
|
|
|
from product p
|
|
|
<where>
|
|
|
p.shopID = #{shopId}
|
|
@@ -397,32 +414,38 @@
|
|
|
<if test="name != null and name != ''">
|
|
|
and p.name like CONCAT("%",#{name},"%")
|
|
|
</if>
|
|
|
- <if test="newvalidFlag !=null and newvalidFlag!=''">
|
|
|
- and newvalidFlag =#{newvalidFlag}
|
|
|
- </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 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 userID
|
|
|
+ from user
|
|
|
+ where shopID = #{shopId}
|
|
|
</select>
|
|
|
<select id="getMainProductsCount" resultType="java.lang.Integer">
|
|
|
- select count(*) from product where shopID = #{shopId}
|
|
|
- and validFlag = '2' and featuredFlag='1' order by productID desc
|
|
|
+ select count(*)
|
|
|
+ from product
|
|
|
+ where shopID = #{shopId}
|
|
|
+ and validFlag = '2'
|
|
|
+ and featuredFlag = '1'
|
|
|
+ order by productID desc
|
|
|
</select>
|
|
|
<select id="getCodeByTypeId" resultType="java.lang.String">
|
|
|
select
|
|
|
- CONCAT(IFNULL(b.bigTypeCode,''), IFNULL(s.smallTypeCode,''), IFNULL(t.tinyTypeCode,''))
|
|
|
+ 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
|
|
@@ -445,92 +468,201 @@
|
|
|
order by mainFlag DESC
|
|
|
</select>
|
|
|
<select id="getProductForm" resultType="com.caimei365.commodity.model.vo.ProductFormVo">
|
|
|
- select productID as productId, shopID as shopId, name, aliasName, commodityType, mainImage, stock, invoiceType,
|
|
|
- bigTypeID as bigTypeId, smallTypeID as smallTypeId, tinyTypeID as tinyTypeId, searchKey, visibility,
|
|
|
- brandID as brandId, productType, tags, unit, normalPrice, price, includedTax, minBuyNumber,
|
|
|
- productCategory, serviceNumber, supplierTaxPoint, priceFlag, actFlag, ladderPriceFlag,
|
|
|
- addTime, hasSkuFlag, sellNumber, sortIndex, featuredFlag, costCheckFlag, recommendType, machineType,
|
|
|
- productCode, updateTime, validFlag, searchKey, allAreaFlag, step, costPrice, provinceIds, qualificationImg,
|
|
|
- trainingMethod, trainingType ,trainingFee
|
|
|
+ select productID as productId,
|
|
|
+ shopID as shopId,
|
|
|
+ name,
|
|
|
+ aliasName,
|
|
|
+ commodityType,
|
|
|
+ mainImage,
|
|
|
+ stock,
|
|
|
+ invoiceType,
|
|
|
+ bigTypeID as bigTypeId,
|
|
|
+ smallTypeID as smallTypeId,
|
|
|
+ tinyTypeID as tinyTypeId,
|
|
|
+ searchKey,
|
|
|
+ visibility,
|
|
|
+ brandID as brandId,
|
|
|
+ productType,
|
|
|
+ tags,
|
|
|
+ unit,
|
|
|
+ normalPrice,
|
|
|
+ price,
|
|
|
+ includedTax,
|
|
|
+ minBuyNumber,
|
|
|
+ productCategory,
|
|
|
+ serviceNumber,
|
|
|
+ supplierTaxPoint,
|
|
|
+ priceFlag,
|
|
|
+ actFlag,
|
|
|
+ ladderPriceFlag,
|
|
|
+ addTime,
|
|
|
+ hasSkuFlag,
|
|
|
+ sellNumber,
|
|
|
+ sortIndex,
|
|
|
+ featuredFlag,
|
|
|
+ costCheckFlag,
|
|
|
+ recommendType,
|
|
|
+ machineType,
|
|
|
+ productCode,
|
|
|
+ updateTime,
|
|
|
+ validFlag,
|
|
|
+ searchKey,
|
|
|
+ allAreaFlag,
|
|
|
+ step,
|
|
|
+ costPrice,
|
|
|
+ provinceIds,
|
|
|
+ qualificationImg,
|
|
|
+ trainingMethod,
|
|
|
+ trainingType,
|
|
|
+ trainingFee,
|
|
|
+ ifnull(newProductType,2) as newProductType
|
|
|
from product
|
|
|
where productID = #{productId}
|
|
|
</select>
|
|
|
<select id="getBrandNameById" resultType="java.lang.String">
|
|
|
- select name from cm_brand where id = #{brandId}
|
|
|
+ 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'
|
|
|
+ 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} order by mainFlag desc
|
|
|
+ where 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
|
|
|
+ select productDetailInfoId,
|
|
|
+ productId,
|
|
|
+ detailInfo,
|
|
|
+ commonDetailInfo,
|
|
|
+ serviceInfo,
|
|
|
+ orderInfo,
|
|
|
+ propValueAlias,
|
|
|
+ propValueImages,
|
|
|
+ detailInfoTxt,
|
|
|
+ seoTitle,
|
|
|
+ seoKeyword,
|
|
|
+ seoDes
|
|
|
from productdetailinfo
|
|
|
where 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 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
|
|
|
- where p.shopID = #{shopId} and p.validFlag = 2
|
|
|
+ select COUNT(*) as normalNum
|
|
|
+ from product p
|
|
|
+ where p.shopID = #{shopId}
|
|
|
+ and p.validFlag = 2
|
|
|
group by p.shopID
|
|
|
</select>
|
|
|
<select id="getUserIdentityById" resultType="java.lang.Integer">
|
|
|
- select userIdentity from user
|
|
|
+ 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 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 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 != ''">
|
|
|
+ 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>
|
|
|
+ </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 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 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 name
|
|
|
+ from shop
|
|
|
+ where shopID = #{shopId}
|
|
|
</select>
|
|
|
</mapper>
|