大屏-出入管理

This commit is contained in:
sliang 2024-04-01 19:45:19 +08:00
parent abd1b40a09
commit e20624afe3
16 changed files with 758 additions and 4 deletions

View File

@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author lsun
*/
@Data
public class TowerRecordVo {

View File

@ -0,0 +1,38 @@
package com.securitycontrol.entity.screen.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 出入管理
* @author lsun
*/
@Data
public class AccessMgeDto {
@ApiModelProperty(value = "工程标段")
private String bidCode;
@ApiModelProperty(value = "出入类型 1进 2出")
private String accessType;
@ApiModelProperty(value = "日期类型 1今日 2当月")
private String timeType;
@ApiModelProperty(value = "工程名称")
private String proName;
@ApiModelProperty(value = "车牌号")
private String carNum;
@ApiModelProperty(value = "时间戳")
private String date;
@ApiModelProperty(value = "开始时间")
private String startDate;
@ApiModelProperty(value = "结束时间")
private String endDate;
@ApiModelProperty(value = "姓名")
private String userName;
}

View File

@ -0,0 +1,62 @@
package com.securitycontrol.entity.screen.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 出入管理
* @author lsun
*/
@Data
public class AccessMgeVo {
@ApiModelProperty(value = "id")
private String warnId;
@Excel(name = "序号", width = 10.0, orderNum = "0")
private String proId;
@ApiModelProperty(value = "当月出场")
private String dycNum;
@ApiModelProperty(value = "当月入场")
private String dyrNum;
@ApiModelProperty(value = "今日出场")
private String jrcNum;
@ApiModelProperty(value = "今日入场")
private String jtrNum;
@ApiModelProperty(value = "告警内容")
private String warnContent;
@ApiModelProperty(value = "文件名称")
private String fileName;
@ApiModelProperty(value = "文件后缀")
private String fileSuffix;
@ApiModelProperty(value = "文件id/路径")
private String fileId;
@ApiModelProperty(value = "文件类型 0 文件 1图片")
private String fileType;
@ApiModelProperty(value = "工程名称")
@Excel(name = "工程名称", width = 10.0, orderNum = "1")
private String proName;
@ApiModelProperty(value = "车牌号")
@Excel(name = "车牌号", width = 10.0, orderNum = "2")
private String carNum;
@ApiModelProperty(value = "司机姓名")
@Excel(name = "司机姓名", width = 10.0, orderNum = "3")
private String userName;
@ApiModelProperty(value = "司机电话")
@Excel(name = "司机电话", width = 10.0, orderNum = "4")
private String phone;
@ApiModelProperty(value = "状态")
@Excel(name = "状态", width = 10.0, orderNum = "5")
private String accessType;
@ApiModelProperty(value = "时间")
@Excel(name = "时间", width = 10.0, orderNum = "6")
private String accesssTime;
}

View File

@ -0,0 +1,57 @@
package com.securitycontrol.entity.screen.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 出入管理 -导出
* @author lsun
*/
@Data
public class AccessMgesVo {
@ApiModelProperty(value = "id")
private String warnId;
@Excel(name = "序号", width = 10.0, orderNum = "0")
private String proId;
@ApiModelProperty(value = "当月出场")
private String dycNum;
@ApiModelProperty(value = "当月入场")
private String dyrNum;
@ApiModelProperty(value = "今日出场")
private String jrcNum;
@ApiModelProperty(value = "今日入场")
private String jtrNum;
@ApiModelProperty(value = "告警内容")
private String warnContent;
@ApiModelProperty(value = "文件名称")
private String fileName;
@ApiModelProperty(value = "文件后缀")
private String fileSuffix;
@ApiModelProperty(value = "文件id/路径")
private String fileId;
@ApiModelProperty(value = "文件类型 0 文件 1图片")
private String fileType;
@ApiModelProperty(value = "工程名称")
@Excel(name = "工程名称", width = 10.0, orderNum = "1")
private String proName;
@ApiModelProperty(value = "车牌号")
private String carNum;
@ApiModelProperty(value = "司机姓名")
@Excel(name = "姓名", width = 10.0, orderNum = "2")
private String userName;
@ApiModelProperty(value = "司机电话")
@Excel(name = "电话", width = 10.0, orderNum = "3")
private String phone;
@ApiModelProperty(value = "状态")
@Excel(name = "状态", width = 10.0, orderNum = "4")
private String accessType;
@ApiModelProperty(value = "时间")
@Excel(name = "时间", width = 10.0, orderNum = "5")
private String accesssTime;
}

View File

@ -0,0 +1,196 @@
package com.securitycontrol.screen.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.securitycontrol.common.core.utils.ExcelStyleUtil;
import com.securitycontrol.common.core.utils.aes.StringHelper;
import com.securitycontrol.common.core.web.controller.BaseController;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.common.core.web.page.TableDataInfo;
import com.securitycontrol.common.log.annotation.Log;
import com.securitycontrol.common.log.enums.OperationType;
import com.securitycontrol.entity.background.vo.TowerRecordVo;
import com.securitycontrol.entity.screen.dto.AccessMgeDto;
import com.securitycontrol.entity.screen.vo.AccessMgeVo;
import com.securitycontrol.entity.screen.vo.AccessMgesVo;
import com.securitycontrol.screen.service.AccessMgeService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* @author lsun
* 出入管理
*/
@RestController
@RequestMapping("/largeScreen/accessMge/")
@Slf4j
public class AccessMgeController extends BaseController {
@Resource(name = "AccessMgeService")
private AccessMgeService service;
/**
* 今日当月车辆出入场统计
* @param dto
* @return
*/
@ApiOperation(value = "今日、当月车辆出入场统计")
@GetMapping("getVehicleStatistics")
@Log(title = "出入管理", menu = "出入管理->今日、当月车辆出入场统计", grade = OperationType.QUERY_BUSINESS, details = "查询今日、当月车辆出入场统计列表", type = "业务日志")
public AjaxResult getVehicleStatistics(AccessMgeDto dto) {
return service.getVehicleStatistics(dto);
}
/**
* 今日当月车辆出入场统计图片
* @param dto
* @return
*/
@ApiOperation(value = "今日、当月车辆出入场统计图片")
@GetMapping("getVehicleStatisticsPhoto")
@Log(title = "出入管理", menu = "出入管理->今日、当月车辆出入场统计图片", grade = OperationType.QUERY_BUSINESS, details = "查询今日、当月车辆出入场统计列表图片", type = "业务日志")
public AjaxResult getVehicleStatisticsPhoto(AccessMgeDto dto) {
return service.getVehicleStatisticsPhoto(dto);
}
@ApiOperation(value = "今日、当月车辆出入场统计列表")
@GetMapping("getVehicleStatisticsList")
@Log(title = "出入管理", menu = "出入管理->今日、当月车辆出入场统计列表", grade = OperationType.QUERY_BUSINESS, details = "查询今日、当月车辆出入场统计列表", type = "业务日志")
public TableDataInfo getVehicleStatisticsList(AccessMgeDto dto) {
try{
startLayPage();
if(StringHelper.isNotEmpty(dto.getDate())){
String[] date = dto.getDate().split("~");
dto.setStartDate(date[0]);
dto.setEndDate(date[1]);
}
List<AccessMgeVo> list = service.getVehicleStatisticsList(dto);
return getDataTableLayui(list);
}catch (Exception e){
log.error(e.toString(),e);
return getDataTableBadLayui(new ArrayList<>(),"请求出错了");
}
}
@GetMapping("exportVehicleData")
@Log(title = "今日、当月车辆出入场统计列表", menu = "出入管理->今日、当月车辆出入场统计列表", grade = OperationType.EXPORT_BUSINESS, details = "导出列表", type = "业务日志")
public void exportVehicleData(HttpServletRequest request, HttpServletResponse response, AccessMgeDto dto) {
try {
List<AccessMgeVo> proExportVoList = new ArrayList<>();
if(StringHelper.isNotEmpty(dto.getDate())){
String[] date = dto.getDate().split("~");
dto.setStartDate(date[0]);
dto.setEndDate(date[1]);
}
List<AccessMgeVo> proLists = service.getVehicleStatisticsList(dto);
for (int i = 0; i < proLists.size(); i++) {
proLists.get(i).setProId((i + 1) + "");
AccessMgeVo exportVo = new AccessMgeVo();
BeanUtils.copyProperties(proLists.get(i), exportVo);
proExportVoList.add(exportVo);
}
ExportParams exportParams = new ExportParams("今日、当月车辆出入场统计", "今日、当月车辆出入场统计", ExcelType.XSSF);
exportParams.setStyle(ExcelStyleUtil.class);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, AccessMgeVo.class, proExportVoList);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("今日、当月车辆出入场统计" + ".xlsx", "UTF-8"));
ServletOutputStream outputStream = response.getOutputStream();
workbook.write(outputStream);
outputStream.close();
workbook.close();
} catch (Exception e) {
log.error("导出今日、当月车辆出入场统计列表", e);
}
}
/**
* 今日当月人员出入场统计
* @param dto
* @return
*/
@ApiOperation(value = "今日、当月人员出入场统计")
@GetMapping("getPerStatistics")
@Log(title = "出入管理", menu = "出入管理->今日、当月人员出入场统计", grade = OperationType.QUERY_BUSINESS, details = "查询今日、当月人员出入场统计列表", type = "业务日志")
public AjaxResult getPerStatistics(AccessMgeDto dto) {
return service.getPerStatistics(dto);
}
/**
* 今日当月人员出入场统计图片
* @param dto
* @return
*/
@ApiOperation(value = "今日、当月人员出入场统计图片")
@GetMapping("getPerStatisticsPhoto")
@Log(title = "出入管理", menu = "出入管理->今日、当月人员出入场统计图片", grade = OperationType.QUERY_BUSINESS, details = "查询今日、当月人员出入场统计列表图片", type = "业务日志")
public AjaxResult getPerStatisticsPhoto(AccessMgeDto dto) {
return service.getPerStatisticsPhoto(dto);
}
@ApiOperation(value = "今日、当月人员出入场统计列表")
@GetMapping("getPerStatisticsList")
@Log(title = "出入管理", menu = "出入管理->今日、当月人员出入场统计列表", grade = OperationType.QUERY_BUSINESS, details = "查询今日、当月人员出入场统计列表", type = "业务日志")
public TableDataInfo getPerStatisticsList(AccessMgeDto dto) {
try{
startLayPage();
if(StringHelper.isNotEmpty(dto.getDate())){
String[] date = dto.getDate().split("~");
dto.setStartDate(date[0]);
dto.setEndDate(date[1]);
}
List<AccessMgeVo> list = service.getPerStatisticsList(dto);
return getDataTableLayui(list);
}catch (Exception e){
log.error(e.toString(),e);
return getDataTableBadLayui(new ArrayList<>(),"请求出错了");
}
}
@GetMapping("exportPerData")
@Log(title = "今日、当月人员出入场统计列表", menu = "出入管理->今日、当月人员出入场统计列表", grade = OperationType.EXPORT_BUSINESS, details = "导出列表", type = "业务日志")
public void exportData(HttpServletRequest request, HttpServletResponse response, AccessMgeDto dto) {
try {
List<AccessMgesVo> proExportVoList = new ArrayList<>();
if(StringHelper.isNotEmpty(dto.getDate())){
String[] date = dto.getDate().split("~");
dto.setStartDate(date[0]);
dto.setEndDate(date[1]);
}
List<AccessMgeVo> proLists = service.getPerStatisticsList(dto);
for (int i = 0; i < proLists.size(); i++) {
proLists.get(i).setProId((i + 1) + "");
AccessMgesVo exportVo = new AccessMgesVo();
BeanUtils.copyProperties(proLists.get(i), exportVo);
proExportVoList.add(exportVo);
}
ExportParams exportParams = new ExportParams("今日、当月人员出入场统计", "今日、当月人员出入场统计", ExcelType.XSSF);
exportParams.setStyle(ExcelStyleUtil.class);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, AccessMgesVo.class, proExportVoList);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader("content-disposition", "attachment;fileName=" + URLEncoder.encode("今日、当月人员出入场统计" + ".xlsx", "UTF-8"));
ServletOutputStream outputStream = response.getOutputStream();
workbook.write(outputStream);
outputStream.close();
workbook.close();
} catch (Exception e) {
log.error("导出今日、当月人员出入场统计列表", e);
}
}
}

View File

@ -49,7 +49,7 @@ public class TowerAssInspectController extends BaseController {
* @return
*/
@ApiOperation(value = "实时检测")
@GetMapping("getRealTimeDetection ")
@GetMapping("getRealTimeDetection")
@Log(title = "组塔检测", menu = "组塔检测->实时检测", grade = OperationType.QUERY_BUSINESS, details = "查询实时检测", type = "业务日志")
public AjaxResult getRealTimeDetection(TowerAssInspectDto dto) {
return service.getRealTimeDetection(dto);
@ -61,7 +61,7 @@ public class TowerAssInspectController extends BaseController {
* @return
*/
@ApiOperation(value = "当日检测变化趋势")
@GetMapping("getTrend ")
@GetMapping("getTrend")
@Log(title = "组塔检测", menu = "组塔检测->当日检测变化趋势", grade = OperationType.QUERY_BUSINESS, details = "查询当日检测变化趋势", type = "业务日志")
public AjaxResult getTrend(TowerAssInspectDto dto) {
return service.getTrend(dto);

View File

@ -0,0 +1,57 @@
package com.securitycontrol.screen.mapper;
import com.securitycontrol.entity.screen.dto.AccessMgeDto;
import com.securitycontrol.entity.screen.vo.AccessMgeVo;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 出入管理
* @author lsun
*/
@Repository("AccessMgeMapper")
public interface AccessMgeMapper {
/**
* 今日当月车辆出入场统计
* @param dto
* @return
*/
List<AccessMgeVo> getVehicleStatistics(AccessMgeDto dto);
/**
* 今日当月车辆出入场统计图片
* @param dto
* @return
*/
List<AccessMgeVo> getVehicleStatisticsPhoto(AccessMgeDto dto);
/**
* 今日当月车辆出入场统计列表
* @param dto
* @return
*/
List<AccessMgeVo> getVehicleStatisticsList(AccessMgeDto dto);
/**
* 今日当月人员出入场统计
* @param dto
* @return
*/
List<AccessMgeVo> getPerStatistics(AccessMgeDto dto);
/**
* 今日当月人员出入场统计图片
* @param dto
* @return
*/
List<AccessMgeVo> getPerStatisticsPhoto(AccessMgeDto dto);
/**
* 今日当月人员出入场统计列表
* @param dto
* @return
*/
List<AccessMgeVo> getPerStatisticsList(AccessMgeDto dto);
}

View File

@ -10,9 +10,15 @@ import java.util.List;
/**
* 告警管理
* @author lsun
*/
@Repository(value = "AlarmMgeMapper")
public interface AlarmMgeMapper {
/**
* 告警管理-列表
* @param dto
* @return
*/
List<AlarmMgeVo> getAlarmMgeList(AlarmMgeDto dto);
}

View File

@ -12,13 +12,38 @@ import java.util.List;
*/
@Repository(value = "TowerAssInspectMapper")
public interface TowerAssInspectMapper {
/**
* 设备列表
* @param dto
* @return
*/
List<TowerAssInspectVo> getDeviceList(TowerAssInspectDto dto);
/**
* 实时检测
* @param dto
* @return
*/
List<TowerAssInspectVo> getRealTimeDetection(TowerAssInspectDto dto);
/**
* 当日检测变化趋势
* @param dto
* @return
*/
List<TowerAssInspectVo> getTrend(TowerAssInspectDto dto);
/**
* 实时告警
* @param dto
* @return
*/
List<TowerAssInspectVo> getRealTimeAlarmList(TowerAssInspectDto dto);
/**
* 历史记录
* @param dto
* @return
*/
List<TowerAssInspectVo> getHistoryList(TowerAssInspectDto dto);
}

View File

@ -0,0 +1,56 @@
package com.securitycontrol.screen.service;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.entity.screen.dto.AccessMgeDto;
import com.securitycontrol.entity.screen.vo.AccessMgeVo;
import java.util.List;
/**
* 出入管理
* @author lsun
*/
public interface AccessMgeService {
/**
* 今日当月车辆出入场统计
* @param dto
* @return
*/
AjaxResult getVehicleStatistics(AccessMgeDto dto);
/**
* 今日当月车辆出入场统计图片
* @param dto
* @return
*/
AjaxResult getVehicleStatisticsPhoto(AccessMgeDto dto);
/**
* 今日当月车辆出入场统计图片列表
* @param dto
* @return
*/
List<AccessMgeVo> getVehicleStatisticsList(AccessMgeDto dto);
/**
* 今日当月人员出入场统计
* @param dto
* @return
*/
AjaxResult getPerStatistics(AccessMgeDto dto);
/**
* 今日当月人员出入场统计图片
* @param dto
* @return
*/
AjaxResult getPerStatisticsPhoto(AccessMgeDto dto);
/**
* 今日当月人员出入场统计图片列表
* @param dto
* @return
*/
List<AccessMgeVo> getPerStatisticsList(AccessMgeDto dto);
}

View File

@ -9,7 +9,13 @@ import java.util.List;
/**
* 告警管理
* @author lsun
*/
public interface AlarmMgeService {
/**
* 告警管理 -列表
* @param dto
* @return
*/
List<AlarmMgeVo> getAlarmMgeList(AlarmMgeDto dto);
}

View File

@ -13,13 +13,38 @@ import java.util.List;
*/
public interface TowerAssInspectService {
/**
* 组塔检测-设备列表
* @param dto
* @return
*/
AjaxResult getDeviceList(TowerAssInspectDto dto);
/**
* 组塔检测-实时检测
* @param dto
* @return
*/
AjaxResult getRealTimeDetection(TowerAssInspectDto dto);
/**
* 组塔检测-当日检测变化趋势
* @param dto
* @return
*/
AjaxResult getTrend(TowerAssInspectDto dto);
/**
* 组塔检测-实时告警
* @param dto
* @return
*/
List<TowerAssInspectVo> getRealTimeAlarmList(TowerAssInspectDto dto);
/**
* 组塔检测-历史记录
* @param dto
* @return
*/
List<TowerAssInspectVo> getHistoryList(TowerAssInspectDto dto);
}

View File

@ -0,0 +1,90 @@
package com.securitycontrol.screen.service.impl;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.entity.screen.dto.AccessMgeDto;
import com.securitycontrol.entity.screen.vo.AccessMgeVo;
import com.securitycontrol.screen.mapper.AccessMgeMapper;
import com.securitycontrol.screen.service.AccessMgeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 出入管理
* @author lsun
*/
@Slf4j
@Service(value = "AccessMgeService")
public class AccessMgeServiceImpl implements AccessMgeService {
@Resource(name = "AccessMgeMapper")
private AccessMgeMapper mapper;
@Override
public AjaxResult getVehicleStatistics(AccessMgeDto dto) {
List<AccessMgeVo> list = new ArrayList<>();
try {
list = mapper.getVehicleStatistics(dto);
} catch (Exception e) {
log.error("今日、当月车辆出入场统计-查询失败", e);
}
return AjaxResult.success(list);
}
@Override
public AjaxResult getVehicleStatisticsPhoto(AccessMgeDto dto) {
List<AccessMgeVo> list = new ArrayList<>();
try {
list = mapper.getVehicleStatisticsPhoto(dto);
} catch (Exception e) {
log.error("今日、当月车辆出入场统计图片-查询失败", e);
}
return AjaxResult.success(list);
}
@Override
public List<AccessMgeVo> getVehicleStatisticsList(AccessMgeDto dto) {
List<AccessMgeVo> list = new ArrayList<>();
try {
list = mapper.getVehicleStatisticsList(dto);
} catch (Exception e) {
log.error("获取今日、当月车辆出入场统计列表",e);
}
return list;
}
@Override
public AjaxResult getPerStatistics(AccessMgeDto dto) {
List<AccessMgeVo> list = new ArrayList<>();
try {
list = mapper.getPerStatistics(dto);
} catch (Exception e) {
log.error("今日、当月人员出入场统计-查询失败", e);
}
return AjaxResult.success(list);
}
@Override
public AjaxResult getPerStatisticsPhoto(AccessMgeDto dto) {
List<AccessMgeVo> list = new ArrayList<>();
try {
list = mapper.getPerStatisticsPhoto(dto);
} catch (Exception e) {
log.error("今日、当月人员出入场统计图片-查询失败", e);
}
return AjaxResult.success(list);
}
@Override
public List<AccessMgeVo> getPerStatisticsList(AccessMgeDto dto) {
List<AccessMgeVo> list = new ArrayList<>();
try {
list = mapper.getPerStatisticsList(dto);
} catch (Exception e) {
log.error("获取今日、当月人员出入场统计列表",e);
}
return list;
}
}

View File

@ -20,6 +20,7 @@ import java.util.concurrent.Future;
/**
* 告警管理
* @author lsun
*/
@Slf4j
@Service(value = "AlarmMgeService")

View File

@ -0,0 +1,135 @@
<?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.securitycontrol.screen.mapper.AccessMgeMapper">
<select id="getVehicleStatistics" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT
LPAD(SUM(jtrNum), 3, '0') AS jtrNum,
LPAD(SUM(jrcNum), 3, '0') AS jrcNum,
LPAD(SUM(dyrNum), 4, '0') AS dyrNum,
LPAD(SUM(dycNum), 4, '0') AS dycNum
FROM (
SELECT
sum( case when tca.access_type = '1' then 1 else 0 end ) as jtrNum,
sum( case when tca.access_type = '2' then 1 else 0 end ) as jrcNUm,
0 as dyrNum,
0 as dycNUm
FROM tb_car tb
LEFT JOIN tb_car_access tca on tb.id = tca.car_id
WHERE to_days(tca.accesss_time) = to_days(NOW())
UNION ALL
SELECT
0 as jtrNum,
0 as jrcNUm,
sum( case when tca.access_type = '1' then 1 else 0 end ) as dyrNum,
sum( case when tca.access_type = '2' then 1 else 0 end ) as dycNUm
FROM tb_car tb
LEFT JOIN tb_car_access tca on tb.id = tca.car_id
WHERE DATE_FORMAT(tca.accesss_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m')
) a
</select>
<select id="getVehicleStatisticsPhoto" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT tw.warn_content as warnContent, trf.file_name as fileName, trf.file_suffix as fileSuffix , trf.file_id as fileId, trf.file_type as fileType
FROM tb_car tb
LEFT JOIN tb_car_access tca on tb.id = tca.car_id
LEFT JOIN tb_warn tw ON tw.source_id = tca.id
LEFT JOIN tb_resource_file trf on trf.source_id = tw.warn_id
WHERE trf.del_flag = '0' AND tca.access_type = #{accessType}
<if test='timeType=="1"'>
and to_days(tca.accesss_time) = to_days(NOW())
</if>
<if test='timeType=="2"'>
and DATE_FORMAT(tca.accesss_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m')
</if>
</select>
<select id="getVehicleStatisticsList" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT tp.pro_name as proName, tc.car_num as carNum, tc.user_name as userName, tc.phone ,
case when tca.access_type ='1' then '入场' else '出场' END accessType, tca.accesss_time as accesssTime
FROM tb_project tp
LEFT JOIN tb_car tc ON tp.bid_code = tc.bid_code
LEFT JOIN tb_car_access tca on tca.car_id = tc.id
WHERE tp.bid_code = #{bidCode}
<if test="proName != null and proName != ''">
and tp.pro_name LIKE concat('%',#{proName},'%')
</if>
<if test="carNum != null and carNum != ''">
and tc.car_num LIKE concat('%',#{carNum},'%')
</if>
<if test="date != null and date != ''">
AND tca.accesss_time BETWEEN CONCAT(#{startDate}) AND CONCAT(#{endDate})
</if>
</select>
<select id="getPerStatistics" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT
LPAD(SUM(jtrNum), 3, '0') AS jtrNum,
LPAD(SUM(jrcNum), 3, '0') AS jrcNum,
LPAD(SUM(dyrNum), 4, '0') AS dyrNum,
LPAD(SUM(dycNum), 4, '0') AS dycNum
FROM (
SELECT
sum( case when tua.access_type = '1' then 1 else 0 end ) as jtrNum,
sum( case when tua.access_type = '2' then 1 else 0 end ) as jrcNUm,
0 as dyrNum,
0 as dycNUm
FROM tb_work_team twt
LEFT JOIN t_team_people ttp on twt.team_id = ttp.team_id
LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id
WHERE to_days(tua.access_time) = to_days(NOW())
UNION ALL
SELECT
0 as jtrNum,
0 as jrcNUm,
sum( case when tua.access_type = '1' then 1 else 0 end ) as dyrNum,
sum( case when tua.access_type = '2' then 1 else 0 end ) as dycNUm
FROM tb_work_team twt
LEFT JOIN t_team_people ttp on twt.team_id = ttp.team_id
LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id
WHERE DATE_FORMAT(tua.access_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m')
)a
</select>
<select id="getPerStatisticsPhoto" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT tw.warn_content as warnContent, trf.file_name as fileName, trf.file_suffix as fileSuffix , trf.file_id as fileId, trf.file_type as fileType
FROM tb_work_team twt
LEFT JOIN t_team_people ttp on twt.team_id = ttp.team_id
LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id
LEFT JOIN tb_warn tw ON tw.people_id = tua.id
LEFT JOIN tb_resource_file trf on trf.source_id = tw.warn_id
WHERE trf.del_flag = '0' AND tua.access_type = #{accessType}
<if test='timeType=="1"'>
and to_days(tua.access_time) = to_days(NOW())
</if>
<if test='timeType=="2"'>
and DATE_FORMAT(tua.access_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m')
</if>
</select>
<select id="getPerStatisticsList" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT tp.pro_name as proName, tua.user_name as userName, tua.user_phone as phone ,
case when tua.access_type ='1' then '入场' else '出场' END accessType, tua.access_time as accesssTime
FROM tb_project tp
LEFT JOIN tb_work_team twt ON twt.bid_code = tp.bid_code
LEFT JOIN t_team_people ttp on twt.team_id = ttp.team_id
LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id
WHERE tp.bid_code = #{bidCode}
<if test="proName != null and proName != ''">
and tp.pro_name LIKE concat('%',#{proName},'%')
</if>
<if test="userName != null and userName != ''">
and tua.user_name LIKE concat('%',#{userName},'%')
</if>
<if test="date != null and date != ''">
AND tca.accesss_time BETWEEN CONCAT(#{startDate}) AND CONCAT(#{endDate})
</if>
</select>
</mapper>

View File

@ -135,7 +135,7 @@
sd2.dict_name AS name
FROM sys_dict sd
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
WHERE sd.dict_code = '999' AND sd.del_flag = 0
WHERE sd.dict_code = '9990' AND sd.del_flag = 0
ORDER BY sd2.dict_sort
</select>