package com.hxzk.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageInfo;
|
import com.hxzk.mapper.TbZypLiftingMapper;
|
import com.hxzk.pojo.TbZypLifting;
|
import com.hxzk.service.TbZypLiftingService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.time.LocalDate;
|
import java.time.format.DateTimeFormatter;
|
import java.util.List;
|
|
/**
|
* <p>
|
* 航锦化工吊装安全作业证 服务实现类
|
* </p>
|
*
|
* @author wangfei
|
* @since 2024-04-23
|
*/
|
@Service
|
public class TbZypLiftingServiceImpl extends ServiceImpl<TbZypLiftingMapper, TbZypLifting> implements TbZypLiftingService {
|
@Autowired
|
TbZypLiftingMapper tbZypLiftingMapper;
|
|
@Override
|
public PageInfo<TbZypLifting> findAll(Integer page, Integer limit) {
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
PageHelper.startPage(page,limit);
|
List<TbZypLifting> tbFireSafeties = baseMapper.selectList(queryWrapper);
|
PageInfo<TbZypLifting> info = new PageInfo<>(tbFireSafeties);
|
return info;
|
}
|
|
@Override
|
public PageInfo<TbZypLifting> findSearch(Integer page, Integer limit,String applicant,String code) {
|
List<TbZypLifting> cardList = null;
|
// if (acHistoryPower.getAddtime() == null){
|
LocalDate currentDate = LocalDate.now();
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
String formattedDate = currentDate.format(formatter);
|
// acHistoryPower.setAddtime(formattedDate);
|
QueryWrapper<TbZypLifting> queryWrapper = new QueryWrapper<>();
|
queryWrapper.like("code", code)
|
.like("applicant", applicant);
|
cardList = tbZypLiftingMapper.selectList(queryWrapper);
|
// }else{
|
// cardList = acHistroyPowerDao.findSearch(acHistoryPower);
|
// }
|
PageInfo<TbZypLifting> info = new PageInfo<>(cardList);
|
return info;
|
}
|
@Override
|
public TbZypLifting findtagidZypLifting(Integer id) {
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
queryWrapper.eq("id",id);
|
return baseMapper.selectOne(queryWrapper);
|
}
|
|
@Override
|
public int addZypLifting(TbZypLifting tbZypLifting) {
|
return getBaseMapper().insert(tbZypLifting);
|
}
|
|
@Override
|
public void updateZypLifting(TbZypLifting tbZypLifting) {
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
queryWrapper.eq("id",tbZypLifting.getId());
|
baseMapper.update(tbZypLifting,queryWrapper);
|
}
|
|
@Override
|
public void deleteZypLifting(Integer id) {
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
queryWrapper.eq("id",id);
|
baseMapper.delete(queryWrapper);
|
}
|
}
|