区域统计

This commit is contained in:
曹磊 2025-07-04 15:44:12 +08:00
parent 0ad86f5010
commit 92776fde1c
2 changed files with 92 additions and 63 deletions

View File

@ -21,84 +21,113 @@
<select id="queryXqHyTdzlList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy">
select
a.housingestate_id as housingestateId,
b.name as housingestateName,
round(sum(a.weight),2) as weight
from bl_order_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
and a.add_time >= #{hy.beginTime}
and a.add_time &lt;= #{hy.endTime}
group by a.housingestate_id,b.name
ORDER BY weight desc
@row_num := @row_num + 1 AS rowNumber,
t.*
from (SELECT @row_num := 0) r,
(
select
a.housingestate_id as housingestateId,
b.name as housingestateName,
round(sum(a.weight),2) as weight
from bl_order_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
and a.add_time >= #{hy.beginTime}
and a.add_time &lt;= #{hy.endTime}
group by a.housingestate_id,b.name
) t
ORDER BY t.weight desc
</select>
<select id="queryXqHyXzList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy">
select
a.housingestate_id as housingestateId,
b.name as housingestateName,
count(a.phone) as cn
from bl_user_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
where a.register_date >= #{hy.beginTime}
and a.register_date &lt;= #{hy.endTime}
group by a.housingestate_id,b.name
ORDER BY cn desc
@row_num := @row_num + 1 AS rowNumber,
t.*
from (SELECT @row_num := 0) r,
(
select
a.housingestate_id as housingestateId,
b.name as housingestateName,
count(a.phone) as cn
from bl_user_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
where a.register_date >= #{hy.beginTime}
and a.register_date &lt;= #{hy.endTime}
group by a.housingestate_id,b.name
) t
ORDER BY t.cn desc
</select>
<select id="queryXqHyTdcsList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy">
select
a.housingestate_id as housingestateId,
b.name as housingestateName,
count(a.id) as cn
from bl_order_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
where a.add_time >= #{hy.beginTime}
and a.add_time &lt;= #{hy.endTime}
group by a.housingestate_id,b.name
order by cn desc
@row_num := @row_num + 1 AS rowNumber,
t.*
from (SELECT @row_num := 0) r,
(
select
a.housingestate_id as housingestateId,
b.name as housingestateName,
count(a.id) as cn
from bl_order_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
where a.add_time >= #{hy.beginTime}
and a.add_time &lt;= #{hy.endTime}
group by a.housingestate_id,b.name
) t
ORDER BY t.cn desc
</select>
<select id="queryXzhyDetailList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy">
select
a.phone,a.register_date,a.deliveries,a.violations,a.delivered_at,a.status,b.name as housingestateName,c.content
from bl_user_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
left join bl_device_info c on a.imei = c.imei
<where>
<if test="hy.housingestateId != null and hy.housingestateId !=''">
and a.housingestate_id = #{hy.housingestateId}
</if>
<if test="hy.beginTime != null and hy.beginTime !=''">
and a.register_date >= #{hy.beginTime}
</if>
<if test="hy.endTime != null and hy.endTime !=''">
and a.register_date &lt;= #{hy.endTime}
</if>
</where>
@row_num := @row_num + 1 AS rowNumber,
t.*
from (SELECT @row_num := 0) r,
(
select
a.phone,a.register_date,a.deliveries,a.violations,a.delivered_at,a.status,b.name as housingestateName,c.content,a.imei
from bl_user_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
left join bl_device_info c on a.imei = c.imei
<where>
<if test="hy.housingestateId != null and hy.housingestateId !=''">
and a.housingestate_id = #{hy.housingestateId}
</if>
<if test="hy.beginTime != null and hy.beginTime !=''">
and a.register_date >= #{hy.beginTime}
</if>
<if test="hy.endTime != null and hy.endTime !=''">
and a.register_date &lt;= #{hy.endTime}
</if>
</where>
) t
ORDER BY t.imei desc
</select>
<select id="queryTdcsDetailList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy">
select
a.phone,a.add_time,a.weight,a.invalid,b.name as housingestateName,d.content,a.cause
from bl_order_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
inner join bl_user_info c on a.phone = c.phone
inner join bl_device_info d on a.imei = d.imei
<where>
<if test="hy.housingestateId != null and hy.housingestateId !=''">
and a.housingestate_id = #{hy.housingestateId}
</if>
<if test="hy.beginTime != null and hy.beginTime !=''">
and a.add_time >= #{hy.beginTime}
</if>
<if test="hy.endTime != null and hy.endTime !=''">
and a.add_time &lt;= #{hy.endTime}
</if>
</where>
order by a.add_time desc
@row_num := @row_num + 1 AS rowNumber,
t.*
from (SELECT @row_num := 0) r,
(
select
a.phone,a.add_time,a.weight,a.invalid,b.name as housingestateName,d.content,a.cause
from bl_order_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
inner join bl_user_info c on a.phone = c.phone
inner join bl_device_info d on a.imei = d.imei
<where>
<if test="hy.housingestateId != null and hy.housingestateId !=''">
and a.housingestate_id = #{hy.housingestateId}
</if>
<if test="hy.beginTime != null and hy.beginTime !=''">
and a.add_time >= #{hy.beginTime}
</if>
<if test="hy.endTime != null and hy.endTime !=''">
and a.add_time &lt;= #{hy.endTime}
</if>
</where>
) t
ORDER BY t.add_time desc
</select>
</mapper>

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.zh.view.hy.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
@ -38,8 +39,7 @@ public class Hy implements Serializable {
private String deliveredAt;//最后投递时间
private String status;//用户状态0:拉黑 1:正常
private String cause;//原因
private Integer rowNumber;
}