feat: 终端能力统计、设备型号及软硬件版本统计

master
李小林 7 months ago
parent a101719d3d
commit 335b88b42f
  1. 7
      src/main/java/com/bellmann/controller/DeviceTypeVerController.java
  2. 49
      src/main/java/com/bellmann/controller/ReportController.java
  3. 2
      src/main/java/com/bellmann/mapper/DeviceTypeVerMapper.java
  4. 13
      src/main/java/com/bellmann/mapper/ViewDeviceTotalMapper.java
  5. 36
      src/main/java/com/bellmann/model/query/DeviceTypeHardSoftReportQuery.java
  6. 24
      src/main/java/com/bellmann/model/vo/DeviceTypeHardSoftVerExportVO.java
  7. 23
      src/main/java/com/bellmann/model/vo/DeviceTypeHardSoftVerVO.java
  8. 24
      src/main/java/com/bellmann/model/vo/TerminalCapabilityStatisticsVO.java
  9. 26
      src/main/java/com/bellmann/model/vo/TerminalExportVO.java
  10. 3
      src/main/java/com/bellmann/service/DeviceTypeVerService.java
  11. 12
      src/main/java/com/bellmann/service/ReportService.java
  12. 13
      src/main/java/com/bellmann/service/impl/DeviceTypeVerServiceImpl.java
  13. 62
      src/main/java/com/bellmann/service/impl/ReportServiceImpl.java
  14. 2
      src/main/resources/mapper/DeviceTypeMapper.xml
  15. 5
      src/main/resources/mapper/DeviceTypeVerMapper.xml
  16. 246
      src/main/resources/mapper/ViewDeviceTotalMapper.xml

@ -2,6 +2,7 @@ package com.bellmann.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.common.base.BasePageQuery;
import com.bellmann.common.model.Option;
import com.bellmann.common.result.PageResult;
import com.bellmann.common.result.Result;
import com.bellmann.model.form.BindingTr069Form;
@ -150,4 +151,10 @@ public class DeviceTypeVerController {
List<SoftVersionUpgradeVO> list = deviceTypeVerService.upgradeSoftVerTable(devId);
return Result.success(list);
}
@GetMapping("/soft-ver-option")
@Operation(summary = "查找设备软件版本选择框")
public Result<List<Option<String>>> softVerOption(){
List<Option<String>> list = deviceTypeVerService.softVerOption();
return Result.success(list);
}
}

