| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package com.template.services.impl;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.template.model.pojo.SmartApply;
- import com.template.mapper.SmartApplyMapper;
- import com.template.model.result.PageUtils;
- import com.template.model.vo.ApplyVo;
- import com.template.services.SmartApplyService;
- 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;
- import java.util.List;
- /**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author ceshi
- * @since 2023-12-04
- */
- @Service
- public class SmartApplyServiceImpl extends ServiceImpl<SmartApplyMapper, SmartApply> implements SmartApplyService {
- @Autowired
- private SmartApplyMapper smartApplyMapper;
- @Override
- public List<ApplyVo> queryApplys() {
- List<ApplyVo> result = smartApplyMapper.queryApplys();
- return result;
- }
- @Override
- public int insertSmartApply(SmartApply sa) {
- int result = smartApplyMapper.insert(sa);
- return result;
- }
- @Override
- public int updateSmartApply(SmartApply sa) {
- int result = smartApplyMapper.updateById(sa);
- return result;
- }
- @Override
- public PageUtils<SmartApply> queryPageSmartApplys(int currentPage, int pageCount, String name) {
- Page<SmartApply> page = new Page<>(currentPage, pageCount);
- QueryWrapper<SmartApply> queryWrapper = new QueryWrapper<>();
- queryWrapper.like(StringUtils.hasText(name), "name", name);
- IPage<SmartApply> result = smartApplyMapper.selectPage(page,queryWrapper);
- return new PageUtils<>(result);
- }
- @Override
- public int deleteSmartApplyById(int id) {
- int result = smartApplyMapper.deleteById(id);
- return 0;
- }
- @Override
- public SmartApply getSmartById(int id) {
- SmartApply result = smartApplyMapper.selectById(id);
- return result;
- }
- }
|