|
@@ -164,12 +164,40 @@
|
|
a.qualificationLink,
|
|
a.qualificationLink,
|
|
a.labelIds
|
|
a.labelIds
|
|
</sql>
|
|
</sql>
|
|
|
|
+ <sql id="cmSvipProductColumns">
|
|
|
|
+ a.id AS "id",
|
|
|
|
+ a.productId AS "productId",
|
|
|
|
+ ccs.priceType AS "priceType",
|
|
|
|
+ ccs.discount AS "discount",
|
|
|
|
+ ccs.discountPrice AS "discountPrice",
|
|
|
|
+ a.sort AS "sort",
|
|
|
|
+ a.addTime AS "addTime",
|
|
|
|
+ a.status as "status",
|
|
|
|
+ p.mainImage as "productImage",
|
|
|
|
+ p.name as "productName",
|
|
|
|
+ s.name as "shopName",
|
|
|
|
+ p.includedTax,
|
|
|
|
+ p.invoiceType,
|
|
|
|
+ p.taxPoint,
|
|
|
|
+ p.supplierTaxPoint
|
|
|
|
+ </sql>
|
|
<sql id="newCmShopJoins">
|
|
<sql id="newCmShopJoins">
|
|
LEFT JOIN user u ON u.userID = a.userID
|
|
LEFT JOIN user u ON u.userID = a.userID
|
|
LEFT JOIN town b ON b.townID=a.townID
|
|
LEFT JOIN town b ON b.townID=a.townID
|
|
LEFT JOIN city c ON c.cityID=b.cityID
|
|
LEFT JOIN city c ON c.cityID=b.cityID
|
|
LEFT JOIN province d ON d.provinceID=c.provinceID
|
|
LEFT JOIN province d ON d.provinceID=c.provinceID
|
|
</sql>
|
|
</sql>
|
|
|
|
+ <sql id="cmSvipProductJoins">
|
|
|
|
+ left join product p on a.productId = p.productID
|
|
|
|
+ left join shop s on s.shopID = p.shopID
|
|
|
|
+ LEFT JOIN (SELECT csps.priceType,csps.discount,csps.discountPrice,csps.productId
|
|
|
|
+ FROM cm_svip_product_sku csps
|
|
|
|
+ LEFT JOIN cm_sku cs ON csps.skuId=cs.skuId
|
|
|
|
+ WHERE csps.productId = (SELECT productId FROM cm_svip_product WHERE id= #{id} )
|
|
|
|
+ ORDER BY cs.price ASC
|
|
|
|
+ LIMIT 1
|
|
|
|
+ ) ccs ON a.productId = ccs.productId
|
|
|
|
+ </sql>
|
|
|
|
|
|
<select id="superFind" resultType="com.caimei365.manager.entity.caimei.svip.CmSvipHistory">
|
|
<select id="superFind" resultType="com.caimei365.manager.entity.caimei.svip.CmSvipHistory">
|
|
SELECT u.name as clubName, u.username as linkMan, u.bindMobile as mobile,
|
|
SELECT u.name as clubName, u.username as linkMan, u.bindMobile as mobile,
|
|
@@ -636,6 +664,88 @@
|
|
</where>
|
|
</where>
|
|
order by -sort desc,addTime desc
|
|
order by -sort desc,addTime desc
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="findSkuList" resultType="com.caimei365.manager.entity.caimei.svip.CmSku">
|
|
|
|
+ select cs.skuId,
|
|
|
|
+ cs.productId,
|
|
|
|
+ unit,
|
|
|
|
+ normalPrice,
|
|
|
|
+ stock,
|
|
|
|
+ costCheckFlag,
|
|
|
|
+ costProportional,
|
|
|
|
+ costPrice,
|
|
|
|
+ price,
|
|
|
|
+ ladderPriceFlag,
|
|
|
|
+ minBuyNumber,
|
|
|
|
+ cps.touchPrice,
|
|
|
|
+ csps.discount,
|
|
|
|
+ csps.discountPrice,
|
|
|
|
+ csps.priceType
|
|
|
|
+ from cm_sku cs
|
|
|
|
+ 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}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="findLadderPriceBySku" resultType="com.caimei365.manager.entity.caimei.svip.CmLadderPrice">
|
|
|
|
+ select skuId, productId, userType, ladderNum, buyNum, buyPrice, delFlag
|
|
|
|
+ FROM product_ladder_price
|
|
|
|
+ WHERE userType = 3
|
|
|
|
+ AND skuId = #{skuId}
|
|
|
|
+ AND buyNum is NOT null
|
|
|
|
+ AND buyPrice is NOT null
|
|
|
|
+ AND delFlag = 0
|
|
|
|
+ ORDER BY buyNum ASC
|
|
|
|
+ </select>
|
|
|
|
+ <select id="getSvipSku" resultType="com.caimei365.manager.entity.caimei.svip.CmSku">
|
|
|
|
+ SELECT skuId,
|
|
|
|
+ priceType,
|
|
|
|
+ discount,
|
|
|
|
+ discountPrice
|
|
|
|
+ FROM cm_svip_product_sku
|
|
|
|
+ where skuId = #{skuId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getCmSvipProduct" resultType="com.caimei365.manager.entity.caimei.svip.CmSvipProduct">
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="cmSvipProductColumns"/>
|
|
|
|
+ FROM cm_svip_product a
|
|
|
|
+ <include refid="cmSvipProductJoins"/>
|
|
|
|
+ WHERE a.id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+ <delete id="deleteByProductId">
|
|
|
|
+ delete
|
|
|
|
+ from cm_svip_product_sku
|
|
|
|
+ where productId = #{productId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <insert id="insertSkuPrice">
|
|
|
|
+ insert into cm_svip_product_sku(skuId, productId, priceType, discount, discountPrice)
|
|
|
|
+ values (#{skuId}, #{productId}, #{priceType}, #{discount}, #{discountPrice})
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="insertCmSvipProduct" parameterType="com.caimei365.manager.entity.caimei.svip.CmSvipProduct" keyProperty="id" useGeneratedKeys="true">
|
|
|
|
+ INSERT INTO cm_svip_product(productId,
|
|
|
|
+ sort,
|
|
|
|
+ addTime,
|
|
|
|
+ status)
|
|
|
|
+ VALUES (#{productId},
|
|
|
|
+ #{sort},
|
|
|
|
+ now(),
|
|
|
|
+ #{status})
|
|
|
|
+ </insert>
|
|
|
|
+ <update id="updateCmSvipProduct">
|
|
|
|
+ UPDATE cm_svip_product
|
|
|
|
+ SET sort = #{sort},
|
|
|
|
+ status = #{status}
|
|
|
|
+ WHERE id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <select id="getAdsImage" resultType="com.caimei365.manager.entity.caimei.svip.CmSvipProductAdsImage">
|
|
|
|
+ select id, pcImage, appletsImage
|
|
|
|
+ from cm_svip_product_adsimage
|
|
|
|
+ limit 1
|
|
|
|
+ </select>
|
|
|
|
+ <select id="getAllUseDateList" resultType="java.lang.String">
|
|
|
|
+ SELECT DISTINCT useTime FROM cm_svip_coupon_month WHERE delFlag='0'
|
|
|
|
+ </select>
|
|
|
|
|
|
<select id="findSku" resultType="com.caimei365.manager.entity.caimei.svip.CmSku">
|
|
<select id="findSku" resultType="com.caimei365.manager.entity.caimei.svip.CmSku">
|
|
select price, costPrice, costCheckFlag, costProportional, normalPrice
|
|
select price, costPrice, costCheckFlag, costProportional, normalPrice
|