Commit ab35117a authored by lisong's avatar lisong

添加物联报表列表分页查询接口

parent 78256529
......@@ -4,8 +4,11 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -87,4 +90,20 @@ public class AnalysisReportLogController extends AbstractBaseController {
return reportResponse;
}
@GetMapping(value = "/iotReportPage")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询")
public IPage<AnalysisReportLogDto> iotReportPage(Page page, @RequestParam Integer reportType,
@ApiParam(value = "开始日期", required = false) @RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd")Date startDate,
@ApiParam(value = "结束日期", required = false) @RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd")Date endDate,
@ApiParam(value = "换流站编码", required = false) @RequestParam(required = false) String stationCode) {
AnalysisReportLogDto dto = new AnalysisReportLogDto();
dto.setStartDate(startDate);
dto.setEndDate(endDate);
dto.setReportType(reportType);
dto.setStationCode(stationCode);
return iAnalysisReportLogService.iotReportPage(page, dto);
}
}
......@@ -30,4 +30,6 @@ public interface AnalysisReportLogMapper extends BaseMapper<AnalysisReportLog> {
List<Map<String, Object>> getDefect(@Param("analysisReportLog")AnalysisReportLogDto analysisReportLog);
Map<String, Object> getRootOrgUsr();
IPage<AnalysisReportLogDto> iotReportPage(Page page, @Param("analysisReportLog")AnalysisReportLogDto analysisReportLog);
}
......@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.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.yeejoin.equipmanage.common.dto.AnalysisReportLogDto;
import com.yeejoin.equipmanage.common.entity.AnalysisReportLog;
import com.yeejoin.equipmanage.common.enums.AnalysisReportEnum;
......@@ -35,4 +36,13 @@ public interface IAnalysisReportLogService extends IService<AnalysisReportLog> {
* @param endDate 结束日期
*/
void generateMonthReport(AnalysisReportEnum monthReport, Date beginDate, Date endDate) throws ParseException;
/**
* 消防物联报表列表分页查询
* @param page
* @param dto
* @return
*/
IPage<AnalysisReportLogDto> iotReportPage (Page page, AnalysisReportLogDto dto);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.yeejoin.equipmanage.common.dto.AnalysisReportLogDto;
import com.yeejoin.equipmanage.common.entity.AnalysisReportLog;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
......@@ -39,6 +40,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
@Autowired
AnalysisReportSummaryMapper analysisReportSummaryMapper;
@Autowired
AnalysisReportLogMapper analysisReportLogMapper;
@Override
public IPage<AnalysisReportLog> listPage(Page page, AnalysisReportLog analysisReportLog) {
......@@ -127,4 +130,9 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
}
return desc.toString();
}
@Override
public IPage<AnalysisReportLogDto> iotReportPage(Page page, AnalysisReportLogDto dto) {
return analysisReportLogMapper.iotReportPage(page, dto);
}
}
......@@ -98,4 +98,35 @@
</where>
LIMIT 1
</select>
<select id="iotReportPage" resultType="com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto">
SELECT
*,
cb_org_usr.biz_org_code AS stationCode,
'消防物联报表' AS reportName,
cb_org_usr.biz_org_name AS stationName,
(CASE wl_analysis_report_log.report_type
WHEN 0 THEN '日报表'
WHEN 1 THEN '周报表'
ELSE '月报表'
END) reportTypeName
FROM
wl_analysis_report_log,cb_org_usr
<where>
cb_org_usr.biz_org_type = 'COMPANY' AND cb_org_usr.is_delete = 0 AND LENGTH(cb_org_usr.biz_org_code)>12
<if test="analysisReportLog.reportType != null">
AND wl_analysis_report_log.report_type = #{analysisReportLog.reportType}
</if>
<if test="analysisReportLog.startDate != null">
AND DATE_FORMAT(wl_analysis_report_log.start_date, '%Y-%m-%d') &gt;= DATE_FORMAT(#{analysisReportLog.startDate}, '%Y-%m-%d')
</if>
<if test="analysisReportLog.endDate != null">
AND DATE_FORMAT(wl_analysis_report_log.end_date, '%Y-%m-%d') &lt;= DATE_FORMAT(#{analysisReportLog.endDate}, '%Y-%m-%d')
</if>
<if test="analysisReportLog.stationCode != null">
AND cb_org_usr.biz_org_code like concat(#{analysisReportLog.stationCode},'%')
</if>
</where>
ORDER BY
report_date_desc DESC
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment