|
|
@@ -0,0 +1,30 @@
|
|
|
+package com.hfln.portal.infrastructure.service.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.hfln.portal.infrastructure.mapper.PersonInOutMapper;
|
|
|
+import com.hfln.portal.infrastructure.po.PersonInOutInfo;
|
|
|
+import com.hfln.portal.infrastructure.service.PersonInOutService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.time.LocalDate;
|
|
|
+
|
|
|
+@Service
|
|
|
+@Slf4j
|
|
|
+public class PersonInOutServiceImpl extends ServiceImpl<PersonInOutMapper, PersonInOutInfo> implements PersonInOutService {
|
|
|
+ @Override
|
|
|
+ public PersonInOutInfo queryOneByDevId(Long devId) {
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<PersonInOutInfo> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(PersonInOutInfo::getDevId, devId)
|
|
|
+ .orderByDesc(PersonInOutInfo::getCreateTime)
|
|
|
+ .last("limit 1");
|
|
|
+ return this.baseMapper.selectOne(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Long countActive(Long tenantId) {
|
|
|
+ return this.baseMapper.countActive(tenantId, LocalDate.now());
|
|
|
+ }
|
|
|
+}
|