大屏人员出入图片修改
This commit is contained in:
parent
213e485098
commit
a2203aa10f
|
|
@ -74,11 +74,14 @@ public class Constant {
|
||||||
public final static String WARN = "1";
|
public final static String WARN = "1";
|
||||||
public final static String NOT_WARN = "0";
|
public final static String NOT_WARN = "0";
|
||||||
|
|
||||||
/**车辆闸机、人员闸机 编码*/
|
/**人员闸机编码*/
|
||||||
public final static String PERSON_CAR_TYPE = "1907";
|
public final static String PERSON_CAR_TYPE = "1907";
|
||||||
|
/**车辆闸机编码*/
|
||||||
|
public final static String CAR_GATE = "1911";
|
||||||
/**人员闸机检测名称*/
|
/**人员闸机检测名称*/
|
||||||
public final static String PERSON = "绑定人";
|
public final static String PERSON = "绑定人";
|
||||||
public final static String CAR = "车牌号";
|
public final static String CAR = "车牌号";
|
||||||
|
public final static String PHOTO = "image";
|
||||||
public final static String ACCESS_TIME = "出入时间";
|
public final static String ACCESS_TIME = "出入时间";
|
||||||
public final static String ACCESS_TYPE = "出入类型";
|
public final static String ACCESS_TYPE = "出入类型";
|
||||||
public final static String ACCESS_TYPE_IN = "入";
|
public final static String ACCESS_TYPE_IN = "入";
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ public class VehicleServiceImpl implements VehicleService {
|
||||||
dto.setEndDate(arr[1]);
|
dto.setEndDate(arr[1]);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
dto.setTypeCode(Constant.PERSON_CAR_TYPE);
|
dto.setTypeCode(Constant.CAR_GATE);
|
||||||
dto.setModeName(Constant.CAR);
|
dto.setModeName(Constant.CAR);
|
||||||
list = mapper.getLists(dto);
|
list = mapper.getLists(dto);
|
||||||
for (VehicleVo vo : list) {
|
for (VehicleVo vo : list) {
|
||||||
|
|
|
||||||
|
|
@ -47,35 +47,4 @@ public interface AccessMgeMapper {
|
||||||
*/
|
*/
|
||||||
List<AccessMgeVo> getPerStatisticsList(AccessMgeDto dto);
|
List<AccessMgeVo> getPerStatisticsList(AccessMgeDto dto);
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆基本信息
|
|
||||||
*
|
|
||||||
* @param carNum
|
|
||||||
* @return String
|
|
||||||
* @description
|
|
||||||
* @author cwchen
|
|
||||||
* @date 2024/4/19 10:14
|
|
||||||
*/
|
|
||||||
String getCarBasicInfo(String carNum);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取车辆/人员入场 离场状态
|
|
||||||
*
|
|
||||||
* @param sourceType
|
|
||||||
* @return String
|
|
||||||
* @description
|
|
||||||
* @author cwchen
|
|
||||||
* @date 2024/4/19 10:19
|
|
||||||
*/
|
|
||||||
String getAccessLists(String sourceType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 人员基本信息
|
|
||||||
* @param userId
|
|
||||||
* @return String
|
|
||||||
* @description
|
|
||||||
* @author cwchen
|
|
||||||
* @date 2024/4/19 13:12
|
|
||||||
*/
|
|
||||||
String getPeopleBasicInfo(String userId);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,29 @@
|
||||||
package com.securitycontrol.screen.service.impl;
|
package com.securitycontrol.screen.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.securitycontrol.common.core.constant.Constant;
|
import com.securitycontrol.common.core.constant.Constant;
|
||||||
|
import com.securitycontrol.common.core.constant.HttpStatus;
|
||||||
|
import com.securitycontrol.common.core.constant.SecurityConstants;
|
||||||
|
import com.securitycontrol.common.core.domain.Result;
|
||||||
import com.securitycontrol.common.core.utils.StringUtils;
|
import com.securitycontrol.common.core.utils.StringUtils;
|
||||||
import com.securitycontrol.common.core.utils.aes.DateTimeHelper;
|
import com.securitycontrol.common.core.utils.aes.DateTimeHelper;
|
||||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
|
import com.securitycontrol.entity.background.vo.HumanManageVo;
|
||||||
import com.securitycontrol.entity.screen.dto.AccessMgeDto;
|
import com.securitycontrol.entity.screen.dto.AccessMgeDto;
|
||||||
import com.securitycontrol.entity.screen.vo.AccessMgeVo;
|
import com.securitycontrol.entity.screen.vo.AccessMgeVo;
|
||||||
|
import com.securitycontrol.entity.system.vo.ResourceFileVo;
|
||||||
import com.securitycontrol.screen.mapper.AccessMgeMapper;
|
import com.securitycontrol.screen.mapper.AccessMgeMapper;
|
||||||
import com.securitycontrol.screen.service.AccessMgeService;
|
import com.securitycontrol.screen.service.AccessMgeService;
|
||||||
|
import com.securitycontrol.system.api.RemoteFileService;
|
||||||
|
import com.securitycontrol.system.api.domain.SysFile;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出入管理
|
* 出入管理
|
||||||
|
|
@ -27,6 +36,9 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
||||||
@Resource(name = "AccessMgeMapper")
|
@Resource(name = "AccessMgeMapper")
|
||||||
private AccessMgeMapper mapper;
|
private AccessMgeMapper mapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteFileService remoteFileService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getVehicleStatistics(AccessMgeDto dto) {
|
public AjaxResult getVehicleStatistics(AccessMgeDto dto) {
|
||||||
return totalAccessData("1",dto);
|
return totalAccessData("1",dto);
|
||||||
|
|
@ -70,12 +82,53 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getPerStatisticsPhoto(AccessMgeDto dto) {
|
public AjaxResult getPerStatisticsPhoto(AccessMgeDto dto) {
|
||||||
List<AccessMgeVo> list = new ArrayList<>();
|
List<AccessMgeVo> list = new ArrayList<>();
|
||||||
|
List<AccessMgeVo> noWarnList = new ArrayList<>();
|
||||||
|
List<AccessMgeVo> warnList = new ArrayList<>();
|
||||||
|
Map<String, Object> map = new HashMap<>(2);
|
||||||
try {
|
try {
|
||||||
|
dto.setModeName(Constant.PHOTO);
|
||||||
|
dto.setTypeCode(Constant.PERSON_CAR_TYPE);
|
||||||
list = mapper.getPerStatisticsPhoto(dto);
|
list = mapper.getPerStatisticsPhoto(dto);
|
||||||
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
|
for (AccessMgeVo vo : list) {
|
||||||
|
if(StringUtils.isNotEmpty(vo.getVal())){
|
||||||
|
Result<SysFile> result = remoteFileService.getImgBase64(vo.getVal(), SecurityConstants.INNER);
|
||||||
|
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||||
|
String jsonString = JSON.toJSONString(result.getData());
|
||||||
|
JSONObject item = JSON.parseObject(jsonString);
|
||||||
|
String base64 = item.getString("url");
|
||||||
|
vo.setBase64(base64);
|
||||||
|
}
|
||||||
|
vo.setPersonName(handleData(vo.getSourceData()));
|
||||||
|
}
|
||||||
|
if(Objects.equals("0",vo.getIsWarn()) || StringUtils.isEmpty(vo.getIsWarn())){
|
||||||
|
noWarnList.add(vo);
|
||||||
|
}else if(Objects.equals("1",vo.getIsWarn())){
|
||||||
|
warnList.add(vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("今日、当月人员出入场统计图片-查询失败", e);
|
log.error("今日、当月人员出入场统计图片-查询失败", e);
|
||||||
}
|
}
|
||||||
return AjaxResult.success(list);
|
map.put("noWarnList",noWarnList);
|
||||||
|
map.put("warnList",warnList);
|
||||||
|
return AjaxResult.success(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String handleData(String jsonStr){
|
||||||
|
try {
|
||||||
|
if(StringUtils.isEmpty(jsonStr)){
|
||||||
|
return null;
|
||||||
|
}else{
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
|
||||||
|
String personName = jsonObject.getString("personName");
|
||||||
|
return personName;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("人员出入数据解析异常",e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -96,22 +149,9 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
||||||
// type : 1.车辆 2.人员
|
// type : 1.车辆 2.人员
|
||||||
List<AccessMgeVo> list = new ArrayList<>();
|
List<AccessMgeVo> list = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
dto.setTypeCode(Constant.PERSON_CAR_TYPE);
|
dto.setTypeCode(Objects.equals(Constant.TYPE, type) ? Constant.CAR_GATE: Constant.PERSON_CAR_TYPE);
|
||||||
dto.setModeName(Objects.equals(Constant.TYPE, type) ? Constant.CAR : Constant.PERSON);
|
dto.setModeName(Objects.equals(Constant.TYPE, type) ? Constant.CAR : Constant.PERSON);
|
||||||
list = Objects.equals(Constant.TYPE, type) ? mapper.getVehicleStatisticsList(dto) : mapper.getPerStatisticsList(dto);
|
list = Objects.equals(Constant.TYPE, type) ? mapper.getVehicleStatisticsList(dto) : mapper.getPerStatisticsList(dto);
|
||||||
for (AccessMgeVo accessMgeVo : list) {
|
|
||||||
String basicInfo = Objects.equals(Constant.TYPE, type) ? mapper.getCarBasicInfo(accessMgeVo.getCarNum()) : mapper.getPeopleBasicInfo(accessMgeVo.getUserId());
|
|
||||||
String data = mapper.getAccessLists(accessMgeVo.getSourceType());
|
|
||||||
if (StringUtils.isNotBlank(basicInfo)) {
|
|
||||||
String[] split = basicInfo.split("@");
|
|
||||||
accessMgeVo.setUserName(split[0]);
|
|
||||||
accessMgeVo.setPhone(split[1]);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(data)) {
|
|
||||||
String[] dataArr = data.split(",");
|
|
||||||
setAccessData(accessMgeVo, dataArr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(Objects.equals(Constant.TYPE, type) ? "获取车辆出入场记录" : "获取人员出入场记录", e);
|
log.error(Objects.equals(Constant.TYPE, type) ? "获取车辆出入场记录" : "获取人员出入场记录", e);
|
||||||
}
|
}
|
||||||
|
|
@ -124,20 +164,13 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
||||||
List<AccessMgeVo> dataList = new ArrayList<>();
|
List<AccessMgeVo> dataList = new ArrayList<>();
|
||||||
List<AccessMgeVo> list = new ArrayList<>();
|
List<AccessMgeVo> list = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
dto.setTypeCode(Constant.PERSON_CAR_TYPE);
|
dto.setTypeCode(Objects.equals(Constant.TYPE, type) ? Constant.CAR_GATE: Constant.PERSON_CAR_TYPE);
|
||||||
dto.setModeName(Objects.equals(Constant.TYPE, type) ? Constant.CAR : Constant.PERSON);
|
dto.setModeName(Objects.equals(Constant.TYPE, type) ? Constant.CAR : Constant.PERSON);
|
||||||
String[] dateArr = DateTimeHelper.getMonthFirstAndLastDay().split(" - ");
|
String[] dateArr = DateTimeHelper.getMonthFirstAndLastDay().split(" - ");
|
||||||
dto.setStartDate(dateArr[0]);
|
dto.setStartDate(dateArr[0]);
|
||||||
dto.setEndDate(dateArr[1]);
|
dto.setEndDate(dateArr[1]);
|
||||||
AccessMgeVo vo = new AccessMgeVo();
|
AccessMgeVo vo = new AccessMgeVo();
|
||||||
list = Objects.equals(Constant.TYPE, type) ? mapper.getVehicleStatisticsList(dto) : mapper.getPerStatisticsList(dto);
|
list = Objects.equals(Constant.TYPE, type) ? mapper.getVehicleStatisticsList(dto) : mapper.getPerStatisticsList(dto);
|
||||||
for (AccessMgeVo accessMgeVo : list) {
|
|
||||||
String data = mapper.getAccessLists(accessMgeVo.getSourceType());
|
|
||||||
if (StringUtils.isNotEmpty(data)) {
|
|
||||||
String[] dataArr = data.split(",");
|
|
||||||
setAccessData(accessMgeVo, dataArr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 今日入 今日出 当月入 当月出
|
// 今日入 今日出 当月入 当月出
|
||||||
int jtrNum = 0, jrcNum = 0, dyrNum = 0, dycNum = 0;
|
int jtrNum = 0, jrcNum = 0, dyrNum = 0, dycNum = 0;
|
||||||
for (AccessMgeVo mgeVo : list) {
|
for (AccessMgeVo mgeVo : list) {
|
||||||
|
|
|
||||||
|
|
@ -19,76 +19,112 @@
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!--车辆出入场记录-->
|
||||||
<select id="getVehicleStatisticsList" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
|
<select id="getVehicleStatisticsList" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
|
||||||
SELECT thdv.source_type AS sourceType,thdv.val AS carNum,tp.pro_name AS proName
|
SELECT r.proName,r.accessTime AS accesssTime,r.carNum,r.accessType,tc.user_name AS userName,tc.phone
|
||||||
FROM tb_his_device_value thdv
|
FROM (
|
||||||
INNER JOIN tb_device_detail tdd ON tdd.id = thdv.attribute_id AND tdd.del_flag = 0 AND tdd.mode_name = #{modeName}
|
SELECT thdv.val,tp.pro_name AS proName,thdv.source_type,a.val AS accessTime,b.val AS carNum,c.val AS accessType
|
||||||
INNER JOIN tb_bd_device tbd ON tbd.device_id = tdd.device_id AND tbd.del_flag = 0 AND tbd.devic_type = #{typeCode}
|
FROM tb_his_device_value thdv
|
||||||
INNER JOIN tb_project tp ON thdv.bid_code = tp.bid_code AND tp.del_flag = 0
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0
|
||||||
WHERE thdv.bid_code = #{bidCode}
|
INNER JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id AND tbd.devic_type = #{typeCode} AND tbd.del_flag = 0
|
||||||
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
INNER JOIN tb_project tp ON thdv.bid_code = tp.bid_code AND tp.del_flag = 0
|
||||||
AND thdv.create_time BETWEEN CONCAT(#{startDate},' 00:00:00') AND CONCAT(#{endDate},' 23:59:59')
|
LEFT JOIN (
|
||||||
</if>
|
SELECT thdv.val,thdv.source_type
|
||||||
<if test="carNum!=null and carNum!=''">
|
FROM tb_his_device_value thdv
|
||||||
AND INSTR(thdv.val,#{carNum}) > 0
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0 AND tdd.device_code = 'dataTime'
|
||||||
</if>
|
WHERE thdv.bid_code = #{bidCode}
|
||||||
<if test="proName!=null and proName!=''">
|
) a ON a.source_type = thdv.source_type
|
||||||
AND INSTR(tp.pro_name,#{proName}) > 0
|
LEFT JOIN (
|
||||||
</if>
|
SELECT thdv.val,thdv.source_type
|
||||||
ORDER BY thdv.create_time DESC
|
FROM tb_his_device_value thdv
|
||||||
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0 AND tdd.device_code = 'plateNumber'
|
||||||
|
WHERE thdv.bid_code = #{bidCode}
|
||||||
|
) b ON b.source_type = thdv.source_type
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT thdv.val,thdv.source_type
|
||||||
|
FROM tb_his_device_value thdv
|
||||||
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0 AND tdd.device_code = 'type'
|
||||||
|
WHERE thdv.bid_code = #{bidCode}
|
||||||
|
) c ON c.source_type = thdv.source_type
|
||||||
|
WHERE thdv.bid_code = #{bidCode}
|
||||||
|
ORDER BY thdv.create_time DESC
|
||||||
|
) r
|
||||||
|
LEFT JOIN tb_car tc ON tc.car_num = r.carNum AND tc.del_flag = 0
|
||||||
|
<where>
|
||||||
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
||||||
|
r.accessTime BETWEEN CONCAT(#{startDate},' 00:00:00') AND CONCAT(#{endDate},' 23:59:59')
|
||||||
|
</if>
|
||||||
|
<if test="carNum!=null and carNum!=''">
|
||||||
|
AND INSTR(r.carNum,#{carNum}) > 0
|
||||||
|
</if>
|
||||||
|
<if test="proName!=null and proName!=''">
|
||||||
|
AND INSTR(r.proName,#{proName}) > 0
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY r.source_type
|
||||||
|
ORDER BY r.accessTime DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!--人员出入照片-->
|
||||||
<select id="getPerStatisticsPhoto" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
|
<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
|
SELECT trf.file_id AS val,thdv.create_time AS createTime,thdv.is_warn AS isWarn,thdv.source_data AS sourceData
|
||||||
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 twt.bid_code = #{bidCode} and 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 thdv.source_type AS sourceType,
|
|
||||||
thdv.val AS userId,
|
|
||||||
tp.pro_name AS proName
|
|
||||||
FROM tb_his_device_value thdv
|
FROM tb_his_device_value thdv
|
||||||
INNER JOIN tb_device_detail tdd ON tdd.id = thdv.attribute_id AND tdd.del_flag = 0 AND tdd.mode_name = #{modeName}
|
INNER JOIN tb_resource_file trf ON thdv.val = trf.source_id AND trf.del_flag = 0 AND trf.source_type = '人员出入'
|
||||||
INNER JOIN tb_bd_device tbd ON tbd.device_id = tdd.device_id AND tbd.del_flag = 0 AND tbd.devic_type = #{typeCode}
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0 AND tdd.device_code = #{modeName}
|
||||||
INNER JOIN tb_project tp ON thdv.bid_code = tp.bid_code AND tp.del_flag = 0
|
INNER JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id AND tbd.del_flag = 0 AND tbd.devic_type = #{typeCode}
|
||||||
WHERE thdv.bid_code = #{bidCode}
|
WHERE bid_code = #{bidCode}
|
||||||
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
||||||
AND thdv.create_time BETWEEN CONCAT(#{startDate},' 00:00:00') AND CONCAT(#{endDate},' 23:59:59')
|
|
||||||
</if>
|
|
||||||
<if test="userName!=null and userName!=''">
|
|
||||||
AND INSTR(thdv.val,#{carNum}) > 0
|
|
||||||
</if>
|
|
||||||
<if test="proName!=null and proName!=''">
|
|
||||||
AND INSTR(tp.pro_name,#{proName}) > 0
|
|
||||||
</if>
|
|
||||||
ORDER BY thdv.create_time DESC
|
ORDER BY thdv.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
<!--车辆基本信息-->
|
|
||||||
<select id="getCarBasicInfo" resultType="java.lang.String">
|
<!--人员出入场记录-->
|
||||||
SELECT CONCAT(IFNULL(user_name,'/'),'@',IFNULL(phone,'/')) FROM tb_car WHERE car_num = #{carNum}
|
<select id="getPerStatisticsList" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
|
||||||
</select>
|
SELECT r.proName,r.accessTime AS accesssTime,r.personName AS userName,r.image,r.type AS accessType
|
||||||
<!--获取车辆/人员入场 离场状态-->
|
FROM (
|
||||||
<select id="getAccessLists" resultType="java.lang.String">
|
SELECT tp.pro_name AS proName,thdv.source_type,a.val AS accessTime,b.val AS personName,c.val AS image,d.val AS type
|
||||||
SELECT GROUP_CONCAT(CONCAT(tdd.mode_name,'@',thdv.val)) AS value
|
FROM tb_his_device_value thdv
|
||||||
FROM tb_his_device_value thdv
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0
|
||||||
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0
|
INNER JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id AND tbd.devic_type = #{typeCode} AND tbd.del_flag = 0
|
||||||
WHERE thdv.source_type = #{sourceType}
|
INNER JOIN tb_project tp ON thdv.bid_code = tp.bid_code AND tp.del_flag = 0
|
||||||
GROUP BY thdv.source_type
|
LEFT JOIN (
|
||||||
</select>
|
SELECT thdv.val,thdv.source_type
|
||||||
<!--人员基本信息-->
|
FROM tb_his_device_value thdv
|
||||||
<select id="getPeopleBasicInfo" resultType="java.lang.String">
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0 AND tdd.device_code = 'dataTime'
|
||||||
SELECT CONCAT(IFNULL(user_name,'/'),'@',IFNULL(phone,'/')) FROM t_team_people WHERE user_id = #{userId}
|
WHERE thdv.bid_code = #{bidCode}
|
||||||
|
) a ON a.source_type = thdv.source_type
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT thdv.val,thdv.source_type
|
||||||
|
FROM tb_his_device_value thdv
|
||||||
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0 AND tdd.device_code = 'personName'
|
||||||
|
WHERE thdv.bid_code = #{bidCode}
|
||||||
|
) b ON b.source_type = thdv.source_type
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT trf.file_id AS val,thdv.source_type
|
||||||
|
FROM tb_his_device_value thdv
|
||||||
|
INNER JOIN tb_resource_file trf ON thdv.val = trf.source_id AND trf.del_flag = 0 AND trf.source_type = '人员出入'
|
||||||
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0 AND tdd.device_code = 'image'
|
||||||
|
WHERE thdv.bid_code = #{bidCode}
|
||||||
|
) c ON c.source_type = thdv.source_type
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT thdv.val,thdv.source_type
|
||||||
|
FROM tb_his_device_value thdv
|
||||||
|
INNER JOIN tb_device_detail tdd ON thdv.attribute_id = tdd.id AND tdd.del_flag = 0 AND tdd.device_code = 'type'
|
||||||
|
WHERE thdv.bid_code = #{bidCode}
|
||||||
|
) d ON d.source_type = thdv.source_type
|
||||||
|
WHERE thdv.bid_code = #{bidCode}
|
||||||
|
ORDER BY thdv.create_time DESC
|
||||||
|
) r
|
||||||
|
<where>
|
||||||
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
||||||
|
r.accessTime BETWEEN CONCAT(#{startDate},' 00:00:00') AND CONCAT(#{endDate},' 23:59:59')
|
||||||
|
</if>
|
||||||
|
<if test="userName!=null and userName!=''">
|
||||||
|
AND INSTR(r.personName,#{userName}) > 0
|
||||||
|
</if>
|
||||||
|
<if test="proName!=null and proName!=''">
|
||||||
|
AND INSTR(r.pro_name,#{proName}) > 0
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY r.source_type
|
||||||
|
ORDER BY r.accessTime DESC
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue