1.旅游资源统计

2.物联设备统计
3.告警统计报表
4.事件统计报表
dev
862857010@qq.com 3 years ago
parent 6ffce0cd5b
commit 51111726c3
  1. 152
      cjy-project/src/main/java/com/cjy/enterpriseData/service/impl/EnterpriseDataCenterHotelGuestsServiceImpl.java
  2. 68
      cjy-project/src/main/java/com/cjy/operationdatareport/controller/OperationDataReportController.java
  3. 83
      cjy-project/src/main/java/com/cjy/operationdatareport/dto/AlarmStatisticsDTO.java
  4. 70
      cjy-project/src/main/java/com/cjy/operationdatareport/dto/EventStatisticsDTO.java
  5. 50
      cjy-project/src/main/java/com/cjy/operationdatareport/mapper/OperationDataReportMapper.java
  6. 47
      cjy-project/src/main/java/com/cjy/operationdatareport/service/OperationDataReportService.java
  7. 94
      cjy-project/src/main/java/com/cjy/operationdatareport/service/impl/OperationDataReportServiceImpl.java
  8. 67
      cjy-project/src/main/java/com/cjy/operationdatareport/vo/AlarmStatisticsVO.java
  9. 53
      cjy-project/src/main/java/com/cjy/operationdatareport/vo/EventStatisticsVO.java
  10. 37
      cjy-project/src/main/java/com/cjy/operationdatareport/vo/IotDeviceStatistics.java
  11. 170
      cjy-project/src/main/resources/mapper/operationdatareport/OperationDataReportMapper.xml
  12. 6
      cjy-project/src/main/resources/mapper/parking/ParkingTurnoverDataMapper.xml
  13. 2
      cjy-project/src/main/resources/mapper/ticketing/TicketingSalesFlowMapper.xml
  14. 2
      cjy-project/src/main/resources/mapper/ticketing/TicketingSellTouristsPortraitMapper.xml
  15. 2
      cjy-project/src/main/resources/mapper/ticketing/TicketingTicketCheckFlowMapper.xml
  16. 8
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java
  17. 12
      ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml

