#
Junjie
10 小时以前 3778e2dd638f53db1ff2b61cbc2ce8a9f9a93f28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.zy.system.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.system.entity.UserLogin;
import com.zy.system.mapper.UserLoginMapper;
import com.zy.system.service.UserLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.Date;
 
@Service("userLoginService")
public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin> implements UserLoginService {
 
    @Autowired
    private UserLoginMapper userLoginMapper;
 
    @Override
    public int selectCountByCurrentWeek() {
        return userLoginMapper.selectCountByCurrentWeek();
    }
 
    @Override
    public boolean save(UserLogin entity) {
        if (entity != null && entity.getId() == null && entity.getCreateTime() == null) {
            entity.setCreateTime(new Date());
        }
        return super.save(entity);
    }
}