@ -3,9 +3,11 @@ package com.bellmann.controller;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.common.result.PageResult;
import com.bellmann.common.result.Result;
import com.bellmann.model.query.DeviceTypeHardSoftReportQuery;
import com.bellmann.model.query.ReportBasicQuery;
import com.bellmann.model.vo.DetailExportVO;
import com.bellmann.model.vo.DetailInventoryStatisticsVO;
import com.bellmann.model.vo.*;
import com.bellmann.plugin.dupsubmit.annotation.PreventDuplicateSubmit;
import com.bellmann.service.ReportService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -26,7 +28,8 @@ public class ReportController {
private final ReportService reportService;
@PostMapping("/detail-inventory-statistics")
@Operation(summary = "运行报表")
@Operation(summary = "详细清单统计")
@PreventDuplicateSubmit
public PageResult<DetailInventoryStatisticsVO> detailPage(@RequestBody ReportBasicQuery query){
Page<DetailInventoryStatisticsVO> page = reportService.detailPage(query);
return PageResult.success(page);
@ -34,6 +37,7 @@ public class ReportController {
@Operation(summary = "导出详细清单统计报表")
@GetMapping("/_export")
@PreventDuplicateSubmit
public void exportDetail(ReportBasicQuery queryParams, HttpServletResponse response) throws IOException {
String fileName = "详细清单统计报表.xlsx";
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
@ -42,6 +46,45 @@ public class ReportController {
List<DetailExportVO> exportUserList = reportService.listExportDetail(queryParams);
EasyExcel.write(response.getOutputStream(), DetailExportVO.class).sheet("详细清单统计报表")
.doWrite(exportUserList);
}
@PostMapping("/terminal-capability-statistics")
@Operation(summary = "终端能力统计")
@PreventDuplicateSubmit
public Result<List<TerminalCapabilityStatisticsVO>> terminalStatistics(@RequestBody ReportBasicQuery query){
List<TerminalCapabilityStatisticsVO> list = reportService.terminalStatistics(query);
return Result.success(list);
}
@Operation(summary = "导出终端能力统计报表")
@GetMapping("/_export/terminal")
@PreventDuplicateSubmit
public void exportTerminal(ReportBasicQuery queryParams, HttpServletResponse response) throws IOException {
String fileName = "终端能力统计报表.xlsx";
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
List<TerminalExportVO> list = reportService.listExportTerminal(queryParams);
EasyExcel.write(response.getOutputStream(), TerminalExportVO.class).sheet("终端能力统计报表")
.doWrite(list);
}
@PostMapping("/device-type-soft")
@Operation(summary = "设备型号及软硬件版本统计")
@PreventDuplicateSubmit
public Result<List<DeviceTypeHardSoftVerVO>> devTypeSoftVerStatistics(@RequestBody DeviceTypeHardSoftReportQuery query){
List<DeviceTypeHardSoftVerVO> list = reportService.devTypeSoftVerStatistics(query);
return Result.success(list);
}
@GetMapping("/_export/device-type-soft-ver")
@PreventDuplicateSubmit
public void exportDeviceTypeHardSoftVer(DeviceTypeHardSoftReportQuery queryParams, HttpServletResponse response) throws IOException {
String fileName = "设备类型及软硬件版本统计报表.xlsx";
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
List<DeviceTypeHardSoftVerExportVO> list = reportService.listExportDeviceTypeHardSoftVer(queryParams);
EasyExcel.write(response.getOutputStream(), DeviceTypeHardSoftVerExportVO.class).sheet("设备类型及软硬件版本统计报表")
.doWrite(list);
}
}

@ -33,4 +33,6 @@ public interface DeviceTypeVerMapper extends BaseMapper<DeviceTypeVer> {
Long getTypeAndVerId();
List<SoftVersionUpgradeVO> upgradeSoftVerTable(@Param("devId") Long devId);
List<String> softVerOption();
}

@ -3,13 +3,24 @@ package com.bellmann.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.model.entity.ViewDeviceTotal;
import com.bellmann.model.query.DeviceTypeHardSoftReportQuery;
import com.bellmann.model.query.ReportBasicQuery;
import com.bellmann.model.vo.DetailInventoryStatisticsVO;
import com.bellmann.model.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ViewDeviceTotalMapper extends BaseMapper<ViewDeviceTotal> {
Page<DetailInventoryStatisticsVO> detailInventoryStatisticsPage(Page<DetailInventoryStatisticsVO> page, @Param("form") ReportBasicQuery query);
List<TerminalCapabilityStatisticsVO> terminalStatistics(@Param("form") ReportBasicQuery query);
List<TerminalExportVO> listExportTerminal(@Param("form") ReportBasicQuery queryParams);
List<DeviceTypeHardSoftVerVO> devTypeSoftVerStatistics(@Param("form")DeviceTypeHardSoftReportQuery query);
List<DeviceTypeHardSoftVerExportVO> listExportDeviceTypeHardSoftVer(@Param("form")DeviceTypeHardSoftReportQuery queryParams);
}

@ -0,0 +1,36 @@
package com.bellmann.model.query;
import com.bellmann.common.base.BasePageQuery;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class DeviceTypeHardSoftReportQuery extends BasePageQuery {
private Long area;
private Long subarea;
private String category;
private String devName;
private String devHardVer;
private String softVer;
private String gateWayType;
private String firstStartTime;
private String firstEndTime;
private String lastStartTime;
private String lastEndTime;
private String onLineStartTime;
private String onLineEndTime;
}

@ -0,0 +1,24 @@
package com.bellmann.model.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
@Data
@ColumnWidth(20)
public class DeviceTypeHardSoftVerExportVO {
@ExcelProperty(value = "分公司")
private String area;
@ExcelProperty(value = "分公司")
private String subArea;
@ExcelProperty(value = "厂商")
private String category;
@ExcelProperty(value = "设备型号")
private String deviceName;
@ExcelProperty(value = "硬件版本")
private String devHardVer;
@ExcelProperty(value = "软件版本")
private String softVer;
@ExcelProperty(value = "数量")
private Integer devCount;
}

@ -0,0 +1,23 @@
package com.bellmann.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "设备类型及软硬件版本统计")
public class DeviceTypeHardSoftVerVO {
private String area;
private String subArea;
private String category;
private String deviceName;
private String devHardVer;
private String softVer;
private Integer devCount;
}

@ -0,0 +1,24 @@
package com.bellmann.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "终端能力统计视图")
public class TerminalCapabilityStatisticsVO {
private String area;
private String subArea;
private String category;
private String deviceName;
private String accessType;
private String deviceType;
private String gateWayType;
private Integer devCount;
}

@ -0,0 +1,26 @@
package com.bellmann.model.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
@Data
@ColumnWidth(20)
public class TerminalExportVO {
@ExcelProperty(value = "分公司")
private String area;
@ExcelProperty(value = "分公司")
private String subArea;
@ExcelProperty(value = "厂商")
private String category;
@ExcelProperty(value = "设备型号")
private String deviceName;
@ExcelProperty(value = "设备网络测接口")
private String accessType;
@ExcelProperty(value = "设备类型")
private String deviceType;
@ExcelProperty(value = "网关类型")
private String gateWayType;
@ExcelProperty(value = "数量")
private Integer devCount;
}

@ -2,6 +2,7 @@ package com.bellmann.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.common.base.BasePageQuery;
import com.bellmann.common.model.Option;
import com.bellmann.common.result.Result;
import com.bellmann.model.form.BindingTr069Form;
import com.bellmann.model.form.DeviceTypeVerForm;
@ -50,4 +51,6 @@ public interface DeviceTypeVerService {
Result<String> tr069BindingDevType(BindingTr069Form form);
List<SoftVersionUpgradeVO> upgradeSoftVerTable(Long devId);
List<Option<String>> softVerOption();
}

@ -1,9 +1,9 @@
package com.bellmann.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.model.query.DeviceTypeHardSoftReportQuery;
import com.bellmann.model.query.ReportBasicQuery;
import com.bellmann.model.vo.DetailExportVO;
import com.bellmann.model.vo.DetailInventoryStatisticsVO;
import com.bellmann.model.vo.*;
import java.util.List;
@ -11,4 +11,12 @@ public interface ReportService {
Page<DetailInventoryStatisticsVO> detailPage(ReportBasicQuery query);
List<DetailExportVO> listExportDetail(ReportBasicQuery queryParams);
List<TerminalCapabilityStatisticsVO> terminalStatistics(ReportBasicQuery query);
List<TerminalExportVO> listExportTerminal(ReportBasicQuery queryParams);
List<DeviceTypeHardSoftVerVO> devTypeSoftVerStatistics(DeviceTypeHardSoftReportQuery query);
List<DeviceTypeHardSoftVerExportVO> listExportDeviceTypeHardSoftVer(DeviceTypeHardSoftReportQuery queryParams);
}

@ -8,6 +8,7 @@ import com.bellmann.common.constant.StringUtilsConstants;
import com.bellmann.common.enums.DevTypeVerStatusEnum;
import com.bellmann.common.enums.ProvisionFlagEnum;
import com.bellmann.common.exception.BusinessException;
import com.bellmann.common.model.Option;
import com.bellmann.common.result.Result;
import com.bellmann.common.result.ResultCode;
import com.bellmann.converter.DeviceTypeVerConverter;
@ -381,4 +382,16 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService {
return deviceTypeVerMapper.upgradeSoftVerTable(devId);
}
@Override
public List<Option<String>> softVerOption() {
List<String> list = deviceTypeVerMapper.softVerOption();
return list.stream().map(str -> {
Option<String> option = new Option<>();
option.setLabel(str);
option.setValue(str);
return option;
}).collect(Collectors.toList());
}
}

