| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- 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.mapper.SmartIdentityMapper;
- import com.template.model.pojo.SmartIdentity;
- import com.template.model.pojo.SmartIdentity;
- import com.template.mapper.SmartIdentityMapper;
- import com.template.model.result.PageUtils;
- import com.template.services.SmartIdentityService;
- 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;
- /**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author ceshi
- * @since 2023-12-04
- */
- @Service
- public class SmartIdentityServiceImpl extends ServiceImpl<SmartIdentityMapper, SmartIdentity> implements SmartIdentityService {
- @Autowired
- private SmartIdentityMapper smartIdentityMapper;
- @Override
- public int insertSmartIdentity(SmartIdentity sa) {
- int result = smartIdentityMapper.insert(sa);
- return result;
- }
- @Override
- public int updateSmartIdentity(SmartIdentity sa) {
- int result = smartIdentityMapper.updateById(sa);
- return result;
- }
- @Override
- public SmartIdentity queryIdentityByName(String name){
- QueryWrapper<SmartIdentity> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("name", name);
- SmartIdentity result = smartIdentityMapper.selectOne(queryWrapper);
- return result;
- }
- @Override
- public PageUtils<SmartIdentity> queryPageSmartIdentitys(int currentPage, int pageCount, String name) {
- Page<SmartIdentity> page = new Page<>(currentPage, pageCount);
- QueryWrapper<SmartIdentity> queryWrapper = new QueryWrapper<>();
- //queryWrapper.like(StringUtils.hasText(name), "name", name);
- IPage<SmartIdentity> result = smartIdentityMapper.selectPage(page,queryWrapper);
- return new PageUtils<>(result);
- }
- @Override
- public int deleteSmartIdentityById(int id) {
- int result = smartIdentityMapper.deleteById(id);
- return result;
- }
- @Override
- public SmartIdentity getSmartById(int id) {
- SmartIdentity result = smartIdentityMapper.selectById(id);
- return result;
- }
- }
|