灌溉记录总计和充值记录总计接口添加角色隔离
This commit is contained in:
parent
bc0d1f97dd
commit
1116dda1b7
@ -16,6 +16,13 @@ import com.fastbee.iot.domain.dto.NgFlowDeviceDataDto;
|
||||
*/
|
||||
public interface INgFlowDeviceDataService extends IService<NgFlowDeviceData>
|
||||
{
|
||||
/**
|
||||
* 流量计瞬时流量和累计流量图表
|
||||
* @param deviceNumber
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public Map<String,Object> selectNgFlowDeviceDataFlowCharts(String deviceNumber, Date startTime, Date endTime);
|
||||
|
||||
/**
|
||||
|
@ -51,6 +51,10 @@ public class NgUserRechargeRecordsServiceImpl implements INgUserRechargeRecordsS
|
||||
}
|
||||
// 统计amount字段的总和
|
||||
QueryWrapper<NgUserRechargeRecords> sumQueryWrapper = new QueryWrapper<>();
|
||||
if(ngUserRechargeRecordsDto.getDeptId()!=null)
|
||||
{
|
||||
sumQueryWrapper.eq("dept_id",ngUserRechargeRecordsDto.getDeptId());
|
||||
}
|
||||
sumQueryWrapper.select("SUM(amount) as sumAmount");
|
||||
if (ngUserRechargeRecordsDto.getStartTime() != null && ngUserRechargeRecordsDto.getEndTime() != null) {
|
||||
sumQueryWrapper.between("recharge_time", ngUserRechargeRecordsDto.getStartTime(), ngUserRechargeRecordsDto.getEndTime());
|
||||
@ -65,6 +69,10 @@ public class NgUserRechargeRecordsServiceImpl implements INgUserRechargeRecordsS
|
||||
|
||||
// 对cardNumber字段进行去重并统计总和
|
||||
QueryWrapper<NgUserRechargeRecords> distinctQueryWrapper = new QueryWrapper<>();
|
||||
if(ngUserRechargeRecordsDto.getDeptId()!=null)
|
||||
{
|
||||
distinctQueryWrapper.eq("dept_id",ngUserRechargeRecordsDto.getDeptId());
|
||||
}
|
||||
distinctQueryWrapper.select("COUNT(DISTINCT card_number) as distinctCount");
|
||||
if (ngUserRechargeRecordsDto.getStartTime() != null && ngUserRechargeRecordsDto.getEndTime() != null) {
|
||||
distinctQueryWrapper.between("recharge_time", ngUserRechargeRecordsDto.getStartTime(), ngUserRechargeRecordsDto.getEndTime());
|
||||
|
@ -58,6 +58,10 @@ public class NgWaterPumpUsageRecordsServiceImpl implements INgWaterPumpUsageReco
|
||||
queryWrapper.between("real_time", start, end);
|
||||
queryWrapper.eq("device_number",deviceNumber);
|
||||
List<NgWaterPumpUsageRecords> list=ngWaterPumpUsageRecordsMapper.selectList(queryWrapper);//获取根据时间和设备编码筛选后的数据
|
||||
if(list.size()==0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
while(start.compareTo(end) <=0 )//start<=end
|
||||
{
|
||||
|
@ -56,6 +56,10 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
|
||||
}
|
||||
// 统计cur_flow字段的总和
|
||||
QueryWrapper<UserIrrigationRecord> sumQueryWrapper = new QueryWrapper<>();
|
||||
if(userIrrigationRecordListDto.getDeptId()!=null)
|
||||
{
|
||||
sumQueryWrapper.eq("dept_id",userIrrigationRecordListDto.getDeptId());
|
||||
}
|
||||
sumQueryWrapper.select("SUM(cur_flow) as sumFlow");
|
||||
if (userIrrigationRecordListDto.getSearchStartTime() != null && userIrrigationRecordListDto.getSearchEndTime() != null) {
|
||||
sumQueryWrapper.between("end_time", userIrrigationRecordListDto.getSearchStartTime(), userIrrigationRecordListDto.getSearchEndTime());
|
||||
@ -70,6 +74,10 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
|
||||
|
||||
// 对cardNumber字段进行去重并统计总和
|
||||
QueryWrapper<UserIrrigationRecord> distinctQueryWrapper = new QueryWrapper<>();
|
||||
if(userIrrigationRecordListDto.getDeptId()!=null)
|
||||
{
|
||||
distinctQueryWrapper.eq("dept_id",userIrrigationRecordListDto.getDeptId());
|
||||
}
|
||||
distinctQueryWrapper.select("COUNT(DISTINCT card_number) as distinctCount");
|
||||
if (userIrrigationRecordListDto.getSearchStartTime() != null && userIrrigationRecordListDto.getSearchEndTime() != null) {
|
||||
distinctQueryWrapper.between("end_time", userIrrigationRecordListDto.getSearchStartTime(), userIrrigationRecordListDto.getSearchEndTime());
|
||||
|
Loading…
x
Reference in New Issue
Block a user