|
|
@@ -1,21 +1,21 @@
|
|
|
package com.template.services.impl;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.template.mapper.WelcomeStudentMapper;
|
|
|
-import com.template.model.pojo.WelcomeAccount;
|
|
|
-import com.template.model.pojo.WelcomeStudent;
|
|
|
import com.template.model.pojo.WelcomeStudent;
|
|
|
-import com.template.mapper.WelcomeStudentMapper;
|
|
|
-import com.template.model.pojo.WelcomeVisitor;
|
|
|
import com.template.model.result.PageUtils;
|
|
|
-import com.template.model.vo.*;
|
|
|
+import com.template.model.vo.CheckInVo;
|
|
|
+import com.template.model.vo.StudentPageVo;
|
|
|
+import com.template.model.vo.StudentRegisterVo;
|
|
|
+import com.template.model.vo.StudentSexRatioVo;
|
|
|
+import com.template.model.vo.StudentTotalVo;
|
|
|
+import com.template.model.vo.StudentTrafficVo;
|
|
|
import com.template.services.WelcomeStudentService;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
@@ -203,13 +203,23 @@ public class WelcomeStudentServiceImpl extends ServiceImpl<WelcomeStudentMapper,
|
|
|
|
|
|
@Override
|
|
|
public void updateCarNumber(String studentCard, String carNumber) {
|
|
|
- // 创建 UpdateWrapper 对象,用于构建更新条件
|
|
|
- UpdateWrapper<WelcomeStudent> updateWrapper = new UpdateWrapper<>();
|
|
|
- // 设置更新条件,根据学生卡号筛选记录
|
|
|
- updateWrapper.eq("admiss_num", studentCard);
|
|
|
- // 设置要更新的字段,将车牌号更新为传入的值
|
|
|
- updateWrapper.set("car_number", carNumber);
|
|
|
- // 执行更新操作
|
|
|
- welcomeStudentMapper.update(null, updateWrapper);
|
|
|
+ LambdaQueryWrapper<WelcomeStudent> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(WelcomeStudent::getAdmissNum, studentCard);
|
|
|
+
|
|
|
+ WelcomeStudent student = getOne(queryWrapper);
|
|
|
+ if (ObjectUtil.isNotNull(student)) {
|
|
|
+ WelcomeStudent updateStudent = new WelcomeStudent();
|
|
|
+ updateStudent.setId(student.getId());
|
|
|
+ updateStudent.setCarNumber(carNumber);
|
|
|
+
|
|
|
+ updateById(updateStudent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int countByStudentCard(String studentCard) {
|
|
|
+ LambdaQueryWrapper<WelcomeStudent> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(WelcomeStudent::getAdmissNum, studentCard);
|
|
|
+ return count(queryWrapper);
|
|
|
}
|
|
|
}
|