package com.hxzkappboot.service.impl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.hxzkappboot.mapper.TbWarningMapper;
|
import com.hxzkappboot.mapper.TbWarnmesMapper;
|
import com.hxzkappboot.pojo.TbDepartment;
|
import com.hxzkappboot.pojo.TbWarning;
|
import com.hxzkappboot.pojo.TbWarnmes;
|
import com.hxzkappboot.service.TbWarningService;
|
import com.hxzkappboot.service.TbWarnmesService;
|
import org.springframework.stereotype.Service;
|
|
import java.text.SimpleDateFormat;
|
import java.util.Date;
|
|
|
@Service
|
public class TbWarnmesServiceImpl extends ServiceImpl<TbWarnmesMapper, TbWarnmes> implements TbWarnmesService {
|
|
public int updateBumen(TbWarnmes tbFence) {
|
|
tbFence.setAddtime(this.gettime());
|
return baseMapper.insert(tbFence);
|
}
|
|
public String gettime(){
|
Date now = new Date();
|
// 创建日期格式化对象,设置格式为 "yyyy-MM-dd HH:mm"
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
// 格式化日期对象,输出字符串结果
|
String formattedDate = sdf.format(now);
|
return formattedDate;
|
}
|
}
|