whyclxw
2025-05-15 96510a549bfb313920bf297b28089c4cf57f0146
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
31
package com.whyc.config;
 
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.whyc.mapper.AppLoginOutMapper;
import com.whyc.pojo.plus_user.AppLoginOut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.Transactional;
 
import javax.annotation.PostConstruct;
import java.util.Date;
 
@Configuration
public class ApplLoginOutConifg {
 
    @Autowired(required = false)
    private AppLoginOutMapper mapper;
 
    @PostConstruct
    @Transactional
    public void cleanupData() {
        UpdateWrapper wrapper=new UpdateWrapper();
        wrapper.gt("num",0);
        mapper.delete(wrapper);
        AppLoginOut app=new AppLoginOut();
        app.setUname("restart");
        app.setSessionid("0");
        app.setCreateTime(new Date());
        mapper.insert(app);
    }
}