|
@@ -99,10 +99,13 @@
|
|
|
<sql id="ActivityJoins">
|
|
|
LEFT JOIN shop s on s.shopID = a.shopID
|
|
|
</sql>
|
|
|
- <insert id="insertMallProduct" keyColumn="id" keyProperty="id" useGeneratedKeys="true" parameterType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
|
|
|
- INSERT INTO cm_mall_organize_products (organizeID, productID, shopId, normalPrice, costPrice, ladderPriceFlag, minBuyNumber,
|
|
|
+ <insert id="insertMallProduct" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
|
|
|
+ parameterType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
|
|
|
+ INSERT INTO cm_mall_organize_products (organizeID, productID, shopId, normalPrice, costPrice, ladderPriceFlag,
|
|
|
+ minBuyNumber,
|
|
|
validFlag, addTime, updateTime, delFlag)
|
|
|
- VALUES (#{organizeId}, #{productId}, #{shopId}, #{normalPrice}, #{costPrice}, #{ladderPriceFlag}, #{minBuyNumber},
|
|
|
+ VALUES (#{organizeId}, #{productId}, #{shopId}, #{normalPrice}, #{costPrice}, #{ladderPriceFlag},
|
|
|
+ #{minBuyNumber},
|
|
|
#{validFlag}, #{addTime}, #{updateTime}, #{delFlag})
|
|
|
</insert>
|
|
|
<update id="saveSort">
|
|
@@ -123,8 +126,10 @@
|
|
|
<select id="get" resultType="Product">
|
|
|
SELECT
|
|
|
<include refid="productColumns"/>,
|
|
|
- (select costCheckFlag from cm_organize_product_info where productId = #{id} and organizeId = 0 ) as costCheckFlag,
|
|
|
- (select costCheckFlag from cm_organize_product_info where productId = #{id} and organizeId = 4 ) as mallCostCheckFlag
|
|
|
+ (select costCheckFlag from cm_organize_product_info where productId = #{id} and organizeId = 0 ) as
|
|
|
+ costCheckFlag,
|
|
|
+ (select costCheckFlag from cm_organize_product_info where productId = #{id} and organizeId = 4 ) as
|
|
|
+ mallCostCheckFlag
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
WHERE a.productID = #{id}
|
|
@@ -356,7 +361,7 @@
|
|
|
bigTypeID,
|
|
|
smallTypeID,
|
|
|
tinyTypeID,
|
|
|
--- selfTypeID,
|
|
|
+ -- selfTypeID,
|
|
|
shopID,
|
|
|
aliasName,
|
|
|
name,
|
|
@@ -368,28 +373,28 @@
|
|
|
propertiesInfo,
|
|
|
addTime,
|
|
|
updateTime,
|
|
|
--- weekSellNumber,
|
|
|
+ -- weekSellNumber,
|
|
|
beforeValidFlag,
|
|
|
validFlag,
|
|
|
favoriteTimes,
|
|
|
commentScore,
|
|
|
commentTimes,
|
|
|
--- selfRecommendFlag,
|
|
|
--- sysRecommendFlag,
|
|
|
+ -- selfRecommendFlag,
|
|
|
+ -- sysRecommendFlag,
|
|
|
sortIndex,
|
|
|
featuredFlag,
|
|
|
featuredSortIndex,
|
|
|
productCode,
|
|
|
--- synToERPFlag,
|
|
|
+ -- synToERPFlag,
|
|
|
allAreaFlag,
|
|
|
provinceIDs,
|
|
|
serviceNumber,
|
|
|
packageCount,
|
|
|
byFlag,
|
|
|
normalProductFlag,
|
|
|
--- wholeSaleProductFlag,
|
|
|
--- promotionProductFlag,
|
|
|
--- groupBuyProductFlag,
|
|
|
+ -- wholeSaleProductFlag,
|
|
|
+ -- promotionProductFlag,
|
|
|
+ -- groupBuyProductFlag,
|
|
|
step,
|
|
|
actFlag,
|
|
|
actType,
|
|
@@ -397,7 +402,7 @@
|
|
|
onlineTime,
|
|
|
downlineTime,
|
|
|
freePostFlag,
|
|
|
--- precisehKey,
|
|
|
+ -- precisehKey,
|
|
|
visibility,
|
|
|
commodityDetailsFlag,
|
|
|
productType,
|
|
@@ -436,7 +441,7 @@
|
|
|
#{bigTypeID},
|
|
|
#{smallTypeID},
|
|
|
#{tinyTypeID},
|
|
|
--- #{selfTypeID},
|
|
|
+ -- #{selfTypeID},
|
|
|
#{shopID},
|
|
|
#{aliasName},
|
|
|
#{name},
|
|
@@ -448,28 +453,28 @@
|
|
|
#{propertiesInfo},
|
|
|
#{addTime},
|
|
|
#{updateTime},
|
|
|
--- #{weekSellNumber},
|
|
|
+ -- #{weekSellNumber},
|
|
|
#{beforeValidFlag},
|
|
|
#{validFlag},
|
|
|
#{favoriteTimes},
|
|
|
#{commentScore},
|
|
|
#{commentTimes},
|
|
|
--- #{selfRecommendFlag},
|
|
|
--- #{sysRecommendFlag},
|
|
|
+ -- #{selfRecommendFlag},
|
|
|
+ -- #{sysRecommendFlag},
|
|
|
#{sortIndex},
|
|
|
#{featuredFlag},
|
|
|
#{featuredSortIndex},
|
|
|
#{productCode},
|
|
|
--- #{synToERPFlag},
|
|
|
+ -- #{synToERPFlag},
|
|
|
#{allAreaFlag},
|
|
|
#{provinceIDs},
|
|
|
#{serviceNumber},
|
|
|
#{packageCount},
|
|
|
#{byFlag},
|
|
|
#{normalProductFlag},
|
|
|
--- #{wholeSaleProductFlag},
|
|
|
--- #{promotionProductFlag},
|
|
|
--- #{groupBuyProductFlag},
|
|
|
+ -- #{wholeSaleProductFlag},
|
|
|
+ -- #{promotionProductFlag},
|
|
|
+ -- #{groupBuyProductFlag},
|
|
|
#{step},
|
|
|
#{actFlag},
|
|
|
#{actType},
|
|
@@ -477,7 +482,7 @@
|
|
|
#{onlineTime},
|
|
|
#{downlineTime},
|
|
|
#{freePostFlag},
|
|
|
--- #{precisehKey},
|
|
|
+ -- #{precisehKey},
|
|
|
#{visibility},
|
|
|
#{commodityDetailsFlag},
|
|
|
#{productType},
|
|
@@ -515,51 +520,51 @@
|
|
|
|
|
|
<update id="update">
|
|
|
UPDATE product
|
|
|
- SET productID = #{id},
|
|
|
- brandID = #{brandID},
|
|
|
- tinyTypeID = #{tinyTypeID},
|
|
|
+ SET productID = #{id},
|
|
|
+ brandID = #{brandID},
|
|
|
+ tinyTypeID = #{tinyTypeID},
|
|
|
-- selfTypeID = #{selfTypeID},
|
|
|
- shopID = #{shopID},
|
|
|
- name = #{name},
|
|
|
- searchKey = #{searchKey},
|
|
|
- priceFlag = #{priceFlag},
|
|
|
- beautyActFlag = #{beautyActFlag},
|
|
|
- hasSkuFlag = #{hasSkuFlag},
|
|
|
- mainImage = #{mainImage},
|
|
|
- propertiesInfo = #{propertiesInfo},
|
|
|
- addTime = #{addTime},
|
|
|
- updateTime = #{updateTime},
|
|
|
- sellNumber = #{sellNumber},
|
|
|
+ shopID = #{shopID},
|
|
|
+ name = #{name},
|
|
|
+ searchKey = #{searchKey},
|
|
|
+ priceFlag = #{priceFlag},
|
|
|
+ beautyActFlag = #{beautyActFlag},
|
|
|
+ hasSkuFlag = #{hasSkuFlag},
|
|
|
+ mainImage = #{mainImage},
|
|
|
+ propertiesInfo = #{propertiesInfo},
|
|
|
+ addTime = #{addTime},
|
|
|
+ updateTime = #{updateTime},
|
|
|
+ sellNumber = #{sellNumber},
|
|
|
-- weekSellNumber = #{weekSellNumber},
|
|
|
- beforeValidFlag = #{beforeValidFlag},
|
|
|
- validFlag = #{validFlag},
|
|
|
- favoriteTimes = #{favoriteTimes},
|
|
|
- commentScore = #{commentScore},
|
|
|
- commentTimes = #{commentTimes},
|
|
|
+ beforeValidFlag = #{beforeValidFlag},
|
|
|
+ validFlag = #{validFlag},
|
|
|
+ favoriteTimes = #{favoriteTimes},
|
|
|
+ commentScore = #{commentScore},
|
|
|
+ commentTimes = #{commentTimes},
|
|
|
-- selfRecommendFlag = #{selfRecommendFlag},
|
|
|
-- sysRecommendFlag = #{sysRecommendFlag},
|
|
|
- sortIndex = #{sortIndex},
|
|
|
- featuredFlag = #{featuredFlag},
|
|
|
- featuredSortIndex = #{featuredSortIndex},
|
|
|
- productCode = #{productCode},
|
|
|
+ sortIndex = #{sortIndex},
|
|
|
+ featuredFlag = #{featuredFlag},
|
|
|
+ featuredSortIndex = #{featuredSortIndex},
|
|
|
+ productCode = #{productCode},
|
|
|
-- synToERPFlag = #{synToERPFlag},
|
|
|
- allAreaFlag = #{allAreaFlag},
|
|
|
- provinceIDs = #{provinceIDs},
|
|
|
- serviceNumber = #{serviceNumber},
|
|
|
- packageCount = #{packageCount},
|
|
|
- byFlag = #{byFlag},
|
|
|
- normalProductFlag = #{normalProductFlag},
|
|
|
+ allAreaFlag = #{allAreaFlag},
|
|
|
+ provinceIDs = #{provinceIDs},
|
|
|
+ serviceNumber = #{serviceNumber},
|
|
|
+ packageCount = #{packageCount},
|
|
|
+ byFlag = #{byFlag},
|
|
|
+ normalProductFlag = #{normalProductFlag},
|
|
|
-- wholeSaleProductFlag = #{wholeSaleProductFlag},
|
|
|
-- promotionProductFlag = #{promotionProductFlag},
|
|
|
-- groupBuyProductFlag = #{groupBuyProductFlag},
|
|
|
- step = #{step},
|
|
|
- actFlag = #{actFlag},
|
|
|
- actType = #{actType},
|
|
|
- onlineTime = #{onlineTime},
|
|
|
- downlineTime = #{downlineTime},
|
|
|
- freePostFlag = #{freePostFlag},
|
|
|
+ step = #{step},
|
|
|
+ actFlag = #{actFlag},
|
|
|
+ actType = #{actType},
|
|
|
+ onlineTime = #{onlineTime},
|
|
|
+ downlineTime = #{downlineTime},
|
|
|
+ freePostFlag = #{freePostFlag},
|
|
|
-- precisehKey = #{precisehKey},
|
|
|
- actSort = #{actSort},
|
|
|
+ actSort = #{actSort},
|
|
|
newProductType=#{newProductType}
|
|
|
|
|
|
WHERE productID = #{id}
|
|
@@ -688,17 +693,6 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
- <select id="getProductSku" resultType="com.caimei.modules.product.entity.Sku">
|
|
|
- SELECT
|
|
|
- *
|
|
|
- FROM
|
|
|
- sku
|
|
|
- <where>
|
|
|
- productID = #{productId}
|
|
|
- AND validFlag = 1
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="findProductBigTypeByProductID" parameterType="java.lang.Integer" resultType="java.lang.String">
|
|
|
SELECT
|
|
|
tb.name
|
|
@@ -891,7 +885,7 @@
|
|
|
`productCategory`,
|
|
|
</if>
|
|
|
`preferredFlag`,
|
|
|
--- `selfTypeID`,
|
|
|
+ -- `selfTypeID`,
|
|
|
`shopID`,
|
|
|
`name`,
|
|
|
`aliasName`,
|
|
@@ -904,28 +898,28 @@
|
|
|
`propertiesInfo`,
|
|
|
`addTime`,
|
|
|
`updateTime`,
|
|
|
--- `weekSellNumber`,
|
|
|
+ -- `weekSellNumber`,
|
|
|
`beforeValidFlag`,
|
|
|
`validFlag`,
|
|
|
`favoriteTimes`,
|
|
|
`commentScore`,
|
|
|
`commentTimes`,
|
|
|
--- `selfRecommendFlag`,
|
|
|
--- `sysRecommendFlag`,
|
|
|
+ -- `selfRecommendFlag`,
|
|
|
+ -- `sysRecommendFlag`,
|
|
|
`sortIndex`,
|
|
|
`featuredFlag`,
|
|
|
`featuredSortIndex`,
|
|
|
`productCode`,
|
|
|
--- `synToERPFlag`,
|
|
|
+ -- `synToERPFlag`,
|
|
|
`allAreaFlag`,
|
|
|
`provinceIDs`,
|
|
|
`serviceNumber`,
|
|
|
`packageCount`,
|
|
|
`byFlag`,
|
|
|
`normalProductFlag`,
|
|
|
--- `wholeSaleProductFlag`,
|
|
|
--- `promotionProductFlag`,
|
|
|
--- `groupBuyProductFlag`,
|
|
|
+ -- `wholeSaleProductFlag`,
|
|
|
+ -- `promotionProductFlag`,
|
|
|
+ -- `groupBuyProductFlag`,
|
|
|
`step`,
|
|
|
`actFlag`,
|
|
|
`actStatus`,
|
|
@@ -935,7 +929,7 @@
|
|
|
`onlineTime`,
|
|
|
`downlineTime`,
|
|
|
`freePostFlag`,
|
|
|
--- `precisehKey`,
|
|
|
+ -- `precisehKey`,
|
|
|
`tags`,
|
|
|
`productType`,
|
|
|
`machineType`,
|
|
@@ -956,7 +950,7 @@
|
|
|
#{productCategory},
|
|
|
</if>
|
|
|
#{preferredFlag},
|
|
|
--- #{selfTypeID},
|
|
|
+ -- #{selfTypeID},
|
|
|
#{shopID},
|
|
|
#{name},
|
|
|
#{aliasName},
|
|
@@ -969,28 +963,28 @@
|
|
|
#{propertiesInfo},
|
|
|
#{addTime},
|
|
|
#{updateTime},
|
|
|
--- #{weekSellNumber},
|
|
|
+ -- #{weekSellNumber},
|
|
|
#{beforeValidFlag},
|
|
|
#{validFlag},
|
|
|
#{favoriteTimes},
|
|
|
#{commentScore},
|
|
|
#{commentTimes},
|
|
|
--- #{selfRecommendFlag},
|
|
|
--- #{sysRecommendFlag},
|
|
|
+ -- #{selfRecommendFlag},
|
|
|
+ -- #{sysRecommendFlag},
|
|
|
#{sortIndex},
|
|
|
#{featuredFlag},
|
|
|
#{featuredSortIndex},
|
|
|
#{productCode},
|
|
|
--- #{synToERPFlag},
|
|
|
+ -- #{synToERPFlag},
|
|
|
#{allAreaFlag},
|
|
|
#{provinceIDs},
|
|
|
#{serviceNumber},
|
|
|
#{packageCount},
|
|
|
#{byFlag},
|
|
|
#{normalProductFlag},
|
|
|
--- #{wholeSaleProductFlag},
|
|
|
--- #{promotionProductFlag},
|
|
|
--- #{groupBuyProductFlag},
|
|
|
+ -- #{wholeSaleProductFlag},
|
|
|
+ -- #{promotionProductFlag},
|
|
|
+ -- #{groupBuyProductFlag},
|
|
|
#{step},
|
|
|
#{actFlag},
|
|
|
#{actStatus},
|
|
@@ -1000,7 +994,7 @@
|
|
|
#{onlineTime},
|
|
|
#{downlineTime},
|
|
|
#{freePostFlag},
|
|
|
--- #{precisehKey},
|
|
|
+ -- #{precisehKey},
|
|
|
#{tags},
|
|
|
#{productType},
|
|
|
#{machineType},
|
|
@@ -1050,59 +1044,60 @@
|
|
|
useGeneratedKeys="true">
|
|
|
insert into cm_sku
|
|
|
(productId,
|
|
|
- normalPrice,
|
|
|
- price,
|
|
|
- ladderPriceFlag,
|
|
|
- <if test="costPrice != null">
|
|
|
+ normalPrice,
|
|
|
+ price,
|
|
|
+ ladderPriceFlag,
|
|
|
+ <if test="costPrice != null">
|
|
|
costprice,
|
|
|
- </if>
|
|
|
- <if test="organizeCostPrice != null">
|
|
|
+ </if>
|
|
|
+ <if test="organizeCostPrice != null">
|
|
|
organizeCostPrice,
|
|
|
- </if>
|
|
|
- <if test="cmCostPrice != null">
|
|
|
+ </if>
|
|
|
+ <if test="cmCostPrice != null">
|
|
|
cmCostPrice,
|
|
|
- </if>
|
|
|
- stock,
|
|
|
- <if test="shopPercent != null">
|
|
|
+ </if>
|
|
|
+ stock,
|
|
|
+ <if test="shopPercent != null">
|
|
|
shopPercent,
|
|
|
- </if>
|
|
|
- <if test="organizePercent != null">
|
|
|
+ </if>
|
|
|
+ <if test="organizePercent != null">
|
|
|
organizePercent,
|
|
|
- </if>
|
|
|
- <if test="cmPercent != null">
|
|
|
+ </if>
|
|
|
+ <if test="cmPercent != null">
|
|
|
cmPercent,
|
|
|
- </if>
|
|
|
- organizeId,
|
|
|
- minBuyNumber,
|
|
|
- unit)
|
|
|
+ </if>
|
|
|
+ organizeId,
|
|
|
+ minBuyNumber,
|
|
|
+ unit)
|
|
|
values (#{productId},
|
|
|
- #{normalPrice},
|
|
|
- #{price},
|
|
|
- #{ladderPriceFlag},
|
|
|
- <if test="costPrice != null">
|
|
|
- #{costPrice},
|
|
|
- </if>
|
|
|
- <if test="organizeCostPrice != null">
|
|
|
- #{organizeCostPrice},
|
|
|
- </if>
|
|
|
- <if test="cmCostPrice != null">
|
|
|
- #{cmCostPrice},
|
|
|
- </if>
|
|
|
- #{stock},
|
|
|
- <if test="shopPercent != null">
|
|
|
- #{shopPercent},
|
|
|
- </if>
|
|
|
- <if test="organizePercent != null">
|
|
|
- #{organizePercent},
|
|
|
- </if>
|
|
|
- <if test="cmPercent != null">
|
|
|
- #{cmPercent},
|
|
|
- </if>
|
|
|
- #{organizeId},
|
|
|
- #{minBuyNumber},
|
|
|
- #{unit})
|
|
|
+ #{normalPrice},
|
|
|
+ #{price},
|
|
|
+ #{ladderPriceFlag},
|
|
|
+ <if test="costPrice != null">
|
|
|
+ #{costPrice},
|
|
|
+ </if>
|
|
|
+ <if test="organizeCostPrice != null">
|
|
|
+ #{organizeCostPrice},
|
|
|
+ </if>
|
|
|
+ <if test="cmCostPrice != null">
|
|
|
+ #{cmCostPrice},
|
|
|
+ </if>
|
|
|
+ #{stock},
|
|
|
+ <if test="shopPercent != null">
|
|
|
+ #{shopPercent},
|
|
|
+ </if>
|
|
|
+ <if test="organizePercent != null">
|
|
|
+ #{organizePercent},
|
|
|
+ </if>
|
|
|
+ <if test="cmPercent != null">
|
|
|
+ #{cmPercent},
|
|
|
+ </if>
|
|
|
+ #{organizeId},
|
|
|
+ #{minBuyNumber},
|
|
|
+ #{unit})
|
|
|
</insert>
|
|
|
- <insert id="insertOrganizeSku" keyColumn="id" keyProperty="id" parameterType="com.caimei.modules.product.entity.CmSku"
|
|
|
+ <insert id="insertOrganizeSku" keyColumn="id" keyProperty="id"
|
|
|
+ parameterType="com.caimei.modules.product.entity.CmSku"
|
|
|
useGeneratedKeys="true">
|
|
|
insert into cm_mall_product_sku
|
|
|
(productId,
|
|
@@ -1220,7 +1215,8 @@
|
|
|
select productId
|
|
|
from cm_sku cs
|
|
|
where skuId = #{productId}
|
|
|
- and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=#{productId})
|
|
|
+ #暂时写死0
|
|
|
+ and cs.organizeId = 0 limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="toAddProductList" resultType="product">
|
|
@@ -1513,15 +1509,15 @@
|
|
|
<if test="updateTime != null and updateTime !=''">
|
|
|
updateTime = #{updateTime},
|
|
|
</if>
|
|
|
-<!-- <if test="weekSellNumber != null and weekSellNumber !=''">-->
|
|
|
-<!-- weekSellNumber = #{weekSellNumber},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="weekSellNumber != null and weekSellNumber !=''">-->
|
|
|
+ <!-- weekSellNumber = #{weekSellNumber},-->
|
|
|
+ <!-- </if>-->
|
|
|
<if test="beforeValidFlag != null and beforeValidFlag !=''">
|
|
|
beforeValidFlag = #{beforeValidFlag},
|
|
|
</if>
|
|
|
-<!-- <if test="validFlag != null and validFlag !=''">-->
|
|
|
-<!-- validFlag = #{validFlag},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="validFlag != null and validFlag !=''">-->
|
|
|
+ <!-- validFlag = #{validFlag},-->
|
|
|
+ <!-- </if>-->
|
|
|
<if test="favoriteTimes != null and favoriteTimes !=''">
|
|
|
favoriteTimes = #{favoriteTimes},
|
|
|
</if>
|
|
@@ -1531,12 +1527,12 @@
|
|
|
<if test="commentTimes != null and commentTimes !=''">
|
|
|
commentTimes = #{commentTimes},
|
|
|
</if>
|
|
|
-<!-- <if test="selfRecommendFlag != null and selfRecommendFlag !=''">-->
|
|
|
-<!-- selfRecommendFlag = #{selfRecommendFlag},-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="sysRecommendFlag != null and sysRecommendFlag !=''">-->
|
|
|
-<!-- sysRecommendFlag = #{sysRecommendFlag},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="selfRecommendFlag != null and selfRecommendFlag !=''">-->
|
|
|
+ <!-- selfRecommendFlag = #{selfRecommendFlag},-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="sysRecommendFlag != null and sysRecommendFlag !=''">-->
|
|
|
+ <!-- sysRecommendFlag = #{sysRecommendFlag},-->
|
|
|
+ <!-- </if>-->
|
|
|
<if test="sortIndex != null and sortIndex != ''">
|
|
|
sortIndex = #{sortIndex},
|
|
|
</if>
|
|
@@ -1549,9 +1545,9 @@
|
|
|
<if test="productCode != null and productCode !=''">
|
|
|
productCode = #{productCode},
|
|
|
</if>
|
|
|
-<!-- <if test="synToERPFlag != null and synToERPFlag !=''">-->
|
|
|
-<!-- synToERPFlag = #{synToERPFlag},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="synToERPFlag != null and synToERPFlag !=''">-->
|
|
|
+ <!-- synToERPFlag = #{synToERPFlag},-->
|
|
|
+ <!-- </if>-->
|
|
|
<if test="allAreaFlag != null and allAreaFlag !=''">
|
|
|
allAreaFlag = #{allAreaFlag},
|
|
|
</if>
|
|
@@ -1570,15 +1566,15 @@
|
|
|
<if test="normalProductFlag != null and normalProductFlag !=''">
|
|
|
normalProductFlag = #{normalProductFlag},
|
|
|
</if>
|
|
|
-<!-- <if test="wholeSaleProductFlag != null and wholeSaleProductFlag !=''">-->
|
|
|
-<!-- wholeSaleProductFlag = #{wholeSaleProductFlag},-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="promotionProductFlag != null and promotionProductFlag !=''">-->
|
|
|
-<!-- promotionProductFlag = #{promotionProductFlag},-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="groupBuyProductFlag != null and groupBuyProductFlag !=''">-->
|
|
|
-<!-- groupBuyProductFlag = #{groupBuyProductFlag},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="wholeSaleProductFlag != null and wholeSaleProductFlag !=''">-->
|
|
|
+ <!-- wholeSaleProductFlag = #{wholeSaleProductFlag},-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="promotionProductFlag != null and promotionProductFlag !=''">-->
|
|
|
+ <!-- promotionProductFlag = #{promotionProductFlag},-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="groupBuyProductFlag != null and groupBuyProductFlag !=''">-->
|
|
|
+ <!-- groupBuyProductFlag = #{groupBuyProductFlag},-->
|
|
|
+ <!-- </if>-->
|
|
|
<if test="step != null and step !=''">
|
|
|
step = #{step},
|
|
|
</if>
|
|
@@ -1600,9 +1596,9 @@
|
|
|
<if test="freePostFlag != null and freePostFlag !=''">
|
|
|
freePostFlag = #{freePostFlag},
|
|
|
</if>
|
|
|
-<!-- <if test="precisehKey != null and precisehKey !=''">-->
|
|
|
-<!-- precisehKey = #{precisehKey},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="precisehKey != null and precisehKey !=''">-->
|
|
|
+ <!-- precisehKey = #{precisehKey},-->
|
|
|
+ <!-- </if>-->
|
|
|
<if test="visibility != null and visibility !=''">
|
|
|
visibility = #{visibility},
|
|
|
</if>
|
|
@@ -1736,31 +1732,31 @@
|
|
|
<update id="updateCmSku">
|
|
|
update cm_sku
|
|
|
set productId=#{productId},
|
|
|
- ladderPriceFlag=#{ladderPriceFlag},
|
|
|
- normalPrice=#{normalPrice},
|
|
|
- price=#{price},
|
|
|
- organizeId=#{organizeId},
|
|
|
- <if test="shopPercent != null">
|
|
|
- shopPercent=#{shopPercent},
|
|
|
- </if>
|
|
|
- <if test="organizePercent != null">
|
|
|
- organizePercent=#{organizePercent},
|
|
|
- </if>
|
|
|
- <if test="cmPercent != null">
|
|
|
- cmPercent=#{cmPercent},
|
|
|
- </if>
|
|
|
- <if test="costPrice != null">
|
|
|
- costPrice=#{costPrice},
|
|
|
- </if>
|
|
|
- <if test="organizeCostPrice != null">
|
|
|
- organizeCostPrice = #{organizeCostPrice},
|
|
|
- </if>
|
|
|
- <if test="cmCostPrice != null">
|
|
|
- cmCostPrice = #{cmCostPrice},
|
|
|
- </if>
|
|
|
- stock=#{stock},
|
|
|
- unit=#{unit},
|
|
|
- minBuyNumber=#{minBuyNumber}
|
|
|
+ ladderPriceFlag=#{ladderPriceFlag},
|
|
|
+ normalPrice=#{normalPrice},
|
|
|
+ price=#{price},
|
|
|
+ organizeId=#{organizeId},
|
|
|
+ <if test="shopPercent != null">
|
|
|
+ shopPercent=#{shopPercent},
|
|
|
+ </if>
|
|
|
+ <if test="organizePercent != null">
|
|
|
+ organizePercent=#{organizePercent},
|
|
|
+ </if>
|
|
|
+ <if test="cmPercent != null">
|
|
|
+ cmPercent=#{cmPercent},
|
|
|
+ </if>
|
|
|
+ <if test="costPrice != null">
|
|
|
+ costPrice=#{costPrice},
|
|
|
+ </if>
|
|
|
+ <if test="organizeCostPrice != null">
|
|
|
+ organizeCostPrice = #{organizeCostPrice},
|
|
|
+ </if>
|
|
|
+ <if test="cmCostPrice != null">
|
|
|
+ cmCostPrice = #{cmCostPrice},
|
|
|
+ </if>
|
|
|
+ stock=#{stock},
|
|
|
+ unit=#{unit},
|
|
|
+ minBuyNumber=#{minBuyNumber}
|
|
|
where skuId = #{skuId}
|
|
|
</update>
|
|
|
<update id="updateOrganizeSku">
|
|
@@ -2021,7 +2017,9 @@
|
|
|
unit,
|
|
|
normalPrice,
|
|
|
stock,
|
|
|
- (select costCheckFlag from cm_organize_product_info where productId = cs.productId and organizeId = cs.organizeId ) as costCheckFlag,
|
|
|
+ (select costCheckFlag
|
|
|
+ from cm_organize_product_info
|
|
|
+ where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
shopPercent,
|
|
|
costPrice,
|
|
|
price,
|
|
@@ -2035,10 +2033,13 @@
|
|
|
left join cm_promotion_sku cps on cs.skuId = cps.skuId
|
|
|
left join cm_svip_product_sku csps on cs.skuId = csps.skuId
|
|
|
where cs.productId = #{productID}
|
|
|
- and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=#{productID})
|
|
|
+ and cs.organizeId = (SELECT SUBSTRING(groundMall, 1, 1) FROM product WHERE productID = #{productID})
|
|
|
</select>
|
|
|
<select id="getCostCheckFlag" resultType="java.lang.Integer">
|
|
|
- select costCheckFlag from cm_organize_product_info where productId = #{productId} and organizeId = #{organizeId}
|
|
|
+ select costCheckFlag
|
|
|
+ from cm_organize_product_info
|
|
|
+ where productId = #{productId}
|
|
|
+ and organizeId = #{organizeId}
|
|
|
</select>
|
|
|
<select id="findSkuListProduct" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
select cs.skuId,
|
|
@@ -2047,7 +2048,9 @@
|
|
|
unit,
|
|
|
normalPrice,
|
|
|
stock,
|
|
|
- (select costCheckFlag from cm_organize_product_info where productId = cs.productId and organizeId = cs.organizeId ) as costCheckFlag,
|
|
|
+ (select costCheckFlag
|
|
|
+ from cm_organize_product_info
|
|
|
+ where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
shopPercent,
|
|
|
organizePercent,
|
|
|
cmPercent,
|
|
@@ -2062,7 +2065,9 @@
|
|
|
csps.priceType
|
|
|
from cm_sku cs
|
|
|
left join cm_svip_product_sku csps on cs.skuId = csps.skuId
|
|
|
- where cs.organizeId=0 and cs.productId = #{productID}
|
|
|
+ where cs.organizeId = 0
|
|
|
+ and cs.productId = #{productID}
|
|
|
+ order by cs.price asc
|
|
|
</select>
|
|
|
<select id="findSkuOrganizeList" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
select cs.skuId,
|
|
@@ -2071,8 +2076,10 @@
|
|
|
cs.unit,
|
|
|
cs.normalPrice,
|
|
|
cs.stock,
|
|
|
- (select costCheckFlag from cm_organize_product_info where productId = cs.productId and organizeId = cs.organizeId ) as costCheckFlag,
|
|
|
- cs.shopPercent as shopPercent,
|
|
|
+ (select costCheckFlag
|
|
|
+ from cm_organize_product_info
|
|
|
+ where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
+ cs.shopPercent as shopPercent,
|
|
|
cs.costPrice,
|
|
|
cs.organizeCostPrice,
|
|
|
cs.cmCostPrice,
|
|
@@ -2082,7 +2089,8 @@
|
|
|
cs.shopPercent,
|
|
|
cs.cmPercent
|
|
|
from cm_sku cs
|
|
|
- where cs.organizeId = 4 and cs.productId = #{productID}
|
|
|
+ where cs.organizeId = 4
|
|
|
+ and cs.productId = #{productID}
|
|
|
</select>
|
|
|
<select id="findLadderPriceBySku" resultType="com.caimei.modules.product.entity.CmLadderPrice">
|
|
|
select skuId, productId, userType, ladderNum, buyNum, buyPrice, delFlag
|
|
@@ -2113,7 +2121,8 @@
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
left join cm_sku cs on cs.productId=a.productID and copi.organizeId= cs.organizeId
|
|
|
- WHERE cs.skuId = #{skuId} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
|
|
|
+ WHERE cs.skuId = #{skuId} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE
|
|
|
+ productID=cs.productId)
|
|
|
</select>
|
|
|
<select id="findHeHeSku" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
select cs.skuId,
|
|
@@ -2121,16 +2130,18 @@
|
|
|
cs.organizeId,
|
|
|
cs.unit,
|
|
|
cs.stock,
|
|
|
- (select costCheckFlag from cm_organize_product_info where productId = cs.productId and organizeId = cs.organizeId ) as costCheckFlag,
|
|
|
+ (select costCheckFlag
|
|
|
+ from cm_organize_product_info
|
|
|
+ where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
cs.costPrice,
|
|
|
- ifnull(cs.shopPercent, 0) as shopPercent,
|
|
|
- ifnull(cs.organizePercent, 0) as organizePercent,
|
|
|
- ifnull(cs.cmPercent, 0) as cmPercent,
|
|
|
+ ifnull(cs.shopPercent, 0) as shopPercent,
|
|
|
+ ifnull(cs.organizePercent, 0) as organizePercent,
|
|
|
+ ifnull(cs.cmPercent, 0) as cmPercent,
|
|
|
chs.price
|
|
|
from cm_sku cs
|
|
|
left join cm_hehe_sku chs on cs.skuId = chs.skuId
|
|
|
where cs.productId = #{productID}
|
|
|
- and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
|
|
|
+ and cs.organizeId = (SELECT SUBSTRING(groundMall, 1, 1) FROM product WHERE productID = cs.productId)
|
|
|
</select>
|
|
|
<select id="findSkuId" resultType="java.lang.Integer">
|
|
|
select skuId
|
|
@@ -2139,26 +2150,30 @@
|
|
|
</select>
|
|
|
<select id="findSku" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
select cs.price,
|
|
|
- ifnull(cs.costPrice, 0) as costPrice,
|
|
|
- (select costCheckFlag from cm_organize_product_info where productId = cs.productId and organizeId = cs.organizeId ) as costCheckFlag,
|
|
|
+ ifnull(cs.costPrice, 0) as costPrice,
|
|
|
+ (select costCheckFlag
|
|
|
+ from cm_organize_product_info
|
|
|
+ where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
cs.shopPercent,
|
|
|
cs.normalPrice
|
|
|
from cm_sku cs
|
|
|
where cs.productId = #{productId}
|
|
|
- and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
|
|
|
+ and cs.organizeId = (SELECT SUBSTRING(groundMall, 1, 1) FROM product WHERE productID = cs.productId)
|
|
|
order by cs.price asc
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="findOrganizeSku" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
SELECT cs.price,
|
|
|
ifnull(cs.costPrice, 0),
|
|
|
- (select costCheckFlag from cm_organize_product_info where productId = cs.productId and organizeId = cs.organizeId ) as costCheckFlag,
|
|
|
- cs.shopPercent AS shopPercent,
|
|
|
+ (select costCheckFlag
|
|
|
+ from cm_organize_product_info
|
|
|
+ where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
+ cs.shopPercent AS shopPercent,
|
|
|
cs.normalPrice,
|
|
|
cs.organizeId
|
|
|
FROM cm_sku cs
|
|
|
WHERE cs.productId = #{productId}
|
|
|
- and cs.organizeId=4
|
|
|
+ and cs.organizeId = 4
|
|
|
ORDER BY cs.price ASC
|
|
|
LIMIT 1
|
|
|
</select>
|
|
@@ -2166,13 +2181,15 @@
|
|
|
select cs.skuId,
|
|
|
cs.price,
|
|
|
cs.costPrice,
|
|
|
- (select costCheckFlag from cm_organize_product_info where productId = cs.productId and organizeId = cs.organizeId ) as costCheckFlag,
|
|
|
+ (select costCheckFlag
|
|
|
+ from cm_organize_product_info
|
|
|
+ where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
cs.shopPercent,
|
|
|
cs.unit,
|
|
|
cs.organizeId
|
|
|
from cm_sku cs
|
|
|
where cs.skuId = #{skuId}
|
|
|
- and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
|
|
|
+ and cs.organizeId = (SELECT SUBSTRING(groundMall, 1, 1) FROM product WHERE productID = cs.productId)
|
|
|
</select>
|
|
|
<select id="findSkuIdByPromotionsId" resultType="java.lang.Integer">
|
|
|
select skuId
|
|
@@ -2185,19 +2202,21 @@
|
|
|
where skuId = #{skuId}
|
|
|
</select>
|
|
|
<select id="findSkuByPromotion" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
- SELECT cs.price, cps.skuId, cps.touchPrice
|
|
|
- , cs.unit
|
|
|
- , cs.organizeId
|
|
|
+ SELECT cs.price
|
|
|
+ , cps.skuId
|
|
|
+ , cps.touchPrice
|
|
|
+ , cs.unit
|
|
|
+ , cs.organizeId
|
|
|
FROM cm_promotion_sku cps
|
|
|
LEFT JOIN cm_sku cs ON cps.skuId = cs.skuId
|
|
|
WHERE promotionId = #{id}
|
|
|
- and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
|
|
|
+ and cs.organizeId = (SELECT SUBSTRING(groundMall, 1, 1) FROM product WHERE productID = cs.productId)
|
|
|
</select>
|
|
|
<select id="getSkuByPromotionId" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
SELECT cs.price, cpp.productId, cs.skuId, cs.unit
|
|
|
FROM cm_promotions_product cpp
|
|
|
LEFT JOIN cm_sku cs ON cpp.productId = cs.productId
|
|
|
WHERE promotionsId = #{id}
|
|
|
- and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
|
|
|
+ and cs.organizeId = (SELECT SUBSTRING(groundMall, 1, 1) FROM product WHERE productID = cs.productId)
|
|
|
</select>
|
|
|
</mapper>
|