|
@@ -14,64 +14,6 @@
|
|
|
- sort DESC
|
|
|
</select>
|
|
|
|
|
|
- <select id="findProductList" resultType="com.caimei.model.vo.ProductVo">
|
|
|
- SELECT
|
|
|
- a.productId,
|
|
|
- a.price,
|
|
|
- a.includedTax,
|
|
|
- a.invoiceType,
|
|
|
- a.clubTaxPoint,
|
|
|
- p.name,
|
|
|
- P.unit,
|
|
|
- p.mainImage
|
|
|
- FROM
|
|
|
- cm_hehe_product a
|
|
|
- LEFT JOIN product p ON a.productId = p.productID
|
|
|
- WHERE
|
|
|
- a.validFlag = 1
|
|
|
- <if test="productName != null and productName != ''">
|
|
|
- AND p.name LIKE CONCAT('%',#{productName},'%')
|
|
|
- </if>
|
|
|
- ORDER BY
|
|
|
- a.addTime desc
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findFloorProductList" resultType="com.caimei.model.vo.ProductVo">
|
|
|
- SELECT
|
|
|
- a.productId,
|
|
|
- fp.recommend,
|
|
|
- a.price,
|
|
|
- a.includedTax,
|
|
|
- a.invoiceType,
|
|
|
- a.clubTaxPoint,
|
|
|
- p.name,
|
|
|
- P.unit,
|
|
|
- p.mainImage
|
|
|
- FROM
|
|
|
- cm_hehe_product a
|
|
|
- left join cm_hehe_floor_product fp on a.id = fp.productId
|
|
|
- LEFT JOIN product p ON a.productId = p.productID
|
|
|
- left join cm_hehe_floor f on fp.floorId = f.id
|
|
|
- WHERE
|
|
|
- a.validFlag = 1
|
|
|
- and f.status = 1
|
|
|
- and fp.validFlag = 1
|
|
|
- <if test="floorId != null">
|
|
|
- AND fp.floorId = #{floorId}
|
|
|
- </if>
|
|
|
- <if test="productName != null and productName != ''">
|
|
|
- AND p.name LIKE CONCAT('%',#{productName},'%')
|
|
|
- </if>
|
|
|
- ORDER BY
|
|
|
- fp.recommend DESC,
|
|
|
- - fp.sort DESC,
|
|
|
- fp.addTime DESC,
|
|
|
- fp.productId desc
|
|
|
- <if test="limitNum != null">
|
|
|
- limit #{limitNum}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
|
|
|
<select id="getActivityIdByProductId" resultType="integer">
|
|
|
SELECT
|
|
@@ -126,183 +68,6 @@
|
|
|
a.productId = #{productId}
|
|
|
</select>
|
|
|
|
|
|
- <select id="findProductImages" resultType="string">
|
|
|
- SELECT
|
|
|
- image
|
|
|
- FROM
|
|
|
- productimage
|
|
|
- WHERE
|
|
|
- productID = #{productId}
|
|
|
- ORDER BY
|
|
|
- mainFlag DESC
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findProductDetail" resultType="com.caimei.model.po.ProductDetailInfoPo">
|
|
|
- select
|
|
|
- productDetailInfoID as productDetailInfoId,
|
|
|
- productID as productId,
|
|
|
- propValueAlias,
|
|
|
- propValueImages,
|
|
|
- detailInfo,
|
|
|
- detailInfoTxt,
|
|
|
- seoTitle,
|
|
|
- seoKeyword,
|
|
|
- seoDes,
|
|
|
- serviceInfo,
|
|
|
- orderInfo
|
|
|
- from
|
|
|
- productdetailinfo
|
|
|
- where
|
|
|
- productID = #{productId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findTypeName" resultType="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>
|
|
|
-
|
|
|
- <select id="findBrandName" resultType="string">
|
|
|
- SELECT
|
|
|
- name
|
|
|
- FROM
|
|
|
- cm_brand
|
|
|
- WHERE
|
|
|
- id = #{brandId}
|
|
|
- and delFlag = '0'
|
|
|
- and status = '1'
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findParameters" resultType="com.caimei.model.vo.RelatedParametersVo">
|
|
|
- SELECT
|
|
|
- paramsName,
|
|
|
- paramsContent
|
|
|
- FROM
|
|
|
- cm_product_related_parameters
|
|
|
- WHERE
|
|
|
- productId = #{productId}
|
|
|
- AND delFlag = '0'
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findSearchHistory" resultType="integer">
|
|
|
- SELECT id FROM user_search_history WHERE searchWord = #{name} AND userId = #{userId} LIMIT 1
|
|
|
- </select>
|
|
|
-
|
|
|
- <update id="updateHistoryByDate">
|
|
|
- UPDATE user_search_history SET searchDate = NOW() WHERE id = #{recordId}
|
|
|
- </update>
|
|
|
-
|
|
|
- <insert id="insertSearchHistory">
|
|
|
- INSERT INTO `user_search_history` (
|
|
|
- `userId`, `searchWord`, `searchDate`,
|
|
|
- `delFlag`
|
|
|
- )
|
|
|
- VALUES
|
|
|
- (
|
|
|
- #{userId}, #{searchWord}, #{searchDate},
|
|
|
- #{delFlag}
|
|
|
- )
|
|
|
- </insert>
|
|
|
-
|
|
|
- <select id="searchHistory" resultType="string">
|
|
|
- SELECT
|
|
|
- searchWord
|
|
|
- FROM
|
|
|
- user_search_history
|
|
|
- WHERE
|
|
|
- userId = #{userId}
|
|
|
- ORDER BY
|
|
|
- searchDate DESC
|
|
|
- LIMIT
|
|
|
- 10
|
|
|
- </select>
|
|
|
-
|
|
|
- <delete id="deleteHistoryByUserId">
|
|
|
- DELETE FROM user_search_history
|
|
|
- WHERE userId=#{userId}
|
|
|
- AND id NOT IN (
|
|
|
- SELECT temp.id FROM (
|
|
|
- SELECT id FROM user_search_history WHERE userId=#{userId} ORDER BY id DESC LIMIT 10
|
|
|
- ) AS temp
|
|
|
- )
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteHistory">
|
|
|
- DELETE FROM user_search_history WHERE userId + #{userId}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <select id="findActivityAll" resultType="com.caimei.model.vo.HeHeActivityVo">
|
|
|
- SELECT
|
|
|
- cha.id AS activityId,
|
|
|
- cha.name,
|
|
|
- cha.listImage,
|
|
|
- cha.beginTime,
|
|
|
- cha.endTime,
|
|
|
- COUNT(chua.id) AS productCount
|
|
|
- FROM
|
|
|
- cm_hehe_user_activity chua
|
|
|
- LEFT JOIN cm_hehe_activity cha ON chua.activityId = cha.id
|
|
|
- WHERE
|
|
|
- chua.userId = #{userId}
|
|
|
- AND cha.delFlag = 0
|
|
|
- AND cha.status = 1
|
|
|
- AND cha.beginTime <![CDATA[ <= ]]> NOW()
|
|
|
- AND cha.endTime <![CDATA[ >= ]]> NOW()
|
|
|
- GROUP BY
|
|
|
- cha.id
|
|
|
- ORDER BY
|
|
|
- cha.addTime DESC
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findActivityById" resultType="string">
|
|
|
- SELECT detailsImage FROM cm_hehe_activity WHERE id = #{activityId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findActivityProduct" resultType="com.caimei.model.vo.ProductVo">
|
|
|
- SELECT
|
|
|
- chp.productId,
|
|
|
- chp.price,
|
|
|
- chp.includedTax,
|
|
|
- chp.invoiceType,
|
|
|
- chp.clubTaxPoint,
|
|
|
- p.name,
|
|
|
- P.unit,
|
|
|
- p.mainImage
|
|
|
- FROM
|
|
|
- cm_hehe_user_activity chua
|
|
|
- LEFT JOIN cm_hehe_product chp ON chua.productId = chp.productId
|
|
|
- LEFT JOIN product p ON chua.productId = p.productID
|
|
|
- WHERE
|
|
|
- chua.userId = #{userId}
|
|
|
- AND chua.activityId = #{activityId}
|
|
|
- </select>
|
|
|
- <select id="findAllFloor" resultType="com.caimei.model.vo.FloorVo">
|
|
|
- select id as floorId,title,description from cm_hehe_floor where status = 1 order by - sort desc
|
|
|
- </select>
|
|
|
- <select id="findFloorById" resultType="com.caimei.model.vo.FloorVo">
|
|
|
- select id as floorId,title,description from cm_hehe_floor where id = #{floorId}
|
|
|
- </select>
|
|
|
- <select id="findAllProductCouponCount" resultType="java.lang.Integer">
|
|
|
- select count(*)
|
|
|
- from cm_hehe_coupon chc
|
|
|
- where chc.delFlag = 0 and chc.productType = 1
|
|
|
- and if(startNowFlag = 1, true, NOW() <![CDATA[ >= ]]> startTime)
|
|
|
- and if(permanentFlag = 1, true, NOW() <![CDATA[ <= ]]> endTime)
|
|
|
- </select>
|
|
|
- <select id="findPartProductCounponCount" resultType="java.lang.Integer">
|
|
|
- select count(*)
|
|
|
- from cm_hehe_coupon chc
|
|
|
- left join cm_hehe_coupon_product chcp on chc.id = chcp.couponId
|
|
|
- left join cm_hehe_product chp on chcp.productId = chp.id
|
|
|
- where chc.delFlag = 0 and chc.productType = 2 and chp.productId = #{productId}
|
|
|
- and if(startNowFlag = 1, true, NOW() <![CDATA[ >= ]]> startTime)
|
|
|
- and if(permanentFlag = 1, true, NOW() <![CDATA[ <= ]]> endTime)
|
|
|
- </select>
|
|
|
<select id="findProductDiscount" resultType="java.lang.Integer">
|
|
|
select chd.discount
|
|
|
from cm_hehe_discount chd
|
|
@@ -316,13 +81,7 @@
|
|
|
<select id="findCollageProduct" resultType="com.caimei.model.po.CmHeheCollageProductPo">
|
|
|
select chcp.productId, chcp.price, chcp.limitedNum, chcp.unlimitedFlag, chcp.memberNum
|
|
|
from cm_hehe_collage_product chcp
|
|
|
- where chcp.productId = #{productID} and chcp.status = 1
|
|
|
- </select>
|
|
|
- <select id="findProductBuyNum" resultType="java.lang.Integer">
|
|
|
- select ifnull(sum(cop.num),0) from cm_hehe_collage_member chcm
|
|
|
- left join cm_hehe_collage chc on chcm.collageId = chc.id
|
|
|
- left join cm_order_product cop on chcm.orderId = cop.orderID
|
|
|
- where chc.productId = #{productId} and chcm.userId = #{userId}
|
|
|
+ where chcp.productId = #{productId} and chcp.status = 1
|
|
|
</select>
|
|
|
<select id="getDiscountPrice" resultType="java.math.BigDecimal">
|
|
|
select a.discountPrice
|