|
@@ -26,16 +26,16 @@
|
|
|
left join cm_hehe_activity_product chap on a.productId = chap.productId
|
|
|
left join cm_hehe_floor_product chfp on a.productId = chfp.productId
|
|
|
<where>
|
|
|
- <if test="productId != null and productId != ''">
|
|
|
+ <if test="productId != null">
|
|
|
AND a.productId = #{productId}
|
|
|
</if>
|
|
|
- <if test="validFlag != null and validFlag != ''">
|
|
|
+ <if test="validFlag != null">
|
|
|
AND a.validFlag = #{validFlag}
|
|
|
</if>
|
|
|
- <if test="includedTax != null and includedTax != ''">
|
|
|
+ <if test="includedTax != null">
|
|
|
AND a.includedTax = #{includedTax}
|
|
|
</if>
|
|
|
- <if test="invoiceType != null and invoiceType != ''">
|
|
|
+ <if test="invoiceType != null">
|
|
|
AND a.invoiceType = #{invoiceType}
|
|
|
</if>
|
|
|
<if test="id != null and id != ''">
|
|
@@ -72,7 +72,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findBigTypeList" resultType="com.caimei365.manager.entity.hehe.product.HeHeBigType">
|
|
|
- SELECT a.bigTypeID AS "bigTypeID",
|
|
|
+ SELECT a.bigTypeID AS "bigTypeId",
|
|
|
a.name AS "name",
|
|
|
a.bigTypeCode AS "bigTypeCode",
|
|
|
a.wwwValidFlag AS "wwwValidFlag",
|
|
@@ -85,8 +85,8 @@
|
|
|
a.mallType
|
|
|
FROM bigtype a
|
|
|
<where>
|
|
|
- <if test="bigTypeID != null and bigTypeID != ''">
|
|
|
- AND a.bigTypeID = #{bigTypeID}
|
|
|
+ <if test="bigTypeId != null">
|
|
|
+ AND a.bigTypeID = #{bigTypeId}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
AND a.name LIKE concat('%',#{name},'%')
|
|
@@ -94,13 +94,13 @@
|
|
|
<if test="bigTypeCode != null and bigTypeCode != ''">
|
|
|
AND a.bigTypeCode = #{bigTypeCode}
|
|
|
</if>
|
|
|
- <if test="wwwValidFlag != null and wwwValidFlag != ''">
|
|
|
+ <if test="wwwValidFlag != null">
|
|
|
AND a.wwwValidFlag = #{wwwValidFlag}
|
|
|
</if>
|
|
|
- <if test="crmValidFlag != null and crmValidFlag != ''">
|
|
|
+ <if test="crmValidFlag != null">
|
|
|
AND a.crmValidFlag = #{crmValidFlag}
|
|
|
</if>
|
|
|
- <if test="sortIndex != null and sortIndex != ''">
|
|
|
+ <if test="sortIndex != null">
|
|
|
AND a.sortIndex = #{sortIndex}
|
|
|
</if>
|
|
|
<if test="typeSort != null and typeSort != '' and typeSort != 'null'">
|
|
@@ -184,7 +184,8 @@
|
|
|
FROM cm_hehe_reduction a
|
|
|
<where>
|
|
|
<if test="name != null and name != ''">
|
|
|
- AND a.name LIKE concat('%',#{name},'%')
|
|
|
+ AND a.name LIKE concat('%',#{name},'%')
|
|
|
+ </if>
|
|
|
<if test="status != null">
|
|
|
<if test="status == 1">
|
|
|
and NOW() <![CDATA[ < ]]> a.startTime
|
|
@@ -211,7 +212,8 @@
|
|
|
FROM cm_hehe_discount a
|
|
|
<where>
|
|
|
<if test="title != null and title != ''">
|
|
|
- AND a.title LIKE concat('%',#{title},'%')
|
|
|
+ AND a.title LIKE concat('%',#{title},'%')
|
|
|
+ </if>
|
|
|
<if test="status != null and status != ''">
|
|
|
AND a.status = #{status}
|
|
|
</if>
|
|
@@ -219,4 +221,87 @@
|
|
|
order by addTime desc
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findCollageProductList" resultType="com.caimei365.manager.entity.hehe.product.CollageProduct">
|
|
|
+ SELECT
|
|
|
+ a.id AS "id",
|
|
|
+ a.productId AS "productId",
|
|
|
+ a.limitedNum AS "limitedNum",
|
|
|
+ a.unlimitedFlag AS "unlimitedFlag",
|
|
|
+ a.memberNum AS "memberNum",
|
|
|
+ a.status AS "status",
|
|
|
+ a.addTime AS "addTime",
|
|
|
+ s.name AS shopName,
|
|
|
+ p.name AS productName,
|
|
|
+ p.mainImage AS productImage,
|
|
|
+ (select collagePrice
|
|
|
+ from cm_hehe_collage_sku
|
|
|
+ where productId = a.productId
|
|
|
+ order by collagePrice asc
|
|
|
+ limit 1) as price
|
|
|
+ FROM cm_hehe_collage_product a
|
|
|
+ left join product p on a.productId = p.productID
|
|
|
+ left join cm_hehe_product chp on p.productID = chp.productId
|
|
|
+ left join shop s on p.shopID = s.shopID
|
|
|
+ <where>
|
|
|
+ chp.id is not null
|
|
|
+ <if test="id != null">
|
|
|
+ AND a.id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ AND a.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="productName != null and productName != ''">
|
|
|
+ and p.name like concat('%',#{productName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="shopName != null and shopName != ''">
|
|
|
+ and s.name like concat('%',#{shopName},'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by p.productID
|
|
|
+ order by a.addTime desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findCollageRecordList" resultType="com.caimei365.manager.entity.hehe.product.CollageRecord">
|
|
|
+ SELECT
|
|
|
+ a.id AS "id",
|
|
|
+ a.productId AS "productId",
|
|
|
+ a.price AS "price",
|
|
|
+ a.memberNum AS "memberNum",
|
|
|
+ a.status AS "status",
|
|
|
+ a.startTime AS "startTime",
|
|
|
+ a.completeTime AS "completeTime",
|
|
|
+ a.endTime AS "endTime",
|
|
|
+ p.name as productName,
|
|
|
+ s.name as shopName
|
|
|
+ FROM cm_hehe_collage a
|
|
|
+ left join product p on a.productId = p.productID
|
|
|
+ left join cm_hehe_product hp on p.productID = hp.productId
|
|
|
+ left join shop s on p.shopID = s.shopID
|
|
|
+ <where>
|
|
|
+ a.status != 0 and a.status != 3
|
|
|
+ <if test="id != null">
|
|
|
+ AND a.id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ AND a.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="productName != null and productName != ''">
|
|
|
+ and p.name like concat('%',#{productName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="shopName != null and shopName != ''">
|
|
|
+ and s.name like concat('%',#{shopName},'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by startTime desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCollageOrderIds" resultType="java.lang.Integer">
|
|
|
+ select chcm.orderId
|
|
|
+ from cm_hehe_collage_member chcm
|
|
|
+ left join cm_order co on chcm.orderId = co.orderID
|
|
|
+ where collageId = #{id}
|
|
|
+ and co.receiptStatus = 3
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|