Compare commits

..

No commits in common. "191464327816e82c3d270d2d90677abc4b8816c2" and "0ad86f5010916c6f7ee37df307cb189e2067ef5b" have entirely different histories.

7 changed files with 98 additions and 174 deletions

View File

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

View File

@ -1,7 +1,5 @@
package org.jeecg.modules.zh.view.hy.controller; package org.jeecg.modules.zh.view.hy.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.zh.view.hy.entity.Hy; import org.jeecg.modules.zh.view.hy.entity.Hy;
@ -9,7 +7,6 @@ import org.jeecg.modules.zh.view.hy.service.IHyService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -55,11 +52,8 @@ public class HyController {
* 会员投递次数排行榜 * 会员投递次数排行榜
*/ */
@RequestMapping(value = "/queryHyTdcsList", method = RequestMethod.GET) @RequestMapping(value = "/queryHyTdcsList", method = RequestMethod.GET)
public Result queryHyTdcsList(Hy hy, public Result queryHyTdcsList(Hy hy) {
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, List<Hy> list = service.queryHyTdcsList(hy);
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
Page<Hy> page = new Page<Hy>(pageNo, pageSize);
IPage<Hy> list = service.queryHyTdcsList(page,hy);
return Result.ok(list); return Result.ok(list);
} }

View File

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

View File

@ -1,9 +1,6 @@
package org.jeecg.modules.zh.view.hy.mapper; package org.jeecg.modules.zh.view.hy.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.zh.view.hy.entity.Hy; import org.jeecg.modules.zh.view.hy.entity.Hy;
import java.util.List; import java.util.List;
@ -16,7 +13,7 @@ public interface HyMapper extends BaseMapper<Hy>{
List<Hy> queryHousingestateList(); List<Hy> queryHousingestateList();
List<Hy> queryHyRegisterList(Hy hy); List<Hy> queryHyRegisterList(Hy hy);
List<Hy> queryHyXzList(Hy hy); List<Hy> queryHyXzList(Hy hy);
IPage<Hy> queryHyTdcsList(Page<Hy> page, @Param("hy")Hy hy); List<Hy> queryHyTdcsList(Hy hy);
List<Hy> queryHyTdzlList(Hy hy); List<Hy> queryHyTdzlList(Hy hy);
List<Hy> queryHyWgList(Hy hy); List<Hy> queryHyWgList(Hy hy);

View File

@ -29,38 +29,27 @@
</select> </select>
<select id="queryHyXzList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy"> <select id="queryHyXzList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy">
select select DATE_FORMAT(register_date,'%Y-%m-%d') as shortDay,count(*) as cn
@row_num := @row_num + 1 AS rowNumber, from bl_user_info
t.* where register_date >= #{beginTime}
from (SELECT @row_num := 0) r, and register_date &lt;= #{endTime}
( group by DATE_FORMAT(register_date,'%Y-%m-%d')
select DATE_FORMAT(register_date,'%Y-%m-%d') as shortDay,count(*) as cn order by DATE_FORMAT(register_date,'%Y-%m-%d')
from bl_user_info
where register_date >= #{beginTime}
and register_date &lt;= #{endTime}
group by DATE_FORMAT(register_date,'%Y-%m-%d')
) t
ORDER BY t.shortDay asc
</select> </select>
<select id="queryHyTdcsList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy"> <select id="queryHyTdcsList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy">
select select
@row_num := @row_num + 1 AS rowNumber, phone,
t.* count(*) as cn
from (SELECT @row_num := 0) r, from bl_order_info
( where add_time >= #{beginTime}
select and add_time &lt;= #{endTime}
phone, <if test="housingestateId!=null and housingestateId!=''">
count(*) as cn and housingestate_id = #{housingestateId}
from bl_order_info </if>
where add_time >= #{hy.beginTime} group by phone
and add_time &lt;= #{hy.endTime} order by cn desc
<if test="hy.housingestateId!=null and hy.housingestateId!=''"> limit 10
and housingestate_id = #{hy.housingestateId}
</if>
group by phone
) t
order by t.cn desc
</select> </select>
<select id="queryHyTdzlList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy"> <select id="queryHyTdzlList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy">
@ -119,41 +108,18 @@
<select id="queryHyjlList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy"> <select id="queryHyjlList" parameterType="org.jeecg.modules.zh.view.hy.entity.Hy" resultType="org.jeecg.modules.zh.view.hy.entity.Hy">
select select
@row_num := @row_num + 1 AS rowNumber, phone,
t.* money,
from (SELECT @row_num := 0) r, weight,
( add_time as addTime,
select invalid,
a.phone, start_weight as startWeight,
a.money, end_weight as endWeight,
a.weight, updated_at as updatedAt,
a.add_time as addTime, deduct_money as deductMoney
a.invalid, from bl_order_info
a.start_weight as startWeight, where phone = #{phone}
a.end_weight as endWeight, order by add_time desc
a.updated_at as updatedAt,
a.deduct_money as deductMoney,
b.name as housingestateName,
c.content,
a.cause
from bl_order_info a
inner join bl_housingestate_info b on a.housingestate_id = b.housingestate_id
inner join bl_device_info c on a.imei = c.imei
where a.phone = #{phone}
<if test="beginTime != null and beginTime !=''">
and a.add_time >= #{beginTime}
</if>
<if test="endTime != null and endTime !=''">
and a.add_time &lt;= #{endTime}
</if>
<if test="invalid != null and invalid !=''">
and a.invalid = #{invalid}
</if>
<if test="housingestateId!=null and housingestateId!=''">
and a.housingestate_id = #{housingestateId}
</if>
) t
order by t.addTime desc
</select> </select>
</mapper> </mapper>

View File

@ -1,7 +1,5 @@
package org.jeecg.modules.zh.view.hy.service; package org.jeecg.modules.zh.view.hy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.zh.view.hy.entity.Hy; import org.jeecg.modules.zh.view.hy.entity.Hy;
import java.util.List; import java.util.List;
@ -15,7 +13,7 @@ public interface IHyService extends IService<Hy> {
List<Hy> queryHousingestateList(); List<Hy> queryHousingestateList();
List<Hy> queryHyRegisterList(Hy hy); List<Hy> queryHyRegisterList(Hy hy);
List<Hy> queryHyXzList(Hy hy); List<Hy> queryHyXzList(Hy hy);
IPage<Hy> queryHyTdcsList(Page<Hy> page, Hy hy); List<Hy> queryHyTdcsList(Hy hy);
List<Hy> queryHyTdzlList(Hy hy); List<Hy> queryHyTdzlList(Hy hy);
List<Hy> queryHyWgList(Hy hy); List<Hy> queryHyWgList(Hy hy);

View File

@ -1,7 +1,5 @@
package org.jeecg.modules.zh.view.hy.service.impl; package org.jeecg.modules.zh.view.hy.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.system.entity.SysDataLog; import org.jeecg.modules.system.entity.SysDataLog;
import org.jeecg.modules.zh.view.hy.entity.Hy; import org.jeecg.modules.zh.view.hy.entity.Hy;
@ -46,8 +44,8 @@ public class HyServiceImpl extends ServiceImpl<HyMapper, Hy> implements IHyServi
* 会员投递次数排行榜 * 会员投递次数排行榜
*/ */
@Override @Override
public IPage<Hy> queryHyTdcsList(Page<Hy> page, Hy hy) { public List<Hy> queryHyTdcsList(Hy hy) {
return baseMapper.queryHyTdcsList(page,hy); return baseMapper.queryHyTdcsList(hy);
} }
/** /**