智能识别
This commit is contained in:
parent
77197f6084
commit
6cc2688f21
|
|
@ -156,6 +156,11 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dom4j</groupId>
|
||||
<artifactId>dom4j</artifactId>
|
||||
<version>1.6.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -916,4 +916,16 @@ public class DateTimeHelper {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将时间戳转换为时间
|
||||
*/
|
||||
public static String stampToDate(String stap) {
|
||||
String time;
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
long lt = new Long(stap);
|
||||
Date date = new Date(lt * 1000);
|
||||
time = simpleDateFormat.format(date);
|
||||
return time;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package com.bonus.common.entity.tcp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @className:DeviceUseVo
|
||||
* @author:cwchen
|
||||
* @date:2024-08-27-15:36
|
||||
* @version:1.0
|
||||
* @description:设备领用-vo
|
||||
*/
|
||||
@Data
|
||||
public class DeviceUseVo {
|
||||
private Long id;
|
||||
/**设备ID*/
|
||||
private Long devId;
|
||||
/**工程ID*/
|
||||
private Long proId;
|
||||
/**班组ID*/
|
||||
private Long teamId;
|
||||
/**杆塔ID*/
|
||||
private Long gtId;
|
||||
/**人员身份证号*/
|
||||
private String idCard;
|
||||
/**人员ID*/
|
||||
private Long userId;
|
||||
/**告警内容*/
|
||||
private String warnContent;
|
||||
/**告警时间*/
|
||||
private String warnTime;
|
||||
/**告警类型 1 设备告警 2 违章识别 3 带电体告警*/
|
||||
private String warnType = "2";
|
||||
private Date createTime = new Date();
|
||||
/**删除状态*/
|
||||
private Integer delFlag = 0;
|
||||
/**设备关联类型 0手环 1设备*/
|
||||
private Integer devType = 1;
|
||||
/**人员类型 0默认 1 临时人员*/
|
||||
private Integer peopleType = 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.common.entity.tcp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className:PeopleVioVo
|
||||
* @author:cwchen
|
||||
* @date:2024-08-27-16:06
|
||||
* @version:1.0
|
||||
* @description:人员违章-vo
|
||||
*/
|
||||
@Data
|
||||
public class PeopleVioVo {
|
||||
|
||||
/**人员ID*/
|
||||
private Long id;
|
||||
/**姓名*/
|
||||
private String name;
|
||||
/**人员类别 0-班组成员 1-临时人员*/
|
||||
private Integer peopleType;
|
||||
}
|
||||
|
|
@ -0,0 +1,217 @@
|
|||
package com.bonus.tcp.smartIdentify.controller;
|
||||
|
||||
import com.bonus.common.core.utils.BASE64DecodedMultipartFile;
|
||||
import com.bonus.common.core.utils.DateTimeHelper;
|
||||
import com.bonus.common.entity.tcp.DeviceUseVo;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.tcp.smartIdentify.service.SmartIdentifyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* @className:SmartIdentifyController
|
||||
* @author:cwchen
|
||||
* @date:2024-08-27-14:26
|
||||
* @version:1.0
|
||||
* @description:球机智能识别
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/ball")
|
||||
public class SmartIdentifyController {
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Resource(name = "SmartIdentifyService")
|
||||
private SmartIdentifyService service;
|
||||
|
||||
public static final ReentrantLock BED_LOCK = new ReentrantLock();
|
||||
|
||||
/**
|
||||
* 事件id集合
|
||||
* E_IVS_HelmetNotWear :未带安全帽
|
||||
* E_IVS_Smoking :抽烟报警
|
||||
* E_IVS_NotWear3ColorVest :未穿三色马甲报警
|
||||
* E_IVS_FaceRecognition :人脸识别
|
||||
*/
|
||||
public static List<String> eventIds = new ArrayList<>();
|
||||
|
||||
{
|
||||
eventIds.add("E_IVS_HelmetNotWear");
|
||||
eventIds.add("E_IVS_Smoking");
|
||||
eventIds.add("E_IVS_NotWear3ColorVest");
|
||||
eventIds.add("E_IVS_FaceRecognition");
|
||||
}
|
||||
|
||||
/**
|
||||
* 清新互联平台事件推送接口
|
||||
*
|
||||
* @param xml
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("xmlAnalysis")
|
||||
public String xmlAnalysis(@RequestBody String xml) {
|
||||
try {
|
||||
// 设置对象锁
|
||||
boolean flag = BED_LOCK.tryLock(10L * 1000L, TimeUnit.MILLISECONDS);
|
||||
if (flag) {
|
||||
boolean existence = false;
|
||||
//解析xml字符串为Document
|
||||
Document doc = null;
|
||||
//事件ID
|
||||
String evenID = null;
|
||||
//身份证号
|
||||
String idCard = null;
|
||||
//事件时间
|
||||
String eventTime = DateTimeHelper.getNowTime();
|
||||
//解析xml内容
|
||||
doc = DocumentHelper.parseText(xml);
|
||||
//获取根节点
|
||||
Element root = doc.getRootElement();
|
||||
//获取根节点下的所有M子节点
|
||||
Iterator it = root.elementIterator("E");
|
||||
//获取单个事件
|
||||
if (it != null) {
|
||||
Element element = (Element) it.next();
|
||||
String id = element.attributeValue("ID");
|
||||
evenID = id;
|
||||
//获取事件发生时间
|
||||
if (StringUtils.isNotBlank(element.attributeValue("Time"))) {
|
||||
eventTime = DateTimeHelper.stampToDate(element.attributeValue("Time"));
|
||||
}
|
||||
Iterator desc2Interator = element.elementIterator("Desc2");
|
||||
if(desc2Interator != null){
|
||||
Element idCardEle = (Element) desc2Interator.next();
|
||||
idCard = idCardEle.attributeValue("IDCard");
|
||||
}
|
||||
Iterator srcInterator = element.elementIterator("Src");
|
||||
String ballName = null;
|
||||
if (srcInterator != null) {
|
||||
Element headEle = (Element) srcInterator.next();
|
||||
String puid = headEle.attributeValue("ID");
|
||||
// 十分钟内存在该事件,直接返回
|
||||
Object cacheObject = redisService.getCacheObject(evenID + "_" + puid);
|
||||
if (Objects.nonNull(cacheObject)) {
|
||||
return "error";
|
||||
}
|
||||
Iterator resInterator = headEle.elementIterator("Res");
|
||||
if (resInterator != null) {
|
||||
Element nameEle = (Element) resInterator.next();
|
||||
ballName = nameEle.attributeValue("Name");
|
||||
}
|
||||
boolean sf = eventIds.contains(evenID);
|
||||
List<DeviceUseVo> devices = null;
|
||||
if (sf) {
|
||||
devices = service.getDevices(puid);
|
||||
existence = CollectionUtils.isNotEmpty(devices) ? true : false;
|
||||
}
|
||||
//存在该设备
|
||||
if (existence) {
|
||||
switchEvent(evenID, element, eventTime, puid, ballName,idCard, devices);
|
||||
// 事件推送成功后,设置缓存
|
||||
String key = evenID + "_" + puid;
|
||||
redisService.setCacheObject(key, puid, 1L, TimeUnit.MILLISECONDS);
|
||||
} else {
|
||||
return "error";
|
||||
}
|
||||
} else {
|
||||
return "error";
|
||||
}
|
||||
} else {
|
||||
return "error";
|
||||
}
|
||||
} else {
|
||||
log.info("系统繁忙,请稍后重试");
|
||||
return "error";
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
log.error("对象锁", e);
|
||||
} catch (DocumentException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
// 确保锁被释放
|
||||
BED_LOCK.unlock();
|
||||
}
|
||||
return "ok";
|
||||
}
|
||||
|
||||
private void switchEvent(String eventId, Element element, String eventTime, String puid, String ballName,String idCard, List<DeviceUseVo> devices) {
|
||||
List<MultipartFile> files = null;
|
||||
DeviceUseVo deviceUseVo = devices.get(0);
|
||||
deviceUseVo.setWarnTime(eventTime);
|
||||
deviceUseVo.setIdCard(idCard);
|
||||
switch (eventId) {
|
||||
case "E_IVS_FaceRecognition":
|
||||
log.info(puid + ":违章事件:人脸识别");
|
||||
deviceUseVo.setWarnContent("未戴安全帽");
|
||||
files = deviceVolEvenHandler(puid, eventTime, element);
|
||||
service.addEventData(deviceUseVo, files);
|
||||
break;
|
||||
case "E_IVS_HelmetNotWear":
|
||||
log.info(puid + ":违章事件:未戴安全帽");
|
||||
deviceUseVo.setWarnContent("未戴安全帽");
|
||||
files = deviceVolEvenHandler(puid, eventTime, element);
|
||||
// service.addEventData(deviceUseVo, files);
|
||||
break;
|
||||
case "E_IVS_Smoking":
|
||||
log.info(puid + ":违章事件:吸烟行为");
|
||||
deviceUseVo.setWarnContent("吸烟行为");
|
||||
files = deviceVolEvenHandler(puid, eventTime, element);
|
||||
// service.addEventData(deviceUseVo, files);
|
||||
break;
|
||||
case "E_IVS_NotWear3ColorVest":
|
||||
log.info(puid + ":违章事件:未穿马甲");
|
||||
deviceUseVo.setWarnContent("未穿马甲");
|
||||
files = deviceVolEvenHandler(puid, eventTime, element);
|
||||
// service.addEventData(deviceUseVo, files);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private List<MultipartFile> deviceVolEvenHandler(String puid, String volTime, Element element) {
|
||||
List<MultipartFile> multipartFiles = new ArrayList<>();
|
||||
Iterator silcesInterator = element.elementIterator("Slices");
|
||||
if (silcesInterator.hasNext()) {
|
||||
Element silcesEle = (Element) silcesInterator.next();
|
||||
if (silcesEle != null) {
|
||||
Iterator silcInterator = silcesEle.elementIterator("Slice");
|
||||
if (silcInterator.hasNext()) {
|
||||
Element snapshotEle = (Element) silcInterator.next();
|
||||
if (snapshotEle != null) {
|
||||
Iterator snapshotInterator = snapshotEle.elementIterator("Snapshot");
|
||||
if (snapshotInterator.hasNext()) {
|
||||
Element TestEle = (Element) snapshotInterator.next();
|
||||
String photoBase64 = TestEle.getText();
|
||||
log.info("base64地址:{}", photoBase64);
|
||||
// MultipartFile multipartFile = BASE64DecodedMultipartFile.base64ToMultipart(photoBase64);
|
||||
// multipartFiles.add(multipartFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return multipartFiles;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.tcp.smartIdentify.mapper;
|
||||
|
||||
import com.bonus.common.entity.tcp.DeviceUseVo;
|
||||
import com.bonus.common.entity.tcp.PeopleVioVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @className:SmartIdentifyMapper
|
||||
* @author:cwchen
|
||||
* @date:2024-08-27-15:16
|
||||
* @version:1.0
|
||||
* @description:智能识别
|
||||
*/
|
||||
@Repository(value = "SmartIdentifyMapper")
|
||||
public interface SmartIdentifyMapper {
|
||||
|
||||
/**
|
||||
* 判断球机是否被班组领用
|
||||
* @param puid
|
||||
* @return boolean
|
||||
* @date 2024/8/27 15:22
|
||||
*/
|
||||
List<DeviceUseVo> getDevices(String puid);
|
||||
|
||||
/**
|
||||
* 根据身份证号获取班组成员/临时人员
|
||||
* @param idCard
|
||||
* @return List<PeopleVioVo>
|
||||
* @author cwchen
|
||||
* @date 2024/8/27 16:08
|
||||
*/
|
||||
List<PeopleVioVo> getUserByIdCard(String idCard);
|
||||
|
||||
void addWarnInfo(DeviceUseVo deviceUseVo);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.bonus.tcp.smartIdentify.service;
|
||||
|
||||
import com.bonus.common.entity.tcp.DeviceUseVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:SmartIdentifyService
|
||||
* @author:cwchen
|
||||
* @date:2024-08-27-15:15
|
||||
* @version:1.0
|
||||
* @description:智能识别
|
||||
*/
|
||||
public interface SmartIdentifyService {
|
||||
/**
|
||||
* 判断球机是否被班组领用
|
||||
*
|
||||
* @param puid
|
||||
* @return boolean
|
||||
* @date 2024/8/27 15:22
|
||||
*/
|
||||
List<DeviceUseVo> getDevices(String puid);
|
||||
|
||||
/**
|
||||
* 添加智能识别告警信息
|
||||
* @param deviceUseVo
|
||||
* @param files
|
||||
* @return void
|
||||
* @date 2024/8/27 16:00
|
||||
*/
|
||||
void addEventData(DeviceUseVo deviceUseVo, List<MultipartFile> files);
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
package com.bonus.tcp.smartIdentify.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bonus.common.core.constant.HttpStatus;
|
||||
import com.bonus.common.core.constant.SecurityConstants;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.entity.tcp.DeviceUseVo;
|
||||
import com.bonus.common.entity.tcp.PeopleVioVo;
|
||||
import com.bonus.system.api.RemoteFileService;
|
||||
import com.bonus.system.api.RemoteSourceService;
|
||||
import com.bonus.system.api.domain.SysFileSource;
|
||||
import com.bonus.tcp.smartIdentify.mapper.SmartIdentifyMapper;
|
||||
import com.bonus.tcp.smartIdentify.service.SmartIdentifyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:SmartIdentifyServiceImpl
|
||||
* @author:cwchen
|
||||
* @date:2024-08-27-15:15
|
||||
* @version:1.0
|
||||
* @description:智能识别
|
||||
*/
|
||||
@Service(value = "SmartIdentifyService")
|
||||
@Slf4j
|
||||
public class SmartIdentifyServiceImpl implements SmartIdentifyService {
|
||||
|
||||
@Resource(name = "SmartIdentifyMapper")
|
||||
private SmartIdentifyMapper mapper;
|
||||
|
||||
@Resource
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
@Resource
|
||||
private RemoteSourceService remoteSourceService;
|
||||
|
||||
@Override
|
||||
public List<DeviceUseVo> getDevices(String puid) {
|
||||
List<DeviceUseVo> list = null;
|
||||
try {
|
||||
list = mapper.getDevices(puid);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addEventData(DeviceUseVo deviceUseVo, List<MultipartFile> files) {
|
||||
// 文件ID
|
||||
String delFileId = null;
|
||||
try {
|
||||
if (StringUtils.isNotBlank(deviceUseVo.getIdCard())) {
|
||||
List<PeopleVioVo> userIds = mapper.getUserByIdCard(Sm4Utils.encode(deviceUseVo.getIdCard()));
|
||||
if (CollectionUtils.isNotEmpty(userIds)) {
|
||||
deviceUseVo.setUserId(userIds.get(0).getId());
|
||||
deviceUseVo.setPeopleType(userIds.get(0).getPeopleType());
|
||||
deviceUseVo.setWarnContent(userIds.get(0).getName() + deviceUseVo.getWarnContent());
|
||||
}
|
||||
}
|
||||
// 添加告警信息
|
||||
mapper.addWarnInfo(deviceUseVo);
|
||||
// 上传智能识别图片
|
||||
if (CollectionUtils.isNotEmpty(files)) {
|
||||
delFileId = uploadFile(files.get(0), deviceUseVo.getId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
// 添加失败-删除文件
|
||||
if (delFileId != null) {
|
||||
remoteFileService.delFile(delFileId, SecurityConstants.INNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String uploadFile(MultipartFile file, Long warnId) {
|
||||
if (file == null) {
|
||||
return null;
|
||||
}
|
||||
R result = remoteFileService.singleUploadFile(file, SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.ERROR) {
|
||||
log.error("违章照片上传失败");
|
||||
return null;
|
||||
} else if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
if (item != null) {
|
||||
SysFileSource fileVo = setResourceFileData(item, warnId);
|
||||
R<Boolean> r = null;
|
||||
try {
|
||||
r = remoteSourceService.addFileSource(fileVo, SecurityConstants.INNER);
|
||||
if (!r.getData()) {
|
||||
// 资源文件保存失败,删除文件
|
||||
remoteFileService.delFile(item.getString("fileId"), SecurityConstants.INNER);
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
return item.getString("fileId");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public SysFileSource setResourceFileData(JSONObject item, Long warnId) {
|
||||
SysFileSource fileVo = new SysFileSource();
|
||||
fileVo.setFileType(1);
|
||||
fileVo.setFilePath(item.getString("fileId"));
|
||||
fileVo.setFileSuffix(item.getString("suffix"));
|
||||
fileVo.setFileName(item.getString("fileName"));
|
||||
fileVo.setSourceId(warnId + "");
|
||||
fileVo.setSourceType("8");
|
||||
return fileVo;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?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.bonus.tcp.smartIdentify.mapper.SmartIdentifyMapper">
|
||||
<!--添加告警信息-->
|
||||
<insert id="addWarnInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_warn
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="proId != null">pro_id,</if>
|
||||
<if test="teamId != null">team_id,</if>
|
||||
<if test="devId != null">dev_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="warnContent != null and warnContent!=''">warn_content,</if>
|
||||
<if test="warnTime != null and warnTime!=''">warn_time,</if>
|
||||
<if test="devType != null">dev_type,</if>
|
||||
<if test="peopleType != null">people_type,</if>
|
||||
create_time,
|
||||
del_flag,
|
||||
id
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="proId != null">#{proId},</if>
|
||||
<if test="teamId != null">#{teamId},</if>
|
||||
<if test="devId != null">#{devId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="warnContent != null and warnContent!=''">#{warnContent},</if>
|
||||
<if test="warnTime != null and warnTime!=''">#{warnTime},</if>
|
||||
<if test="devType != null">#{devType},</if>
|
||||
<if test="peopleType != null">#{peopleType},</if>
|
||||
#{createTime}
|
||||
#{delFlag},
|
||||
null
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!--判断球机是否被班组领用-->
|
||||
<select id="getDevices" resultType="com.bonus.common.entity.tcp.DeviceUseVo">
|
||||
SELECT tdub.dev_id AS devId,
|
||||
tdu.pro_id AS proId,
|
||||
tdu.gt_id AS gtId,
|
||||
tdu.team_id AS teamId
|
||||
FROM tb_dev_use_bid tdub
|
||||
LEFT JOIN tb_dev_use tdu ON tdub.id = tdu.id
|
||||
WHERE dev_code = #{puid} AND dev_type = 'ball' AND gh_time IS NULL
|
||||
</select>
|
||||
<!--根据身份证号获取班组成员/临时人员-->
|
||||
<select id="getUserByIdCard" resultType="com.bonus.common.entity.tcp.PeopleVioVo">
|
||||
SELECT id,name,0 AS peopleType FROM tb_people tp WHERE id_card = #{idCard} AND del_flag = 0
|
||||
UNION ALL
|
||||
SELECT id,name,0 AS peopleType FROM tb_ls_user tlu WHERE id_card = #{idCard}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue