This commit is contained in:
2025-01-26 20:09:24 +08:00
parent 1b11342e5d
commit b51048ddfa
4 changed files with 53 additions and 65 deletions

View File

@ -20,7 +20,7 @@
</select>
<select id="countPreviewVideoOfMember" resultType="java.lang.Integer">
SELECT
IFNULL(count(count), 0) AS count
IFNULL(count(1), 0) AS count
FROM (
select count(1) as count
from statistics
@ -36,7 +36,7 @@
</select>
<select id="countScanCodeOfMember" resultType="java.lang.Integer">
SELECT
IFNULL(count(count), 0) AS count
IFNULL(count(1), 0) AS count
FROM (
select count(1) as count
from statistics
@ -52,51 +52,46 @@
</select>
<select id="countClickPayOfMember" resultType="java.lang.Integer">
SELECT
IFNULL(count(count), 0) AS count
IFNULL(count(1), 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 &lt;= #{endTime}
</if>
group by member_id
select count(1) as count
from `order`
where scenic_id = #{scenicId}
<if test="startTime!= null">
and create_at >= #{startTime}
</if>
<if test="endTime!= null">
and create_at &lt;= #{endTime}
</if>
group by member_id
)a
</select>
<select id="countPayOfMember" resultType="java.lang.Integer">
SELECT
IFNULL(count(count), 0) AS count
IFNULL(count(1), 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 &lt;= #{endTime}
</if>
group by member_id
from `order`
where scenic_id = #{scenicId} and pay_at is not null
<if test="startTime!= null">
and create_at >= #{startTime}
</if>
<if test="endTime!= null">
and create_at &lt;= #{endTime}
</if>
group by member_id
)a
</select>
<select id="countSceneOrderNum" resultType="java.lang.Integer">
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 &lt;= #{endTime}
</if>
group by morph_id
)a
from `order`
where scenic_id = #{scenicId} and pay_at is not null
<if test="startTime!= null">
and create_at >= #{startTime}
</if>
<if test="endTime!= null">
and create_at &lt;= #{endTime}
</if>
</select>
<select id="countPushOrderNum" resultType="java.lang.Integer">
SELECT
@ -116,7 +111,7 @@
</select>
<select id="countPushOfMember" resultType="java.lang.Integer">
SELECT
IFNULL(count(count), 0) AS count
IFNULL(count(1), 0) AS count
FROM (
select count(1) as count
from statistics
@ -147,10 +142,8 @@
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 &lt;= #{endTime}
</if>
<if test="startTime!= null">and create_at >= #{startTime}</if>
<if test="endTime!= null">and create_at &lt;= #{endTime}</if>
group by member_id
) a
</select>
@ -172,7 +165,7 @@
</select>
<select id="countTotalVisitorOfMember" resultType="java.lang.Integer">
SELECT
IFNULL(count(count), 0) AS count
IFNULL(count(1), 0) AS count
FROM (
select count(1) as count
from statistics
@ -214,37 +207,34 @@
)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}
from `order`
where
pay_at is not null and scenic_id = #{scenicId}
<if test="startTime!= null">
and create_time >= #{startTime}
and create_at >= #{startTime}
</if>
<if test="endTime!= null">
and create_time &lt;= #{endTime}
and create_at &lt;= #{endTime}
</if>
group by morph_id
)a
</select>
<select id="countRefundOfOrder" resultType="java.lang.Integer">
select count(1) as count
from statistics
where type =5 and scenic_id = #{scenicId}
from `order`
where
refund_status = 1 and scenic_id = #{scenicId}
<if test="startTime!= null">
and create_time >= #{startTime}
and create_at >= #{startTime}
</if>
<if test="endTime!= null">
and create_time &lt;= #{endTime}
and create_at &lt;= #{endTime}
</if>
</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}
refund_status = 1 and scenic_id = #{scenicId}
<if test="startTime!= null">
and create_at >= #{startTime}
</if>