|
@@ -15,7 +15,7 @@
|
|
|
a.bigTypeID AS "bigTypeID",
|
|
|
ifnull(a.smallTypeID,-1) AS "smallTypeID",
|
|
|
ifnull(a.tinyTypeID,-1) AS "tinyTypeID",
|
|
|
- a.selfTypeID AS "selfTypeID",
|
|
|
+-- a.selfTypeID AS "selfTypeID",
|
|
|
a.preferredFlag AS "preferredFlag",
|
|
|
a.shopID AS "shopID",
|
|
|
a.name AS "name",
|
|
@@ -30,28 +30,28 @@
|
|
|
a.addTime AS "addTime",
|
|
|
a.updateTime AS "updateTime",
|
|
|
a.sellNumber AS "sellNumber",
|
|
|
- a.weekSellNumber AS "weekSellNumber",
|
|
|
- a.beforeValidFlag AS "beforeValidFlag",
|
|
|
- a.validFlag AS "validFlag",
|
|
|
+-- a.weekSellNumber AS "weekSellNumber",
|
|
|
+-- a.beforeValidFlag AS "beforeValidFlag",
|
|
|
+ copi.validFlag AS "validFlag",
|
|
|
a.favoriteTimes AS "favoriteTimes",
|
|
|
a.commentScore AS "commentScore",
|
|
|
a.commentTimes AS "commentTimes",
|
|
|
- a.selfRecommendFlag AS "selfRecommendFlag",
|
|
|
- a.sysRecommendFlag AS "sysRecommendFlag",
|
|
|
+-- a.selfRecommendFlag AS "selfRecommendFlag",
|
|
|
+-- a.sysRecommendFlag AS "sysRecommendFlag",
|
|
|
a.sortIndex AS "sortIndex",
|
|
|
a.featuredFlag AS "featuredFlag",
|
|
|
a.featuredSortIndex AS "featuredSortIndex",
|
|
|
a.productCode AS "productCode",
|
|
|
- a.synToERPFlag AS "synToERPFlag",
|
|
|
+-- a.synToERPFlag AS "synToERPFlag",
|
|
|
a.allAreaFlag AS "allAreaFlag",
|
|
|
a.provinceIDs AS "provinceIDs",
|
|
|
a.serviceNumber AS "serviceNumber",
|
|
|
a.packageCount AS "packageCount",
|
|
|
a.byFlag AS "byFlag",
|
|
|
a.normalProductFlag AS "normalProductFlag",
|
|
|
- a.wholeSaleProductFlag AS "wholeSaleProductFlag",
|
|
|
- a.promotionProductFlag AS "promotionProductFlag",
|
|
|
- a.groupBuyProductFlag AS "groupBuyProductFlag",
|
|
|
+-- a.wholeSaleProductFlag AS "wholeSaleProductFlag",
|
|
|
+-- a.promotionProductFlag AS "promotionProductFlag",
|
|
|
+-- a.groupBuyProductFlag AS "groupBuyProductFlag",
|
|
|
a.step AS "step",
|
|
|
a.actStatus AS "actStatus",
|
|
|
a.actFlag AS "actFlag",
|
|
@@ -59,7 +59,7 @@
|
|
|
a.onlineTime AS "onlineTime",
|
|
|
a.downlineTime AS "downlineTime",
|
|
|
a.freePostFlag AS "freePostFlag",
|
|
|
- a.precisehKey AS "precisehKey",
|
|
|
+-- a.precisehKey AS "precisehKey",
|
|
|
s.name AS "shopName",
|
|
|
a.actSort AS "actSort",
|
|
|
a.recommendType AS "recommendType",
|
|
@@ -94,6 +94,7 @@
|
|
|
<sql id="productJoins">
|
|
|
LEFT JOIN shop s on s.shopID = a.shopID
|
|
|
left join product p on a.productID = p.productId
|
|
|
+ left join cm_organize_product_info copi on copi.productId = a.productID
|
|
|
</sql>
|
|
|
<sql id="ActivityJoins">
|
|
|
LEFT JOIN shop s on s.shopID = a.shopID
|
|
@@ -125,13 +126,14 @@
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
WHERE a.productID = #{id}
|
|
|
+ and a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<select id="getAllExistsProductList" resultType="Integer">
|
|
|
SELECT p.productID
|
|
|
FROM product p
|
|
|
- left join cm_organize_product_info copi on copi.productId = p.productID
|
|
|
+ left join cm_organize_product_info copi on copi.productId = p.productID
|
|
|
WHERE
|
|
|
and copi.organizeID = #{organizeID}
|
|
|
</select>
|
|
@@ -142,6 +144,7 @@
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
<where>
|
|
|
+ a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="productID !=null and productID !=''">
|
|
|
AND a.productID=#{productID}
|
|
|
</if>
|
|
@@ -164,7 +167,7 @@
|
|
|
<if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
|
|
|
</if>
|
|
|
<if test="validFlag !=null and validFlag !=''">
|
|
|
- AND a.validFlag=#{validFlag}
|
|
|
+ AND copi.validFlag=#{validFlag}
|
|
|
</if>
|
|
|
<if test="actFlag !=null and actFlag !=''">
|
|
|
AND a.actFlag=#{actFlag}
|
|
@@ -192,7 +195,7 @@
|
|
|
AND a.actType != 3
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
- AND a.validFlag != 0
|
|
|
+ AND copi.validFlag != 0
|
|
|
AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
|
|
|
and a.productCategory = 1
|
|
|
</where>
|
|
@@ -201,7 +204,7 @@
|
|
|
ORDER BY ${page.orderBy}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- order by case WHEN a.validFlag = 1 then 0 else 1 END asc,a.productID desc
|
|
|
+ order by case WHEN copi.validFlag = 1 then 0 else 1 END asc,a.productID desc
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
@@ -213,9 +216,13 @@
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
<where>
|
|
|
+ a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="productID !=null and productID !=''">
|
|
|
AND a.productID=#{productID}
|
|
|
</if>
|
|
|
+ <if test="groundMall !=null and groundMall !=''">
|
|
|
+ AND a.groundMall=concat('%',#{groundMall},'%')
|
|
|
+ </if>
|
|
|
<if test="name != null and name != ''">
|
|
|
AND a.name LIKE
|
|
|
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
@@ -228,9 +235,10 @@
|
|
|
<if test="dbName == 'mssql'">'%'+#{shopName}+'%'</if>
|
|
|
<if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
|
|
|
</if>
|
|
|
- AND a.validFlag in (2,3,9)
|
|
|
+ AND copi.validFlag in (2,3,9)
|
|
|
and a.productCategory = 1
|
|
|
</where>
|
|
|
+ group by a.productID
|
|
|
<choose>
|
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
ORDER BY ${page.orderBy}
|
|
@@ -247,6 +255,7 @@
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
<where>
|
|
|
+ a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="id !=null and id !=''">
|
|
|
AND a.productID=#{id}
|
|
|
</if>
|
|
@@ -280,7 +289,7 @@
|
|
|
<if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
|
|
|
</if>
|
|
|
<if test="validFlag !=null and validFlag !=''">
|
|
|
- AND a.validFlag=#{validFlag}
|
|
|
+ AND copi.validFlag=#{validFlag}
|
|
|
</if>
|
|
|
<if test="actFlag !=null and actFlag !=''">
|
|
|
AND a.actFlag=#{actFlag}
|
|
@@ -303,16 +312,17 @@
|
|
|
<if test="sqlMap !=null and sqlMap !=''">
|
|
|
${sqlMap.dsf}
|
|
|
</if>
|
|
|
- AND a.validFlag != 0
|
|
|
+ AND copi.validFlag != 0
|
|
|
AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
|
|
|
and a.productCategory = 1
|
|
|
</where>
|
|
|
+ group by a.productID
|
|
|
<choose>
|
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
ORDER BY ${page.orderBy}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- order by case WHEN a.validFlag = 1 then 0 else 1 END asc,a.productID desc
|
|
|
+ order by case WHEN copi.validFlag = 1 then 0 else 1 END asc,a.productID desc
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
@@ -324,7 +334,9 @@
|
|
|
<include refid="productJoins"/>
|
|
|
<where>
|
|
|
a.productCategory = 1
|
|
|
+ and a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
</where>
|
|
|
+ group by a.productID
|
|
|
<choose>
|
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
ORDER BY ${page.orderBy}
|
|
@@ -341,7 +353,7 @@
|
|
|
bigTypeID,
|
|
|
smallTypeID,
|
|
|
tinyTypeID,
|
|
|
- selfTypeID,
|
|
|
+-- selfTypeID,
|
|
|
shopID,
|
|
|
aliasName,
|
|
|
name,
|
|
@@ -353,28 +365,28 @@
|
|
|
propertiesInfo,
|
|
|
addTime,
|
|
|
updateTime,
|
|
|
- weekSellNumber,
|
|
|
- beforeValidFlag,
|
|
|
+-- 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,
|
|
@@ -382,7 +394,7 @@
|
|
|
onlineTime,
|
|
|
downlineTime,
|
|
|
freePostFlag,
|
|
|
- precisehKey,
|
|
|
+-- precisehKey,
|
|
|
visibility,
|
|
|
commodityDetailsFlag,
|
|
|
productType,
|
|
@@ -421,7 +433,7 @@
|
|
|
#{bigTypeID},
|
|
|
#{smallTypeID},
|
|
|
#{tinyTypeID},
|
|
|
- #{selfTypeID},
|
|
|
+-- #{selfTypeID},
|
|
|
#{shopID},
|
|
|
#{aliasName},
|
|
|
#{name},
|
|
@@ -433,28 +445,28 @@
|
|
|
#{propertiesInfo},
|
|
|
#{addTime},
|
|
|
#{updateTime},
|
|
|
- #{weekSellNumber},
|
|
|
- #{beforeValidFlag},
|
|
|
+-- #{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},
|
|
@@ -462,7 +474,7 @@
|
|
|
#{onlineTime},
|
|
|
#{downlineTime},
|
|
|
#{freePostFlag},
|
|
|
- #{precisehKey},
|
|
|
+-- #{precisehKey},
|
|
|
#{visibility},
|
|
|
#{commodityDetailsFlag},
|
|
|
#{productType},
|
|
@@ -503,7 +515,7 @@
|
|
|
SET productID = #{id},
|
|
|
brandID = #{brandID},
|
|
|
tinyTypeID = #{tinyTypeID},
|
|
|
- selfTypeID = #{selfTypeID},
|
|
|
+-- selfTypeID = #{selfTypeID},
|
|
|
shopID = #{shopID},
|
|
|
name = #{name},
|
|
|
searchKey = #{searchKey},
|
|
@@ -515,35 +527,35 @@
|
|
|
addTime = #{addTime},
|
|
|
updateTime = #{updateTime},
|
|
|
sellNumber = #{sellNumber},
|
|
|
- weekSellNumber = #{weekSellNumber},
|
|
|
- beforeValidFlag = #{beforeValidFlag},
|
|
|
+-- weekSellNumber = #{weekSellNumber},
|
|
|
+-- beforeValidFlag = #{beforeValidFlag},
|
|
|
validFlag = #{validFlag},
|
|
|
favoriteTimes = #{favoriteTimes},
|
|
|
commentScore = #{commentScore},
|
|
|
commentTimes = #{commentTimes},
|
|
|
- selfRecommendFlag = #{selfRecommendFlag},
|
|
|
- sysRecommendFlag = #{sysRecommendFlag},
|
|
|
+-- selfRecommendFlag = #{selfRecommendFlag},
|
|
|
+-- sysRecommendFlag = #{sysRecommendFlag},
|
|
|
sortIndex = #{sortIndex},
|
|
|
featuredFlag = #{featuredFlag},
|
|
|
featuredSortIndex = #{featuredSortIndex},
|
|
|
productCode = #{productCode},
|
|
|
- synToERPFlag = #{synToERPFlag},
|
|
|
+-- synToERPFlag = #{synToERPFlag},
|
|
|
allAreaFlag = #{allAreaFlag},
|
|
|
provinceIDs = #{provinceIDs},
|
|
|
serviceNumber = #{serviceNumber},
|
|
|
packageCount = #{packageCount},
|
|
|
byFlag = #{byFlag},
|
|
|
normalProductFlag = #{normalProductFlag},
|
|
|
- wholeSaleProductFlag = #{wholeSaleProductFlag},
|
|
|
- promotionProductFlag = #{promotionProductFlag},
|
|
|
- groupBuyProductFlag = #{groupBuyProductFlag},
|
|
|
+-- wholeSaleProductFlag = #{wholeSaleProductFlag},
|
|
|
+-- promotionProductFlag = #{promotionProductFlag},
|
|
|
+-- groupBuyProductFlag = #{groupBuyProductFlag},
|
|
|
step = #{step},
|
|
|
actFlag = #{actFlag},
|
|
|
actType = #{actType},
|
|
|
onlineTime = #{onlineTime},
|
|
|
downlineTime = #{downlineTime},
|
|
|
freePostFlag = #{freePostFlag},
|
|
|
- precisehKey = #{precisehKey},
|
|
|
+-- precisehKey = #{precisehKey},
|
|
|
actSort = #{actSort},
|
|
|
newProductType=#{newProductType}
|
|
|
|
|
@@ -565,8 +577,8 @@
|
|
|
<include refid="productColumns"/>
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
- left join cm_organize_product_info copi on copi.productId = p.productID and copi.organizeId = 0
|
|
|
<where>
|
|
|
+ a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="productID !=null">
|
|
|
AND a.productID=#{productID}
|
|
|
</if>
|
|
@@ -874,7 +886,7 @@
|
|
|
`productCategory`,
|
|
|
</if>
|
|
|
`preferredFlag`,
|
|
|
- `selfTypeID`,
|
|
|
+-- `selfTypeID`,
|
|
|
`shopID`,
|
|
|
`name`,
|
|
|
`aliasName`,
|
|
@@ -887,28 +899,28 @@
|
|
|
`propertiesInfo`,
|
|
|
`addTime`,
|
|
|
`updateTime`,
|
|
|
- `weekSellNumber`,
|
|
|
- `beforeValidFlag`,
|
|
|
+-- `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`,
|
|
@@ -918,7 +930,7 @@
|
|
|
`onlineTime`,
|
|
|
`downlineTime`,
|
|
|
`freePostFlag`,
|
|
|
- `precisehKey`,
|
|
|
+-- `precisehKey`,
|
|
|
`tags`,
|
|
|
`productType`,
|
|
|
`machineType`,
|
|
@@ -939,7 +951,7 @@
|
|
|
#{productCategory},
|
|
|
</if>
|
|
|
#{preferredFlag},
|
|
|
- #{selfTypeID},
|
|
|
+-- #{selfTypeID},
|
|
|
#{shopID},
|
|
|
#{name},
|
|
|
#{aliasName},
|
|
@@ -952,28 +964,28 @@
|
|
|
#{propertiesInfo},
|
|
|
#{addTime},
|
|
|
#{updateTime},
|
|
|
- #{weekSellNumber},
|
|
|
- #{beforeValidFlag},
|
|
|
+-- #{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},
|
|
@@ -983,7 +995,7 @@
|
|
|
#{onlineTime},
|
|
|
#{downlineTime},
|
|
|
#{freePostFlag},
|
|
|
- #{precisehKey},
|
|
|
+-- #{precisehKey},
|
|
|
#{tags},
|
|
|
#{productType},
|
|
|
#{machineType},
|
|
@@ -1042,6 +1054,7 @@
|
|
|
shopPercent,
|
|
|
organizePercent,
|
|
|
cmPercent,
|
|
|
+ organizeId,
|
|
|
minBuyNumber,
|
|
|
unit)
|
|
|
values (#{productId},
|
|
@@ -1054,6 +1067,7 @@
|
|
|
#{shopPercent},
|
|
|
#{organizePercent},
|
|
|
#{cmPercent},
|
|
|
+ #{organizeId},
|
|
|
#{minBuyNumber},
|
|
|
#{unit})
|
|
|
</insert>
|
|
@@ -1099,15 +1113,17 @@
|
|
|
FROM
|
|
|
cm_search_recommend_product csrp
|
|
|
LEFT JOIN product a on a.productID = csrp.productID
|
|
|
+ left join cm_organize_product_info copi on copi.productId = a.productID
|
|
|
LEFT JOIN shop s on s.shopID = a.shopID
|
|
|
left join cm_brand b on b.id = a.brandID
|
|
|
WHERE
|
|
|
csrp.tinyTypeId = #{tinyTypeID}
|
|
|
+ and a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="name != null and name != ''">
|
|
|
AND a.name like concat('%', #{name} ,'%')
|
|
|
</if>
|
|
|
<if test="validFlag !=null and validFlag !=''">
|
|
|
- AND a.validFlag=#{validFlag}
|
|
|
+ AND copi.validFlag=#{validFlag}
|
|
|
</if>
|
|
|
<if test="shopName != null and shopName != ''">
|
|
|
AND s.name like concat('%', #{shopName} ,'%')
|
|
@@ -1116,7 +1132,7 @@
|
|
|
AND b.name like concat('%', #{brandName} ,'%')
|
|
|
</if>
|
|
|
and a.productCategory = 1
|
|
|
- AND a.validFlag != 0
|
|
|
+ AND copi.validFlag != 0
|
|
|
AND csrp.delFlag =0
|
|
|
ORDER BY csrp.sort DESC
|
|
|
</select>
|
|
@@ -1178,12 +1194,13 @@
|
|
|
b.name AS brandName,
|
|
|
s.name AS shopName
|
|
|
FROM product a
|
|
|
+ left join cm_organize_product_info copi on copi.productId = a.productID
|
|
|
LEFT JOIN shop s on s.shopID = a.shopID
|
|
|
left join cm_brand b on b.id = a.brandID
|
|
|
WHERE
|
|
|
NOT EXISTS (select * from cm_search_recommend_product csrp where csrp.productID = a.productID and
|
|
|
csrp.tinyTypeID = #{tinyTypeID} AND csrp.delFlag = 0)
|
|
|
- and a.validFlag = '2'
|
|
|
+ and copi.validFlag = '2' and p.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="name != null and name != ''">
|
|
|
and a.name like concat('%', #{name} ,'%')
|
|
|
</if>
|
|
@@ -1200,8 +1217,10 @@
|
|
|
SELECT
|
|
|
<include refid="productColumns"/>
|
|
|
FROM product a
|
|
|
+ left join cm_organize_product_info copi on copi.productId = a.productID
|
|
|
<include refid="ActivityJoins"/>
|
|
|
<where>
|
|
|
+ a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="id !=null and id !=''">
|
|
|
AND a.productID=#{id}
|
|
|
</if>
|
|
@@ -1242,7 +1261,7 @@
|
|
|
<if test="sqlMap !=null and sqlMap !=''">
|
|
|
${sqlMap.dsf}
|
|
|
</if>
|
|
|
- AND a.validFlag = 2
|
|
|
+ AND copi.validFlag = 2
|
|
|
AND ((a.actType != 1 AND a.actType != 2 OR a.`actType` IS NULL) or a.actFlag = 0)
|
|
|
AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
|
|
|
and a.productCategory = 1
|
|
@@ -1252,7 +1271,7 @@
|
|
|
ORDER BY ${page.orderBy}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- order by case WHEN a.validFlag = 1 then 0 else 1 END asc,a.productID desc
|
|
|
+ order by case WHEN copi.validFlag = 1 then 0 else 1 END asc,a.productID desc
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
@@ -1456,15 +1475,15 @@
|
|
|
<if test="updateTime != null and updateTime !=''">
|
|
|
updateTime = #{updateTime},
|
|
|
</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="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="favoriteTimes != null and favoriteTimes !=''">
|
|
|
favoriteTimes = #{favoriteTimes},
|
|
|
</if>
|
|
@@ -1474,12 +1493,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>
|
|
@@ -1492,9 +1511,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>
|
|
@@ -1513,15 +1532,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>
|
|
@@ -1543,9 +1562,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>
|
|
@@ -1682,6 +1701,7 @@
|
|
|
ladderPriceFlag=#{ladderPriceFlag},
|
|
|
normalPrice=#{normalPrice},
|
|
|
price=#{price},
|
|
|
+ organizeId=#{organizeId},
|
|
|
shopPercent=#{shopPercent},
|
|
|
organizePercent=#{organizePercent},
|
|
|
cmPercent=#{cmPercent},
|
|
@@ -1745,9 +1765,9 @@
|
|
|
p.productCategory as "productCategory"
|
|
|
from product p
|
|
|
left join shop s on s.shopID = p.shopID
|
|
|
- left join cm_organize_product_info copi on copi.productId = p.productID and copi.organizeId = 0
|
|
|
+ left join cm_organize_product_info copi on copi.productId = p.productID
|
|
|
where p.productID = #{productID}
|
|
|
- AND copi.validFlag = '2'
|
|
|
+ AND copi.validFlag = '2' and p.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
</select>
|
|
|
|
|
|
<select id="querySecondHandRecommend" resultType="CmSecondHandRecommendVo">
|
|
@@ -1759,9 +1779,10 @@
|
|
|
s.name AS shopName,
|
|
|
p.productCategory as "productCategory"
|
|
|
from product p
|
|
|
- left join cm_organize_product_info copi on copi.productId = p.productID and copi.organizeId = 0
|
|
|
+ left join cm_organize_product_info copi on copi.productId = p.productID
|
|
|
left join shop s on s.shopID = p.shopID
|
|
|
<where>
|
|
|
+ p.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="productID != null and productID != ''">
|
|
|
p.productID = #{productID}
|
|
|
</if>
|
|
@@ -1810,6 +1831,7 @@
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
<where>
|
|
|
+ a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="id !=null and id !=''">
|
|
|
AND a.productID=#{id}
|
|
|
</if>
|
|
@@ -1829,7 +1851,7 @@
|
|
|
<if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
|
|
|
</if>
|
|
|
<if test="validFlag !=null and validFlag !=''">
|
|
|
- AND a.validFlag=#{validFlag}
|
|
|
+ AND copi.validFlag=#{validFlag}
|
|
|
</if>
|
|
|
<if test="actFlag !=null and actFlag !=''">
|
|
|
AND a.actFlag=#{actFlag}
|
|
@@ -1845,7 +1867,7 @@
|
|
|
ORDER BY ${page.orderBy}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- order by case WHEN a.validFlag = 1 then 0 else 1 END asc,a.productID desc
|
|
|
+ order by case WHEN copi.validFlag = 1 then 0 else 1 END asc,a.productID desc
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
@@ -1853,10 +1875,10 @@
|
|
|
<select id="findAllProduct" resultType="com.caimei.modules.product.entity.Product">
|
|
|
select p.productID,p.mainImage,p.name,s.name as shopName
|
|
|
from product p
|
|
|
- left join cm_organize_product_info copi on copi.productId = p.productID and copi.organizeId = 0
|
|
|
+ left join cm_organize_product_info copi on copi.productId = p.productID
|
|
|
left join shop s on p.shopID = s.shopID
|
|
|
<where>
|
|
|
- (p.actFlag=0 or p.actType is null) and copi.validFlag = 2 and p.productCategory = 1
|
|
|
+ (p.actFlag=0 or p.actType is null) and copi.validFlag = 2 and p.productCategory = 1 and p.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="productIds != null and productIds != '' ">
|
|
|
and p.productID != #{productIds}
|
|
|
</if>
|
|
@@ -1879,6 +1901,7 @@
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
<where>
|
|
|
+ a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
<if test="productID !=null">
|
|
|
AND a.productID=#{productID}
|
|
|
</if>
|
|
@@ -1892,7 +1915,7 @@
|
|
|
AND s.name LIKE concat('%',#{shopName},'%')
|
|
|
</if>
|
|
|
<if test="validFlag !=null and validFlag !=''">
|
|
|
- AND a.validFlag=#{validFlag}
|
|
|
+ AND copi.validFlag=#{validFlag}
|
|
|
</if>
|
|
|
<if test="productCategory !=null and productCategory !=''">
|
|
|
AND a.productCategory=#{productCategory}
|
|
@@ -1941,6 +1964,7 @@
|
|
|
<select id="findSkuList" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
select cs.skuId,
|
|
|
cs.productId,
|
|
|
+ cs.organizeId,
|
|
|
unit,
|
|
|
normalPrice,
|
|
|
stock,
|
|
@@ -1962,6 +1986,7 @@
|
|
|
<select id="findSkuListProduct" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
select cs.skuId,
|
|
|
cs.productId,
|
|
|
+ cs.organizeId,
|
|
|
unit,
|
|
|
normalPrice,
|
|
|
stock,
|
|
@@ -1978,12 +2003,12 @@
|
|
|
csps.priceType
|
|
|
from cm_sku cs
|
|
|
left join cm_svip_product_sku csps on cs.skuId = csps.skuId
|
|
|
- where cs.productId = #{productID}
|
|
|
+ where cs.organizeId=0 and cs.productId = #{productID}
|
|
|
</select>
|
|
|
<select id="findSkuOrganizeList" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
select skuId,
|
|
|
productId,
|
|
|
- mallProductId,
|
|
|
+ organizeId,
|
|
|
unit,
|
|
|
normalPrice,
|
|
|
stock,
|
|
@@ -1996,7 +2021,7 @@
|
|
|
shopPercent,
|
|
|
cmPercent
|
|
|
from cm_sku
|
|
|
- where productId = #{productID}
|
|
|
+ where organizeId=4 and productId = #{productID}
|
|
|
</select>
|
|
|
<select id="findLadderPriceBySku" resultType="com.caimei.modules.product.entity.CmLadderPrice">
|
|
|
select skuId, productId, userType, ladderNum, buyNum, buyPrice, delFlag
|
|
@@ -2023,14 +2048,16 @@
|
|
|
<include refid="productColumns"/>
|
|
|
,cs.unit
|
|
|
,cs.skuId
|
|
|
+ ,cs.organizeId
|
|
|
FROM product a
|
|
|
<include refid="productJoins"/>
|
|
|
- left join cm_sku cs on cs.productId=a.productID
|
|
|
- WHERE cs.skuId = #{skuId}
|
|
|
+ left join cm_sku cs on cs.productId=a.productID and copi.organizeId= cs.organizeId
|
|
|
+ WHERE cs.skuId = #{skuId} and a.groundMall like CONCAT('%', copi.organizeId, '%')
|
|
|
</select>
|
|
|
<select id="findHeHeSku" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
select cs.skuId,
|
|
|
cs.productId,
|
|
|
+ cs.organizeId,
|
|
|
cs.unit,
|
|
|
cs.stock,
|
|
|
cs.costCheckFlag,
|
|
@@ -2054,14 +2081,18 @@
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="findOrganizeSku" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
- SELECT price, ifnull(costPrice, 0),"1" AS costCheckFlag, shopPercent AS shopPercent, normalPrice
|
|
|
+ SELECT price, ifnull(costPrice, 0),"1" AS costCheckFlag, shopPercent AS shopPercent
|
|
|
+ , normalPrice
|
|
|
+ , organizeId
|
|
|
FROM cm_sku
|
|
|
WHERE productId = #{productId}
|
|
|
ORDER BY price ASC
|
|
|
LIMIT 1
|
|
|
</select>
|
|
|
<select id="findSkuById" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
- select skuId, price, costPrice, costCheckFlag, shopPercent, unit
|
|
|
+ select skuId, price, costPrice, costCheckFlag, shopPercent
|
|
|
+ , unit
|
|
|
+ , organizeId
|
|
|
from cm_sku
|
|
|
where skuId = #{skuId}
|
|
|
</select>
|
|
@@ -2076,7 +2107,9 @@
|
|
|
where skuId = #{skuId}
|
|
|
</select>
|
|
|
<select id="findSkuByPromotion" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
- SELECT cs.price, cps.skuId, cps.touchPrice, cs.unit
|
|
|
+ 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}
|