|
|
@ -307,41 +307,37 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getTotal" resultType="java.lang.Integer"> |
|
|
|
SELECT COUNT(*) from cere_shop_visit where shop_id=#{businessId} |
|
|
|
AND project = #{project} |
|
|
|
SELECT COUNT(*) from cere_shop_visit a Left Join cere_platform_shop b on a.shop_id=b.shop_id |
|
|
|
where a.project = #{project} and b.business_id=#{businessId} |
|
|
|
and DATEDIFF(LEFT(NOW(),10),LEFT(visit_time,10))=0 |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getStayOrders" resultType="java.lang.Integer"> |
|
|
|
SELECT COUNT(*) from cere_shop_order |
|
|
|
where shop_id = #{businessId} |
|
|
|
AND project = #{project} |
|
|
|
and order_id NOT IN (SELECT order_id FROM cere_order_after) |
|
|
|
and state = 2 |
|
|
|
SELECT COUNT(*) from cere_shop_order a left join cere_platform_shop b on a.shop_id = b.shop_id |
|
|
|
where a.project = #{project} and b.business_id=#{businessId} |
|
|
|
and a.order_id NOT IN (SELECT order_id FROM cere_order_after) |
|
|
|
and a.state = 2 and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=0 |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getStayAfters" resultType="java.lang.Integer"> |
|
|
|
SELECT COUNT(*) from cere_order_after a |
|
|
|
SELECT COUNT(*) from (SELECT a.*, b.shop_id from cere_order_after a |
|
|
|
LEFT JOIN cere_shop_order b ON a.order_id=b.order_id |
|
|
|
where b.shop_id=#{businessId} |
|
|
|
AND b.project = #{project} |
|
|
|
and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=0 |
|
|
|
where b.project = #{project} |
|
|
|
and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=0 ) c LEFT JOIN cere_platform_shop d on c.shop_id = d.shop_id where d.business_id = #{businessId} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getMoney" resultType="java.math.BigDecimal"> |
|
|
|
SELECT SUM(price) from cere_shop_order |
|
|
|
where shop_id = #{businessId} |
|
|
|
AND project = #{project} |
|
|
|
and state = 4 |
|
|
|
and DATEDIFF(LEFT(NOW(),10), LEFT(create_time,10)) = 0 |
|
|
|
select SUM(a.price) from cere_shop_order a left join cere_platform_shop b on a.shop_id = b.shop_id |
|
|
|
where a.project = #{project} and b.business_id = #{businessId} |
|
|
|
and a.state = 4 |
|
|
|
and DATEDIFF(LEFT(NOW(),10), LEFT(a.create_time,10)) = 0 |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getVisit" resultType="java.lang.Integer"> |
|
|
|
SELECT COUNT(distinct buyer_user_id) from cere_shop_visit |
|
|
|
where shop_id=#{businessId} |
|
|
|
AND project = #{project} |
|
|
|
and visit_time >= #{startTime} |
|
|
|
and visit_time <= #{endTime} |
|
|
|
select COUNT(distinct a.buyer_user_id) from cere_shop_visit a left join cere_platform_shop b on a.shop_id = b.shop_id |
|
|
|
where a.project = #{project} and b.business_id = #{businessId} |
|
|
|
and a.visit_time >= #{startTime} |
|
|
|
and a.visit_time <= #{endTime} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getHotProducts" resultType="com.shop.cereshop.business.page.index.HotSellProduct"> |
|
|
@ -365,21 +361,20 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findVisits" resultType="java.math.BigDecimal"> |
|
|
|
SELECT COUNT(*) from cere_shop_conversion |
|
|
|
where shop_id=#{businessId} |
|
|
|
AND project = #{project} |
|
|
|
and type=#{type} |
|
|
|
select COUNT(*) from cere_shop_conversion a left join cere_platform_shop b on a.shop_id = b.shop_id |
|
|
|
where a.project = #{project} and b.business_id = #{businessId} |
|
|
|
and a.type=#{type} |
|
|
|
<if test='condition=="1"'> |
|
|
|
and DATEDIFF(LEFT(NOW(),10),LEFT(create_time,10))=0 |
|
|
|
and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=0 |
|
|
|
</if> |
|
|
|
<if test='condition=="2"'> |
|
|
|
and DATEDIFF(LEFT(NOW(),10),LEFT(create_time,10))=1 |
|
|
|
and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=1 |
|
|
|
</if> |
|
|
|
<if test='condition=="3"'> |
|
|
|
and DATE_SUB(CURDATE(),INTERVAL 7 DAY)<=create_time |
|
|
|
and DATE_SUB(CURDATE(),INTERVAL 7 DAY)<=a.create_time |
|
|
|
</if> |
|
|
|
<if test='condition=="4"'> |
|
|
|
and DATE_SUB(CURDATE(),INTERVAL 30 DAY)<=create_time |
|
|
|
and DATE_SUB(CURDATE(),INTERVAL 30 DAY)<=a.create_time |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|