You've already forked FrameTour-BE
实现“用户转化漏斗统计”
This commit is contained in:
@ -6,95 +6,242 @@
|
||||
from `order`
|
||||
where
|
||||
status = 1 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null and startTime!= ''">
|
||||
<if test="startTime!= null">
|
||||
and create_at >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null and endTime!= ''">
|
||||
<if test="endTime!= null">
|
||||
and create_at <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countPreviewOfMember" resultType="java.lang.Integer">
|
||||
select ifnull(count(1),0) as count
|
||||
from statistics
|
||||
where type=2 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null and startTime!= ''">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null and endTime!= ''">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
<select id="countPreviewVideoOfMember" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type=2 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
)a
|
||||
</select>
|
||||
<select id="countScanCodeOfMember" resultType="java.lang.Integer">
|
||||
select ifnull(count(1),0) as count
|
||||
from statistics
|
||||
where type=0 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null and startTime!= ''">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null and endTime!= ''">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type=0 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
) AS subquery;
|
||||
</select>
|
||||
<select id="countClickPayOfMember" resultType="java.lang.Integer">
|
||||
select ifnull(count(1),0) as count
|
||||
from statistics
|
||||
where type=9 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null and startTime!= ''">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null and endTime!= ''">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type=9 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
)a
|
||||
</select>
|
||||
<select id="countPayOfMember" resultType="java.lang.Integer">
|
||||
select ifnull(count(1),0) as count
|
||||
from statistics
|
||||
where type in(3,4) and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null and startTime!= ''">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null and endTime!= ''">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type in(3,4) and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
)a
|
||||
</select>
|
||||
<select id="countSceneOrderNum" resultType="java.lang.Integer">
|
||||
select ifnull(count(1),0) as count
|
||||
from statistics
|
||||
where type=3 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null and startTime!= ''">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null and endTime!= ''">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by morph_id
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type=3 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by morph_id
|
||||
)a
|
||||
</select>
|
||||
<select id="countPushOrderNum" resultType="java.lang.Integer">
|
||||
select ifnull(count(1),0) as count
|
||||
from statistics
|
||||
where type=4 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null and startTime!= ''">
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type=4 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by morph_id
|
||||
)a
|
||||
</select>
|
||||
<select id="countPushOfMember" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type=6 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
)a
|
||||
</select>
|
||||
<select id="countCameraShotOfMember" resultType="java.lang.Integer">
|
||||
select count(1) as count
|
||||
from face_sample
|
||||
where scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_at >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_at <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countUploadFaceOfMember" resultType="java.lang.Integer">
|
||||
select count(1) as count
|
||||
from face
|
||||
where scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_at >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_at <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countCompleteVideoOfMember" resultType="java.lang.Integer">
|
||||
select ifnull(sum(count),0) as count
|
||||
from(
|
||||
select count(1) as count
|
||||
from video
|
||||
where scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
)a
|
||||
</select>
|
||||
<select id="countTotalVisitorOfMember" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type=0 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
) AS a;
|
||||
</select>
|
||||
<select id="countCompleteOfVideo" resultType="java.lang.Integer">
|
||||
select count(1) as count
|
||||
from video
|
||||
where scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null and endTime!= ''">
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countPreviewOfVideo" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type=0 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by morph_id
|
||||
)a
|
||||
</select>
|
||||
<select id="countPayOfOrder" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
IFNULL(SUM(count), 0) AS count
|
||||
FROM (
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type in(3,4) and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by morph_id
|
||||
)a
|
||||
</select>
|
||||
<select id="countPushOfMember" resultType="java.lang.Integer">
|
||||
select ifnull(count(1),0) as count
|
||||
<select id="countRefundOfOrder" resultType="java.lang.Integer">
|
||||
select count(1) as count
|
||||
from statistics
|
||||
where type=6 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null and startTime!= ''">
|
||||
where type =5 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null and endTime!= ''">
|
||||
<if test="endTime!= null">
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
group by member_id
|
||||
</select>
|
||||
<select id="countRefundAmount" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(pay_price),0) as payPrice
|
||||
from `order`
|
||||
where
|
||||
status = 2 and scenic_id = #{scenicId}
|
||||
<if test="startTime!= null">
|
||||
and create_at >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!= null">
|
||||
and create_at <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user