@ -1,13 +1,16 @@
package com.bellmann.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bellmann.common.base.IBaseEnum;
import com.bellmann.common.enums.DevAccessTypeEnum;
import com.bellmann.common.enums.EquipmentTypeEnum;
import com.bellmann.converter.DeviceStaticConverter;
import com.bellmann.manger.ServiceManager;
import com.bellmann.mapper.DeviceStaticMapper;
import com.bellmann.mapper.ViewDeviceTotalMapper;
import com.bellmann.model.query.DeviceTypeHardSoftReportQuery;
import com.bellmann.model.query.ReportBasicQuery;
import com.bellmann.model.vo.DetailExportVO;
import com.bellmann.model.vo.DetailInventoryStatisticsVO;
import com.bellmann.model.vo.*;
import com.bellmann.service.ReportService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@ -37,6 +40,42 @@ public class ReportServiceImpl implements ReportService {
return voPage;
}
@Override
public List<TerminalCapabilityStatisticsVO> terminalStatistics(ReportBasicQuery query) {
List<TerminalCapabilityStatisticsVO> list = viewDeviceTotalMapper.terminalStatistics(query);
Integer total = 0;
list.forEach(obj->{
if (obj.getAccessType()!=null) {
obj.setAccessType(IBaseEnum.getLabelByValue(obj.getAccessType(), DevAccessTypeEnum.class));
}
if (obj.getDeviceType()!=null){
obj.setDeviceType(IBaseEnum.getLabelByValue(obj.getDeviceType(), EquipmentTypeEnum.class));
}
});
for (TerminalCapabilityStatisticsVO data : list){
total += data.getDevCount();
}
TerminalCapabilityStatisticsVO count = new TerminalCapabilityStatisticsVO();
count.setDevCount(total);
count.setArea("总计");
list.add(0,count);
return list;
}
@Override
public List<DeviceTypeHardSoftVerVO> devTypeSoftVerStatistics(DeviceTypeHardSoftReportQuery query) {
List<DeviceTypeHardSoftVerVO> list = viewDeviceTotalMapper.devTypeSoftVerStatistics(query);
Integer total = 0;
for (DeviceTypeHardSoftVerVO data : list){
total += data.getDevCount();
}
DeviceTypeHardSoftVerVO count = new DeviceTypeHardSoftVerVO();
count.setDevCount(total);
count.setArea("总计");
list.add(0,count);
return list;
}
@Override
public List<DetailExportVO> listExportDetail(ReportBasicQuery queryParams) {
int pageNum = queryParams.getPageNum();
@ -49,4 +88,23 @@ public class ReportServiceImpl implements ReportService {
return deviceStaticConverter.detailVO2ExportVO(records);
}
@Override
public List<TerminalExportVO> listExportTerminal(ReportBasicQuery queryParams) {
List<TerminalExportVO> list = viewDeviceTotalMapper.listExportTerminal(queryParams);
list.forEach(obj->{
if (obj.getAccessType()!=null) {
obj.setAccessType(IBaseEnum.getLabelByValue(obj.getAccessType(), DevAccessTypeEnum.class));
}
if (obj.getDeviceType()!=null){
obj.setDeviceType(IBaseEnum.getLabelByValue(obj.getDeviceType(), EquipmentTypeEnum.class));
}
});
return list;
}
@Override
public List<DeviceTypeHardSoftVerExportVO> listExportDeviceTypeHardSoftVer(DeviceTypeHardSoftReportQuery queryParams) {
return viewDeviceTotalMapper.listExportDeviceTypeHardSoftVer(queryParams);
}
}

