| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package com.template.services.impl;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.template.model.pojo.SmartBuild;
- import com.template.model.pojo.SmartFreezeRecord;
- import com.template.model.pojo.SmartGrade;
- import com.template.mapper.SmartGradeMapper;
- import com.template.model.pojo.SmartIdentity;
- import com.template.services.SmartGradeService;
- 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-25
- */
- @Service
- public class SmartGradeServiceImpl extends ServiceImpl<SmartGradeMapper, SmartGrade> implements SmartGradeService {
- @Autowired
- private SmartGradeMapper smartGradeMapper;
- @Override
- public int updateSmartGrade(SmartGrade sg) {
- int result = smartGradeMapper.updateById(sg);
- return result;
- }
- @Override
- public List<SmartGrade> getSmartGrades() {
- List<SmartGrade> result = smartGradeMapper.selectList(null);
- return result;
- }
- @Override
- public int insertSmartGrade(SmartGrade sg) {
- int result = smartGradeMapper.insert(sg);
- return result;
- }
- @Override
- public int existSmartGrade(Integer gradeNo, String gradeName) {
- QueryWrapper<SmartGrade> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq(gradeNo != null, "grade_no", gradeNo);
- queryWrapper.eq(StringUtils.hasText(gradeName), "name", gradeName);
- int existCount = smartGradeMapper.selectCount(queryWrapper);
- return existCount;
- }
- @Override
- public SmartGrade querySmartGradeByBaisheng(String bsGradeNo) {
- QueryWrapper<SmartGrade> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq(StringUtils.hasText(bsGradeNo), "bs_grade_no", bsGradeNo);
- SmartGrade result = smartGradeMapper.selectOne(queryWrapper);
- return result;
- }
- }
|