|
@@ -5,9 +5,10 @@
|
|
|
update cm_baike_product set actualPv = actualPv + 1 where id = #{id}
|
|
|
</update>
|
|
|
<select id="getBaikeProductDetail" resultType="com.caimei.www.pojo.baike.BaikeProduct">
|
|
|
- select a.id AS "id",
|
|
|
+ select a.id AS "productId",
|
|
|
a.commodityType AS "commodityType",
|
|
|
a.name AS "name",
|
|
|
+ a.publishSource,
|
|
|
a.shopId AS "shopId",
|
|
|
s.name AS "shopName",
|
|
|
s.logo AS "shopLogo",
|
|
@@ -35,6 +36,7 @@
|
|
|
a.topPosition AS "topPosition",
|
|
|
a.status AS "status",
|
|
|
a.addTime AS "addTime",
|
|
|
+ a.recommendType,
|
|
|
cbt.name as "typeName"
|
|
|
from cm_baike_product a
|
|
|
left join cm_baike_type cbt on a.typeId = cbt.id
|
|
@@ -62,4 +64,28 @@
|
|
|
from cm_baike_product_file
|
|
|
where productId = #{productId}
|
|
|
</select>
|
|
|
+ <select id="getManualRecommendList" resultType="com.caimei.www.pojo.baike.BaikeProduct">
|
|
|
+ select p.id as productId, p.commodityType, p.image, p.name, p.discription, p.publishTime, (p.basePv + p.actualPv) as pv
|
|
|
+ from cm_baike_product_recommend cbpr
|
|
|
+ left join cm_baike_product p on cbpr.recommendProductId = p.id
|
|
|
+ where productId = #{productId}
|
|
|
+ and p.delFlag = 0
|
|
|
+ order by -cbpr.sort desc
|
|
|
+ </select>
|
|
|
+ <select id="getAutoRecommendList" resultType="com.caimei.www.pojo.baike.BaikeProduct">
|
|
|
+ select p.id as recommendProductId, p.name as recommendProductName
|
|
|
+ from cm_baike_product p
|
|
|
+ where typeId = #{typeId}
|
|
|
+ <if test="shopId != null">
|
|
|
+ and shopId = #{shopId}
|
|
|
+ </if>
|
|
|
+ <if test="productId != null">
|
|
|
+ and id != #{productId}
|
|
|
+ </if>
|
|
|
+ and p.delFlag = 0
|
|
|
+ and p.status = 1
|
|
|
+ and p.onlineStatus = 2
|
|
|
+ order by p.addTime desc
|
|
|
+ limit 15
|
|
|
+ </select>
|
|
|
</mapper>
|