@ -40,7 +40,7 @@
<select id="vendorNameOption" resultType="com.bellmann.model.entity.DeviceType">
SELECT DISTINCT(dev_vendor_name) FROM itms_device_type where dev_vendor_name is not null order by dev_vendor_name ASC
</select>
<select id="hardVerOption">
<select id="hardVerOption" resultType="com.bellmann.model.entity.DeviceType">
SELECT DISTINCT
( dev_hard_ver )
FROM

@ -137,4 +137,9 @@
WHERE
aa.dev_id = #{devId}
</select>
<select id="softVerOption" resultType="java.lang.String">
SELECT DISTINCT (soft_ver)
FROM itms_device_type_ver
order by soft_ver
</select>
</mapper>

@ -66,4 +66,250 @@
</where>
</select>
<select id="terminalStatistics" resultType="com.bellmann.model.vo.TerminalCapabilityStatisticsVO">
SELECT
t2.groupname AS area,
t1.groupname AS subArea,
t1.dev_vendor_name AS category,
t1.dev_type_name AS deviceName,
CASE
t1.dev_type_name_new
WHEN 'ITMS' THEN
'家庭'
WHEN 'BBMS' THEN
'政企' ELSE'其他'
END AS gateWayType,
t1.dev_type_namea AS deviceType,
t1.dev_access_type AS accessType,
count(*) devCount
FROM
V_ZJ_DEVICE_TOTAL t1
LEFT JOIN GROUP_INFO_TAB t2 ON t1.parentgroupid = t2.groupid
<where>
<if test="form.area !=0 and form.area!=null">
and t1.PARENTGROUPID = #{form.area}
</if>
<if test="form.subarea !=null ">
and t1.groupid = #{form.subarea}
</if>
<if test="form.category!=null and form.category!= '' and form.category!= '-1' ">
and UPPER(t1.DEV_VENDOR_NAME) = UPPER(#{form.category})
</if>
<if test="form.devName!=null and form.devName!='' and form.devName!='-1' ">
and t1.DEV_TYPE_NAME = #{form.devName}
</if>
<if test="form.accessType!=null and form.accessType!=''">
and t1.DEV_ACCESS_TYPE = #{form.accessType}
</if>
<if test="form.devType!=null and form.devType!=''">
and t1.dev_type_namea = #{form.devType}
</if>
<if test="form.gateWayType!=null and form.gateWayType!=''">
and t1.dev_type_name_new = #{form.gateWayType}
</if>
<if test="form.firstStartTime!=null and form.firstEndTime!=null">
and t1.dev_create_time >= to_date(#{form.firstStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_create_time&lt;= to_date(#{form.firstEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="form.lastStartTime!=null and form.lastEndTime!=null ">
and t1.dev_modify_time >= to_date(#{form.lastStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_modify_time&lt;= to_date(#{form.lastEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="form.onLineStartTime!=null and form.onLineEndTime!=null">
and t1.dev_online_time >= to_date(#{form.onLineStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_online_time&lt;= to_date(#{form.onLineEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
</where>
GROUP BY
t2.groupname,
t1.groupname,
t1.dev_vendor_name,
t1.dev_type_name,
gateWayType,
t1.dev_type_namea,
t1.dev_access_type
ORDER BY
devCount Desc
</select>
<select id="listExportTerminal" resultType="com.bellmann.model.vo.TerminalExportVO">
SELECT
t2.groupname AS area,
t1.groupname AS subArea,
t1.dev_vendor_name AS category,
t1.dev_type_name AS deviceName,
CASE
t1.dev_type_name_new
WHEN 'ITMS' THEN
'家庭'
WHEN 'BBMS' THEN
'政企' ELSE'其他'
END AS gateWayType,
t1.dev_type_namea AS deviceType,
t1.dev_access_type AS accessType,
count(*) devCount
FROM
V_ZJ_DEVICE_TOTAL t1
LEFT JOIN GROUP_INFO_TAB t2 ON t1.parentgroupid = t2.groupid
<where>
<if test="form.area !=0 and form.area!=null">
and t1.PARENTGROUPID = #{form.area}
</if>
<if test="form.subarea !=null ">
and t1.groupid = #{form.subarea}
</if>
<if test="form.category!=null and form.category!= '' and form.category!= '-1' ">
and UPPER(t1.DEV_VENDOR_NAME) = UPPER(#{form.category})
</if>
<if test="form.devName!=null and form.devName!='' and form.devName!='-1' ">
and t1.DEV_TYPE_NAME = #{form.devName}
</if>
<if test="form.accessType!=null and form.accessType!=''">
and t1.DEV_ACCESS_TYPE = #{form.accessType}
</if>
<if test="form.devType!=null and form.devType!=''">
and t1.dev_type_namea = #{form.devType}
</if>
<if test="form.gateWayType!=null and form.gateWayType!=''">
and t1.dev_type_name_new = #{form.gateWayType}
</if>
<if test="form.firstStartTime!=null and form.firstEndTime!=null">
and t1.dev_create_time >= to_date(#{form.firstStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_create_time&lt;= to_date(#{form.firstEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="form.lastStartTime!=null and form.lastEndTime!=null ">
and t1.dev_modify_time >= to_date(#{form.lastStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_modify_time&lt;= to_date(#{form.lastEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="form.onLineStartTime!=null and form.onLineEndTime!=null">
and t1.dev_online_time >= to_date(#{form.onLineStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_online_time&lt;= to_date(#{form.onLineEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
</where>
GROUP BY
t2.groupname,
t1.groupname,
t1.dev_vendor_name,
t1.dev_type_name,
gateWayType,
t1.dev_type_namea,
t1.dev_access_type
ORDER BY
devCount Desc
</select>
<select id="devTypeSoftVerStatistics" resultType="com.bellmann.model.vo.DeviceTypeHardSoftVerVO">
SELECT
t2.groupname AS area,
t1.groupname AS subArea,
t1.dev_vendor_name AS category,
t1.dev_type_name AS deviceName,
t1.soft_ver,
t1.dev_hard_ver,
count(*) devCount
FROM
V_ZJ_DEVICE_TOTAL t1
LEFT JOIN GROUP_INFO_TAB t2 ON t1.parentgroupid = t2.groupid
<where>
<if test="form.area !=0 and form.area!=null">
and t1.PARENTGROUPID = #{form.area}
</if>
<if test="form.subarea !=null ">
and t1.groupid = #{form.subarea}
</if>
<if test="form.category!=null and form.category!= '' and form.category!= '-1' ">
and UPPER(t1.DEV_VENDOR_NAME) = UPPER(#{form.category})
</if>
<if test="form.devName!=null and form.devName!='' and form.devName!='-1' ">
and t1.DEV_TYPE_NAME = #{form.devName}
</if>
<if test="form.softVer!=null and form.softVer!='' and form.softVer!='-1'">
and t1.soft_ver = #{form.softVer}
</if>
<if test="form.devHardVer!=null and form.devHardVer!='' and form.devHardVer!='-1'">
and t1.dev_hand_ver = #{form.devHardVer}
</if>
<if test="form.gateWayType!=null and form.gateWayType!=''">
and t1.dev_type_name_new = #{form.gateWayType}
</if>
<if test="form.firstStartTime!=null and form.firstEndTime!=null">
and t1.dev_create_time >= to_date(#{form.firstStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_create_time&lt;= to_date(#{form.firstEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="form.lastStartTime!=null and form.lastEndTime!=null ">
and t1.dev_modify_time >= to_date(#{form.lastStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_modify_time&lt;= to_date(#{form.lastEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="form.onLineStartTime!=null and form.onLineEndTime!=null">
and t1.dev_online_time >= to_date(#{form.onLineStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_online_time&lt;= to_date(#{form.onLineEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
</where>
GROUP BY
t2.groupname,
t1.groupname,
t1.dev_vendor_name,
t1.dev_type_name,
t1.soft_ver,
t1.dev_hard_ver
ORDER BY
devCount Desc
</select>
<select id="listExportDeviceTypeHardSoftVer" resultType="com.bellmann.model.vo.DeviceTypeHardSoftVerExportVO">
SELECT
t2.groupname AS area,
t1.groupname AS subArea,
t1.dev_vendor_name AS category,
t1.dev_type_name AS deviceName,
t1.soft_ver,
t1.dev_hard_ver,
count(*) devCount
FROM
V_ZJ_DEVICE_TOTAL t1
LEFT JOIN GROUP_INFO_TAB t2 ON t1.parentgroupid = t2.groupid
<where>
<if test="form.area !=0 and form.area!=null">
and t1.PARENTGROUPID = #{form.area}
</if>
<if test="form.subarea !=null ">
and t1.groupid = #{form.subarea}
</if>
<if test="form.category!=null and form.category!= '' and form.category!= '-1' ">
and UPPER(t1.DEV_VENDOR_NAME) = UPPER(#{form.category})
</if>
<if test="form.devName!=null and form.devName!='' and form.devName!='-1' ">
and t1.DEV_TYPE_NAME = #{form.devName}
</if>
<if test="form.softVer!=null and form.softVer!='' and form.softVer!='-1'">
and t1.soft_ver = #{form.softVer}
</if>
<if test="form.devHardVer!=null and form.devHardVer!='' and form.devHardVer!='-1'">
and t1.dev_hand_ver = #{form.devHardVer}
</if>
<if test="form.gateWayType!=null and form.gateWayType!=''">
and t1.dev_type_name_new = #{form.gateWayType}
</if>
<if test="form.firstStartTime!=null and form.firstEndTime!=null">
and t1.dev_create_time >= to_date(#{form.firstStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_create_time&lt;= to_date(#{form.firstEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="form.lastStartTime!=null and form.lastEndTime!=null ">
and t1.dev_modify_time >= to_date(#{form.lastStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_modify_time&lt;= to_date(#{form.lastEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="form.onLineStartTime!=null and form.onLineEndTime!=null">
and t1.dev_online_time >= to_date(#{form.onLineStartTime}, 'yyyy-MM-dd HH24:mi:ss')
and t1.dev_online_time&lt;= to_date(#{form.onLineEndTime},'yyyy-MM-dd HH24:mi:ss')
</if>
</where>
GROUP BY
t2.groupname,
t1.groupname,
t1.dev_vendor_name,
t1.dev_type_name,
t1.soft_ver,
t1.dev_hard_ver
ORDER BY
devCount Desc
</select>
</mapper>

Loading…
Cancel
Save