@ -12,96 +12,90 @@ import com.cjy.enterprisedata.service.IEnterpriseDataCenterHotelGuestsService;
/**
* 酒店客人信息Service业务层处理
*
*
* @author hehang
* @date 2023-03-03
*/
@Service
public class EnterpriseDataCenterHotelGuestsServiceImpl implements IEnterpriseDataCenterHotelGuestsService
{
@Autowired
private EnterpriseDataCenterHotelGuestsMapper enterpriseDataCenterHotelGuestsMapper;
public class EnterpriseDataCenterHotelGuestsServiceImpl implements IEnterpriseDataCenterHotelGuestsService {
@Autowired
private EnterpriseDataCenterHotelGuestsMapper enterpriseDataCenterHotelGuestsMapper;
@Autowired
private TicketingSellTouristsPortraitMapper ticketingSellTouristsPortraitMapper;
@Autowired
private TicketingSellTouristsPortraitMapper ticketingSellTouristsPortraitMapper;
/**
* 查询酒店客人信息
*
* @param id 酒店客人信息主键
* @return 酒店客人信息
*/
@Override
public EnterpriseDataCenterHotelGuests selectEnterpriseDataCenterHotelGuestsById(Long id)
{
return enterpriseDataCenterHotelGuestsMapper.selectEnterpriseDataCenterHotelGuestsById(id);
}
/**
* 查询酒店客人信息
*
* @param id 酒店客人信息主键
* @return 酒店客人信息
*/
@Override
public EnterpriseDataCenterHotelGuests selectEnterpriseDataCenterHotelGuestsById(Long id) {
return enterpriseDataCenterHotelGuestsMapper.selectEnterpriseDataCenterHotelGuestsById(id);
}
/**
* 查询酒店客人信息列表
*
* @param enterpriseDataCenterHotelGuests 酒店客人信息
* @return 酒店客人信息
*/
@Override
public List<EnterpriseDataCenterHotelGuests> selectEnterpriseDataCenterHotelGuestsList(EnterpriseDataCenterHotelGuests enterpriseDataCenterHotelGuests)
{
List<EnterpriseDataCenterHotelGuests> list =enterpriseDataCenterHotelGuestsMapper.selectEnterpriseDataCenterHotelGuestsList(enterpriseDataCenterHotelGuests);
list.stream().forEach(e -> {
/**
* 查询酒店客人信息列表
*
* @param enterpriseDataCenterHotelGuests 酒店客人信息
* @return 酒店客人信息
*/
@Override
public List<EnterpriseDataCenterHotelGuests> selectEnterpriseDataCenterHotelGuestsList(EnterpriseDataCenterHotelGuests enterpriseDataCenterHotelGuests) {
List<EnterpriseDataCenterHotelGuests> list = enterpriseDataCenterHotelGuestsMapper.selectEnterpriseDataCenterHotelGuestsList(enterpriseDataCenterHotelGuests);
list.stream().forEach(e -> {
e.setDocumentsNumber( e.getDocumentsNumber().substring(0, 7) + "****" + e.getDocumentsNumber().substring(11, e.getDocumentsNumber().length()));
e.setCity(ticketingSellTouristsPortraitMapper.getRegionName(e.getCity()));
e.setProvince(ticketingSellTouristsPortraitMapper.getRegionName(e.getProvince()));
});
e.setProvince(ticketingSellTouristsPortraitMapper.getRegionName(e.getProvince()));
});
return list;
}
return list;
}
/**
* 新增酒店客人信息
*
* @param enterpriseDataCenterHotelGuests 酒店客人信息
* @return 结果
*/
@Override
public int insertEnterpriseDataCenterHotelGuests(EnterpriseDataCenterHotelGuests enterpriseDataCenterHotelGuests)
{
enterpriseDataCenterHotelGuests.setCreateTime(DateUtils.getNowDate());
return enterpriseDataCenterHotelGuestsMapper.insertEnterpriseDataCenterHotelGuests(enterpriseDataCenterHotelGuests);
}
/**
* 新增酒店客人信息
*
* @param enterpriseDataCenterHotelGuests 酒店客人信息
* @return 结果
*/
@Override
public int insertEnterpriseDataCenterHotelGuests(EnterpriseDataCenterHotelGuests enterpriseDataCenterHotelGuests) {
enterpriseDataCenterHotelGuests.setCreateTime(DateUtils.getNowDate());
return enterpriseDataCenterHotelGuestsMapper.insertEnterpriseDataCenterHotelGuests(enterpriseDataCenterHotelGuests);
}
/**
* 修改酒店客人信息
*
* @param enterpriseDataCenterHotelGuests 酒店客人信息
* @return 结果
*/
@Override
public int updateEnterpriseDataCenterHotelGuests(EnterpriseDataCenterHotelGuests enterpriseDataCenterHotelGuests)
{
enterpriseDataCenterHotelGuests.setUpdateTime(DateUtils.getNowDate());
return enterpriseDataCenterHotelGuestsMapper.updateEnterpriseDataCenterHotelGuests(enterpriseDataCenterHotelGuests);
}
/**
* 修改酒店客人信息
*
* @param enterpriseDataCenterHotelGuests 酒店客人信息
* @return 结果
*/
@Override
public int updateEnterpriseDataCenterHotelGuests(EnterpriseDataCenterHotelGuests enterpriseDataCenterHotelGuests) {
enterpriseDataCenterHotelGuests.setUpdateTime(DateUtils.getNowDate());
return enterpriseDataCenterHotelGuestsMapper.updateEnterpriseDataCenterHotelGuests(enterpriseDataCenterHotelGuests);
}
/**
* 批量删除酒店客人信息
*
* @param ids 需要删除的酒店客人信息主键
* @return 结果
*/
@Override
public int deleteEnterpriseDataCenterHotelGuestsByIds(Long[] ids)
{
return enterpriseDataCenterHotelGuestsMapper.deleteEnterpriseDataCenterHotelGuestsByIds(ids);
}
/**
* 批量删除酒店客人信息
*
* @param ids 需要删除的酒店客人信息主键
* @return 结果
*/
@Override
public int deleteEnterpriseDataCenterHotelGuestsByIds(Long[] ids) {
return enterpriseDataCenterHotelGuestsMapper.deleteEnterpriseDataCenterHotelGuestsByIds(ids);
}
/**
* 删除酒店客人信息信息
*
* @param id 酒店客人信息主键
* @return 结果
*/
@Override
public int deleteEnterpriseDataCenterHotelGuestsById(Long id)
{
return enterpriseDataCenterHotelGuestsMapper.deleteEnterpriseDataCenterHotelGuestsById(id);
}
/**
* 删除酒店客人信息信息
*
* @param id 酒店客人信息主键
* @return 结果
*/
@Override
public int deleteEnterpriseDataCenterHotelGuestsById(Long id) {
return enterpriseDataCenterHotelGuestsMapper.deleteEnterpriseDataCenterHotelGuestsById(id);
}
}

@ -0,0 +1,68 @@
package com.cjy.operationdatareport.controller;
import com.cjy.common.groups.DefaultGroup;
import com.cjy.operationdatareport.dto.AlarmStatisticsDTO;
import com.cjy.operationdatareport.dto.EventStatisticsDTO;
import com.cjy.operationdatareport.service.OperationDataReportService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @author liangjiawei
* @createDate 2023/3/20
*/
@RequestMapping("/operationDataReport")
@RestController
public class OperationDataReportController extends BaseController {
@Autowired
OperationDataReportService operationDataReportService;
/**
* 旅游资源统计
*
* @return
*/
@GetMapping("/getTravelResourcesStatistics")
public AjaxResult getTravelResourcesStatistics(@RequestParam("resourceGrouping") List<String> resourceGrouping, @RequestParam("dataType") List<String> dataType) {
Map<String, Object> map = operationDataReportService.getTravelResourcesStatistics(getUserOrganCode(), resourceGrouping, dataType);
return success(map);
}
/**
* 物联设备统计
*
* @return
*/
@GetMapping("/getIotDeviceStatistics")
public AjaxResult getIotDeviceStatistics(@RequestParam("deviceType") List<String> deviceType) {
return success(operationDataReportService.getIotDeviceStatistics(getUserOrganCode(), deviceType));
}
/**
* 告警统计报表
*
* @return
*/
@PostMapping("/getAlarmStatistics")
public AjaxResult getAlarmStatistics(@Validated({DefaultGroup.class}) @RequestBody AlarmStatisticsDTO alarmStatisticsDTO) {
alarmStatisticsDTO.setOrganCode(getUserOrganCode());
return success(operationDataReportService.getAlarmStatistics(alarmStatisticsDTO));
}
/**
* 事件统计报表
*
* @return
*/
@PostMapping("/getEventStatistics")
public AjaxResult getEventStatistics(@Validated({DefaultGroup.class}) @RequestBody EventStatisticsDTO eventStatisticsDTO) {
eventStatisticsDTO.setOrganCode(getUserOrganCode());
return success(operationDataReportService.getEventStatistics(eventStatisticsDTO));
}
}

@ -0,0 +1,83 @@
package com.cjy.operationdatareport.dto;
import com.cjy.common.groups.DefaultGroup;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* @author liangjiawei
* @createDate 2023/3/20
*/
public class AlarmStatisticsDTO {
//警源类型
private List<String> policeSourceType;
//警情分组
private List<String> policeGroup;
//警情类型
private List<String> policeType;
//告警状态
private List<String> alarmStatus;
@NotBlank(message = "开始时间不得为空", groups = {DefaultGroup.class })
private String startDate;
@NotBlank(message = "结束时间不得为空", groups = {DefaultGroup.class })
private String endDate;
private Long organCode;
public List<String> getPoliceSourceType() {
return policeSourceType;
}
public void setPoliceSourceType(List<String> policeSourceType) {
this.policeSourceType = policeSourceType;
}
public List<String> getPoliceGroup() {
return policeGroup;
}
public void setPoliceGroup(List<String> policeGroup) {
this.policeGroup = policeGroup;
}
public List<String> getPoliceType() {
return policeType;
}
public void setPoliceType(List<String> policeType) {
this.policeType = policeType;
}
public List<String> getAlarmStatus() {
return alarmStatus;
}
public void setAlarmStatus(List<String> alarmStatus) {
this.alarmStatus = alarmStatus;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public Long getOrganCode() {
return organCode;
}
public void setOrganCode(Long organCode) {
this.organCode = organCode;
}
}

@ -0,0 +1,70 @@
package com.cjy.operationdatareport.dto;
import com.cjy.common.groups.DefaultGroup;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* @author liangjiawei
* @createDate 2023/3/20
*/
public class EventStatisticsDTO {
private List<String> oneGradeTypeCode;
private List<String> towGradeTypeCode;
private List<String> eventLevel;
@NotBlank(message = "开始时间不得为空", groups = {DefaultGroup.class})
private String startDate;
@NotBlank(message = "结束时间不得为空", groups = {DefaultGroup.class})
private String endDate;
private Long organCode;
public List<String> getOneGradeTypeCode() {
return oneGradeTypeCode;
}
public void setOneGradeTypeCode(List<String> oneGradeTypeCode) {
this.oneGradeTypeCode = oneGradeTypeCode;
}
public List<String> getTowGradeTypeCode() {
return towGradeTypeCode;
}
public void setTowGradeTypeCode(List<String> towGradeTypeCode) {
this.towGradeTypeCode = towGradeTypeCode;
}
public List<String> getEventLevel() {
return eventLevel;
}
public void setEventLevel(List<String> eventLevel) {
this.eventLevel = eventLevel;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public Long getOrganCode() {
return organCode;
}
public void setOrganCode(Long organCode) {
this.organCode = organCode;
}
}

@ -0,0 +1,50 @@
package com.cjy.operationdatareport.mapper;
import com.cjy.operationdatareport.dto.AlarmStatisticsDTO;
import com.cjy.operationdatareport.dto.EventStatisticsDTO;
import com.cjy.operationdatareport.vo.AlarmStatisticsVO;
import com.cjy.operationdatareport.vo.EventStatisticsVO;
import com.cjy.operationdatareport.vo.IotDeviceStatistics;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author liangjiawei
* @createDate 2023/3/20
*/
public interface OperationDataReportMapper {
/**
* 物联设备统计
*
* @param organCode
* @return
*/
List<IotDeviceStatistics> getIotDeviceStatistics(@Param("organCode") Long organCode, @Param("list") List<String> deviceType);
/**
* 旅游资源统计
*
* @param organCode
* @param dictValue
* @param dataType
* @return
*/
List<Map<String, Object>> selectBasicResourceCount(@Param("organCode") Long organCode, @Param("dictValue") String dictValue, @Param("list") List<String> dataType);
/**
* 告警统计报表
*
* @param alarmStatisticsDTO
* @return
*/
List<AlarmStatisticsVO> getAlarmStatistics(AlarmStatisticsDTO alarmStatisticsDTO);
/**
* 事件统计报表
* @param eventStatisticsDTO
* @return
*/
List<EventStatisticsVO> getEventStatistics(EventStatisticsDTO eventStatisticsDTO);
}

@ -0,0 +1,47 @@
package com.cjy.operationdatareport.service;
import com.cjy.operationdatareport.dto.AlarmStatisticsDTO;
import com.cjy.operationdatareport.dto.EventStatisticsDTO;
import com.cjy.operationdatareport.vo.AlarmStatisticsVO;
import com.cjy.operationdatareport.vo.EventStatisticsVO;
import com.cjy.operationdatareport.vo.IotDeviceStatistics;
import java.util.List;
import java.util.Map;
/**
* @author liangjiawei
* @createDate 2023/3/20
*/
public interface OperationDataReportService {
/**
* 旅游资源统计
*
* @param organCode
* @return
*/
Map<String, Object> getTravelResourcesStatistics(Long organCode, List<String> resourceGrouping, List<String> dataType);
/**
* 物联设备统计
*
* @param organCode
* @return
*/
List<IotDeviceStatistics> getIotDeviceStatistics(Long organCode, List<String> deviceType);
/**
* 告警统计报表
*
* @param alarmStatisticsDTO
* @return
*/
List<AlarmStatisticsVO> getAlarmStatistics(AlarmStatisticsDTO alarmStatisticsDTO);
/**
* 事件统计报表
* @param eventStatisticsDTO
* @return
*/
List<EventStatisticsVO> getEventStatistics(EventStatisticsDTO eventStatisticsDTO);
}

@ -0,0 +1,94 @@
package com.cjy.operationdatareport.service.impl;
import com.cjy.operationdatareport.dto.AlarmStatisticsDTO;
import com.cjy.operationdatareport.dto.EventStatisticsDTO;
import com.cjy.operationdatareport.mapper.OperationDataReportMapper;
import com.cjy.operationdatareport.service.OperationDataReportService;
import com.cjy.operationdatareport.vo.AlarmStatisticsVO;
import com.cjy.operationdatareport.vo.EventStatisticsVO;
import com.cjy.operationdatareport.vo.IotDeviceStatistics;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.system.mapper.SysDictDataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author liangjiawei
* @createDate 2023/3/20
*/
@Service
public class OperationDataReportServiceImpl implements OperationDataReportService {
@Autowired
private SysDictDataMapper selectDictDataByType;
@Autowired
OperationDataReportMapper operationDataReportMapper;
/**
* 旅游资源统计
*
* @param organCode
* @return
*/
@Override
public Map<String, Object> getTravelResourcesStatistics(Long organCode, List<String> resourceGrouping, List<String> dataType) {
List<Map<String, Object>> list = new ArrayList<>();
List<SysDictData> dictDatas = new ArrayList<>();
if (resourceGrouping.isEmpty()) {
dictDatas = selectDictDataByType.selectDictDataByType("basic_resources_type");
} else {
dictDatas = selectDictDataByType.selectDictDataByTypeAndDictValue("basic_resources_type", resourceGrouping);
}
Map<String, Object> map = null;
for (SysDictData dictData : dictDatas) {
map = new HashMap<>();
String dictValue = dictData.getDictValue();
List<Map<String, Object>> countList = operationDataReportMapper.selectBasicResourceCount(organCode, dictValue, dataType);
map.put("name", dictData.getDictLabel());
map.put("child", countList);
list.add(map);
}
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("resultList", list);
return resultMap;
}
/**
* 物联设备统计
*
* @param organCode
* @return
*/
@Override
public List<IotDeviceStatistics> getIotDeviceStatistics(Long organCode, List<String> deviceType) {
return operationDataReportMapper.getIotDeviceStatistics(organCode, deviceType);
}
/**
* 告警统计报表
*
* @param alarmStatisticsDTO
* @return
*/
@Override
public List<AlarmStatisticsVO> getAlarmStatistics(AlarmStatisticsDTO alarmStatisticsDTO) {
return operationDataReportMapper.getAlarmStatistics(alarmStatisticsDTO);
}
/**
* 事件统计报表
*
* @param eventStatisticsDTO
* @return
*/
@Override
public List<EventStatisticsVO> getEventStatistics(EventStatisticsDTO eventStatisticsDTO) {
return operationDataReportMapper.getEventStatistics(eventStatisticsDTO);
}
}

@ -0,0 +1,67 @@
package com.cjy.operationdatareport.vo;
/**
* @author liangjiawei
* @createDate 2023/3/20
*/
public class AlarmStatisticsVO {
private String total;
//警情分类
private String alertTypeName;
//警情分组
private String policeGroupName;
//状态
private String status;
//警源类型
private String policeSourceTypeName;
//日期
private String date;
public String getTotal() {
return total;
}
public void setTotal(String total) {
this.total = total;
}
public String getAlertTypeName() {
return alertTypeName;
}
public void setAlertTypeName(String alertTypeName) {
this.alertTypeName = alertTypeName;
}
public String getPoliceGroupName() {
return policeGroupName;
}
public void setPoliceGroupName(String policeGroupName) {
this.policeGroupName = policeGroupName;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getPoliceSourceTypeName() {
return policeSourceTypeName;
}
public void setPoliceSourceTypeName(String policeSourceTypeName) {
this.policeSourceTypeName = policeSourceTypeName;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
}

@ -0,0 +1,53 @@
package com.cjy.operationdatareport.vo;
/**
* @author liangjiawei
* @createDate 2023/3/20
*/
public class EventStatisticsVO {
private String total;
private String towGradeTypeName;
private String oneGradeTypeName;
private String date;
private String eventLevel;
public String getTotal() {
return total;
}
public void setTotal(String total) {
this.total = total;
}
public String getTowGradeTypeName() {
return towGradeTypeName;
}
public void setTowGradeTypeName(String towGradeTypeName) {
this.towGradeTypeName = towGradeTypeName;
}
public String getOneGradeTypeName() {
return oneGradeTypeName;
}
public void setOneGradeTypeName(String oneGradeTypeName) {
this.oneGradeTypeName = oneGradeTypeName;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getEventLevel() {
return eventLevel;
}
public void setEventLevel(String eventLevel) {
this.eventLevel = eventLevel;
}
}

@ -0,0 +1,37 @@
package com.cjy.operationdatareport.vo;
/**
* @author liangjiawei
* @createDate 2023/3/20
*/
public class IotDeviceStatistics {
private String name;
//设备数量
private String equipmentNumber;
//故障数量
private String faultNumber;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEquipmentNumber() {
return equipmentNumber;
}
public void setEquipmentNumber(String equipmentNumber) {
this.equipmentNumber = equipmentNumber;
}
public String getFaultNumber() {
return faultNumber;
}
public void setFaultNumber(String faultNumber) {
this.faultNumber = faultNumber;
}
}

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cjy.operationdatareport.mapper.OperationDataReportMapper">
<select id="getIotDeviceStatistics" resultType="com.cjy.operationdatareport.vo.IotDeviceStatistics">
SELECT
t3.`name` as `name`,
t4.equipmentNumber,
t4.faultNumber
FROM
(
SELECT
t2.type,
count(*) equipmentNumber,
ifnull ( SUM( CASE WHEN t2.runStatus = 1 THEN 1 ELSE 0 END ), 0 ) faultNumber
FROM
(
SELECT
t1.resource_name AS `name`,
t1.type,
t1.run_status AS runStatus
FROM
b_iot_info t1
WHERE
del_flag != '2'
AND STATUS != '1' and t1.organ_code=#{organCode}
<if test="list.size()>0">
and t1.type in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY
t1.type,
runStatus,
`name`
) t2
GROUP BY
t2.type
ORDER BY
equipmentNumber DESC
) t4
LEFT JOIN ti_resource_type t3 ON t3.data_type = t4.type
</select>
<select id="selectBasicResourceCount" resultType="java.util.Map">
SELECT
t2.`name`,
t2.data_type,
t2.classify_icon,
IFNULL( t3.count, 0 ) count
FROM
ti_enterprise_resource_type t1
LEFT JOIN ti_resource_type t2 ON t1.resource_type_id = t2.id
<if test="dictValue == 'A01'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_tour_info GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
<if test="dictValue == 'A05'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_venue_info GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
<if test="dictValue == 'A10'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_public_service_info GROUP BY type ) t3 ON t3.type =
t2.data_type
</if>
<if test="dictValue == 'A15'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_iot_info GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
<if test="dictValue == 'A20'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_emergency_info GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
<if test="dictValue == 'A25'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_tourist_info GROUP BY type UNION ALL SELECT type, count( *
) count FROM b_vehicle_info GROUP BY type UNION ALL SELECT 'guide' as type, count( * ) count FROM
b_guide_info GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
WHERE
enterprise_id = #{organCode}
AND t2.dict_value = #{dictValue}
<if test="list.size()>0">
AND t2.data_type in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY
t2.sort ASC
</select>
<select id="getAlarmStatistics" resultType="com.cjy.operationdatareport.vo.AlarmStatisticsVO">
SELECT
count(*) total,
t2.`name` as alertTypeName,
t3.`name` as policeGroupName,
t4.dict_label as `status`,
t5.`name` as policeSourceTypeName,
DATE_FORMAT( t1.create_time, '%Y-%m-%d' ) as `date`
FROM
ec_alarm_info t1
INNER JOIN ec_classification_data_config t2 on t1.classification_data_code= t2.`code`
INNER JOIN ec_classification_config t3 on t2.classification_code=t3.`code` and t3.type='1'
INNER JOIN ec_classification_config t5 on t1.alarm_source=t5.`code` and t5.type='3'
INNER JOIN sys_dict_data t4 on t1.`status`=t4.dict_value and t4.dict_type='alarm_status'
WHERE 1=1
and t1.organ_code=#{organCode}
and ( DATE_FORMAT( t1.create_time, '%Y-%m-%d' ) between #{startDate} and #{endDate})
<if test="policeSourceType.size()>0">
and t1.alarm_source in
<foreach item="item" collection="policeSourceType" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="policeGroup.size()>0">
and t2.classification_code in
<foreach item="item" collection="policeGroup" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="policeType.size()>0">
and t1.classification_data_code in
<foreach item="item" collection="policeType" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="alarmStatus.size()>0">
and t1.status in
<foreach item="item" collection="alarmStatus" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY alertTypeName,policeGroupName,policeSourceTypeName,`status`,`date`
ORDER BY `date` desc
</select>
<select id="getEventStatistics" resultType="com.cjy.operationdatareport.vo.EventStatisticsVO">
SELECT
count(*) total,
t2.`name` as towGradeTypeName,
t3.`name` as oneGradeTypeName,
DATE_FORMAT(t1.create_time, '%Y-%m-%d' ) as `date`,
t4.dict_label as eventLevel
FROM
ec_alarm_info t1
INNER JOIN ec_classification_data_config t2 on t1.classification_event_code= t2.`code`
INNER JOIN ec_classification_config t3 on t2.classification_code=t3.`code` and t3.type='2'
LEFT JOIN sys_dict_data t4 on t1.event_grade_id=t4.dict_value and t4.dict_type='event_grade'
where 1=1
and t1.organ_code=#{organCode}
and ( DATE_FORMAT( t1.create_time, '%Y-%m-%d' ) between #{startDate} and #{endDate})
<if test="oneGradeTypeCode.size()>0">
and t2.classification_code in
<foreach item="item" collection="oneGradeTypeCode" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="towGradeTypeCode.size()>0">
and t1.classification_event_code in
<foreach item="item" collection="towGradeTypeCode" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="eventLevel.size()>0">
and t1.event_grade_id in
<foreach item="item" collection="eventLevel" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY towGradeTypeName,oneGradeTypeName,eventLevel,`date`
</select>
</mapper>

@ -131,8 +131,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN b_public_service_info p ON ptd.parking_lot_id = p.id
<where>
<if test="parkingLotId != null and parkingLotId != ''">and ptd.parking_lot_id = #{parkingLotId}</if>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' ">and ptd.travel_time
between #{startDate} and #{endDate}
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' ">
and DATE_FORMAT( ptd.travel_time, '%Y-%m-%d' ) between #{startDate} and #{endDate}
</if>
<if test="cutsceneType != null and cutsceneType != ''">and ptd.cutscene_type = #{cutsceneType}</if>
<if test="vehicleType != null and vehicleType != ''">and ptd.vehicle_type = #{vehicleType}</if>
@ -162,7 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="parkingLotId != null and parkingLotId != ''">and ptd.parking_lot_id = #{parkingLotId}</if>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' ">
and ptd.travel_time between #{startDate} and #{endDate}
and DATE_FORMAT( ptd.travel_time, '%Y-%m-%d' ) between #{startDate} and #{endDate}
</if>
and ptd.del_flag!=2
and ptd.cutscene_type='2'

@ -165,7 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ticketing_sales_flow sf
LEFT JOIN ticketing_manage_main_part_info mmpi ON sf.manage_main_part_id = mmpi.id
<where>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' "> and sf.sale_date between #{startDate} and #{endDate}</if>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' "> and DATE_FORMAT( sf.sale_date, '%Y-%m-%d' ) between #{startDate} and #{endDate}</if>
<if test="manageMainPartId != null "> and sf.manage_main_part_id = #{manageMainPartId}</if>
<if test="channelType != null "> and sf.channel_type = #{channelType}</if>
<if test="organCode != null "> and sf.organ_code = #{organCode}</if>

@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ticketing_manage_main_part_info mmpi ON st.manage_main_part_id = mmpi.id
<where>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' "> and st.sell_date between #{startDate} and #{endDate}</if>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' "> and DATE_FORMAT( st.sell_date, '%Y-%m-%d' ) between #{startDate} and #{endDate}</if>
<if test="startAge != null and startAge!='' and endAge!=null and endAge!='' "> and st.age between #{startAge} and #{endAge}</if>
<if test="manageMainPartId != null "> and st.manage_main_part_id = #{manageMainPartId}</if>
<if test="sex != null and sex != ''"> and st.sex = #{sex}</if>

@ -143,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ticketing_site s ON tc.site_id = s.id
LEFT JOIN ticketing_equipment e ON tc.equipment_id = e.id
<where>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' "> and tc.ticket_check_date between #{startDate} and #{endDate}</if>
<if test="startDate != null and startDate!='' and endDate!=null and endDate!='' "> and DATE_FORMAT( tc.ticket_check_date, '%Y-%m-%d' ) between #{startDate} and #{endDate}</if>
<if test="resourceId != null "> and tc.resource_id = #{resourceId}</if>
<if test="attractionsId != null "> and tc.attractions_id = #{attractionsId}</if>
<if test="siteId != null "> and tc.site_id = #{siteId}</if>

@ -27,6 +27,14 @@ public interface SysDictDataMapper
*/
public List<SysDictData> selectDictDataByType(String dictType);
/**
* 通过 dictType 和dictValue 获取数据
* @param dictType
* @param list
* @return
*/
public List<SysDictData> selectDictDataByTypeAndDictValue(@Param("dictType") String dictType,@Param("list") List<String> list);
/**
* 根据字典类型和字典键值查询字典数据信息
*

@ -59,7 +59,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="countDictDataByType" resultType="Integer">
select count(1) from sys_dict_data where dict_type=#{dictType}
</select>
<select id="selectDictDataByTypeAndDictValue" resultMap="SysDictDataResult">
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
from sys_dict_data
where status = '0' and dict_type = #{dictType}
and dict_value in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
order by dict_sort asc
</select>
<delete id="deleteDictDataById" parameterType="Long">
delete from sys_dict_data where dict_code = #{dictCode}
</delete>

Loading…
Cancel
Save