package com.gunshi.project.hsz.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gunshi.project.hsz.mapper.RiceGrowConfigMapper; import com.gunshi.project.hsz.model.RiceGrowConfig; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * 描述: 水稻生长配置 * author: xusan * date: 2024-09-04 13:42:40 */ @Service @Slf4j @Transactional(rollbackFor = Exception.class) public class RiceGrowConfigService extends ServiceImpl { public RiceGrowConfig selectByRiceWaterId(Long riceWaterId) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(RiceGrowConfig::getRiceWaterId, riceWaterId); return this.baseMapper.selectOne(queryWrapper); } public void removeByRiceWaterId(Long riceWaterId) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(RiceGrowConfig::getRiceWaterId, riceWaterId); this.remove(queryWrapper); } }