|
@@ -17,69 +17,106 @@
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
- <insert id="insertCollage" useGeneratedKeys="true" keyProperty="id" keyColumn="id" parameterType="com.caimei.model.po.CmHeheCollagePo">
|
|
|
- insert into cm_hehe_collage (productId, price, memberNum, status, startTime, completeTime, endTime)
|
|
|
- values (#{productId}, #{price}, #{memberNum}, #{status}, #{startTime}, null, #{endTime})
|
|
|
+ <insert id="insertCollage" useGeneratedKeys="true" keyProperty="id" keyColumn="id"
|
|
|
+ parameterType="com.caimei.model.po.CmHeheCollagePo">
|
|
|
+ insert into cm_hehe_collage (productId, price, memberNum, status, startTime, completeTime, endTime, skuId)
|
|
|
+ values (#{productId}, #{price}, #{memberNum}, #{status}, #{startTime}, null, #{endTime}, #{skuId})
|
|
|
</insert>
|
|
|
<insert id="insertCollageMember">
|
|
|
- insert into cm_hehe_collage_member (collageId, userId, orderId, launchFlag) values (#{collageId}, #{userId}, #{orderId}, #{launchFlag})
|
|
|
+ insert into cm_hehe_collage_member (collageId, userId, orderId, launchFlag)
|
|
|
+ values (#{collageId}, #{userId}, #{orderId}, #{launchFlag})
|
|
|
</insert>
|
|
|
|
|
|
<select id="findCollageProduct" resultType="com.caimei.model.po.CmHeheCollageProductPo">
|
|
|
- select chcp.productid, chcs.collagePrice as price, chcp.limitednum, chcp.unlimitedflag, chcp.membernum, chcp.status
|
|
|
+ select chcp.productid,
|
|
|
+ chcs.collagePrice as price,
|
|
|
+ chcp.limitednum,
|
|
|
+ chcp.unlimitedflag,
|
|
|
+ chcp.membernum,
|
|
|
+ chcp.status
|
|
|
from cm_hehe_collage_product chcp
|
|
|
- left join cm_hehe_collage_sku chcs on chcp.productId = chcs.productId
|
|
|
- where chcs.skuId = #{skuId} and chcp.status = 1
|
|
|
+ left join cm_hehe_collage_sku chcs on chcp.productId = chcs.productId
|
|
|
+ where chcs.skuId = #{skuId}
|
|
|
+ and chcp.status = 1
|
|
|
</select>
|
|
|
<select id="findCollage" resultType="com.caimei.model.po.CmHeheCollagePo">
|
|
|
- select id, productId, price, memberNum, status, startTime, completeTime, endTime
|
|
|
- from cm_hehe_collage where id = #{collageId} and status = 1
|
|
|
+ select id,
|
|
|
+ productId,
|
|
|
+ price,
|
|
|
+ memberNum,
|
|
|
+ status,
|
|
|
+ startTime,
|
|
|
+ completeTime,
|
|
|
+ endTime
|
|
|
+ from cm_hehe_collage
|
|
|
+ where id = #{collageId}
|
|
|
+ and status = 1
|
|
|
</select>
|
|
|
<select id="findCollageMemberNum" resultType="java.lang.Integer">
|
|
|
- select count(*) from cm_hehe_collage_member chcm left join cm_order co on chcm.orderId = co.orderID
|
|
|
- where collageId = #{collageId} and co.receiptStatus = 3
|
|
|
+ select count(*)
|
|
|
+ from cm_hehe_collage_member chcm
|
|
|
+ left join cm_order co on chcm.orderId = co.orderID
|
|
|
+ where collageId = #{collageId}
|
|
|
+ and co.receiptStatus = 3
|
|
|
</select>
|
|
|
<select id="getCollageByOrderId" resultType="com.caimei.model.po.CmHeheCollagePo">
|
|
|
- select chc.id,chcm.launchFlag,chc.memberNum from cm_hehe_collage chc left join cm_hehe_collage_member chcm on chc.id = chcm.collageId
|
|
|
+ select chc.id, chcm.launchFlag, chc.memberNum
|
|
|
+ from cm_hehe_collage chc
|
|
|
+ left join cm_hehe_collage_member chcm on chc.id = chcm.collageId
|
|
|
where chcm.orderId = #{orderId}
|
|
|
</select>
|
|
|
<select id="getCollageDetails" resultType="com.caimei.model.vo.CollageDetailsVo">
|
|
|
select chc.skuId,
|
|
|
- chc.id as collageId,
|
|
|
+ chc.id as collageId,
|
|
|
chc.productId,
|
|
|
- p.mainImage as productImage,
|
|
|
- p.name as productName,
|
|
|
- chc.price as price,
|
|
|
- (select price from cm_hehe_sku where productId=chc.productId order by price asc limit 1) as normalPrice,
|
|
|
+ p.mainImage as productImage,
|
|
|
+ p.name as productName,
|
|
|
+ chc.price as price,
|
|
|
+ (select price
|
|
|
+ from cm_hehe_sku
|
|
|
+ where productId = chc.productId
|
|
|
+ order by price asc
|
|
|
+ limit 1) as normalPrice,
|
|
|
chc.memberNum,
|
|
|
- count(chcm.id) as existNum,
|
|
|
- (chc.memberNum - count(chcm.id)) as needNum,
|
|
|
+ count(chcm.id) as existNum,
|
|
|
+ (chc.memberNum - count(chcm.id)) as needNum,
|
|
|
chc.endTime,
|
|
|
chc.status,
|
|
|
limitedNum,
|
|
|
unlimitedFlag
|
|
|
from cm_hehe_collage chc
|
|
|
- left join cm_hehe_collage_member chcm on chc.id = chcm.collageId
|
|
|
- left join cm_order co on chcm.orderId = co.orderID
|
|
|
- left join cm_hehe_collage_product chcp on chc.productId = chcp.productId
|
|
|
- left join product p on chcp.productId = p.productID
|
|
|
+ left join cm_hehe_collage_member chcm on chc.id = chcm.collageId
|
|
|
+ left join cm_order co on chcm.orderId = co.orderID
|
|
|
+ left join cm_hehe_collage_product chcp on chc.productId = chcp.productId
|
|
|
+ left join product p on chcp.productId = p.productID
|
|
|
where chc.id = #{collageId}
|
|
|
and co.receiptStatus = 3
|
|
|
</select>
|
|
|
<select id="findNoPayCollageOrderIds" resultType="java.lang.Integer">
|
|
|
- select co.orderID from cm_hehe_collage_member chcm left join cm_order co on chcm.orderId = co.orderID
|
|
|
- where co.receiptStatus = 1 and chcm.collageId = #{collageId}
|
|
|
+ select co.orderID
|
|
|
+ from cm_hehe_collage_member chcm
|
|
|
+ left join cm_order co on chcm.orderId = co.orderID
|
|
|
+ where co.receiptStatus = 1
|
|
|
+ and chcm.collageId = #{collageId}
|
|
|
</select>
|
|
|
<select id="getMemberOrderId" resultType="java.lang.Integer">
|
|
|
- select orderId from cm_hehe_collage_member where collageId = #{collageId} and userId = #{userId}
|
|
|
+ select orderId
|
|
|
+ from cm_hehe_collage_member
|
|
|
+ where collageId = #{collageId}
|
|
|
+ and userId = #{userId}
|
|
|
</select>
|
|
|
<select id="getUserMobileByOrderId" resultType="java.lang.String">
|
|
|
- select u.mobile from cm_hehe_user u left join cm_order co on u.userId = co.userID where co.orderID = #{orderId}
|
|
|
+ select u.mobile
|
|
|
+ from cm_hehe_user u
|
|
|
+ left join cm_order co on u.userId = co.userID
|
|
|
+ where co.orderID = #{orderId}
|
|
|
</select>
|
|
|
<select id="getMobilesByCollageId" resultType="java.lang.String">
|
|
|
- select chu.mobile from cm_hehe_collage_member chcm
|
|
|
- left join cm_order co on chcm.orderId = co.orderID
|
|
|
- left join cm_hehe_user chu on chcm.userId = chu.userId
|
|
|
- where collageId = #{collageId} and co.receiptStatus = 3
|
|
|
+ select chu.mobile
|
|
|
+ from cm_hehe_collage_member chcm
|
|
|
+ left join cm_order co on chcm.orderId = co.orderID
|
|
|
+ left join cm_hehe_user chu on chcm.userId = chu.userId
|
|
|
+ where collageId = #{collageId}
|
|
|
+ and co.receiptStatus = 3
|
|
|
</select>
|
|
|
</mapper>
|