gunshi-project-ss/src/main/java/com/gunshi/project/ss/service/RiceIrrigationUseService.java

34 lines
1.3 KiB
Java
Raw Normal View History

2025-12-29 17:13:09 +08:00
package com.gunshi.project.ss.service;
2025-11-26 15:23:02 +08:00
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
2025-12-29 17:13:09 +08:00
import com.gunshi.project.ss.mapper.RiceIrrigationUseMapper;
import com.gunshi.project.ss.model.RiceIrrigationUse;
2025-11-26 15:23:02 +08:00
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* :
* author: xusan
* date: 2024-09-04 13:42:40
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class RiceIrrigationUseService extends ServiceImpl<RiceIrrigationUseMapper, RiceIrrigationUse> {
public List<RiceIrrigationUse> selectByRiceWaterId(Long riceWaterId) {
LambdaQueryWrapper<RiceIrrigationUse> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(RiceIrrigationUse::getRiceWaterId, riceWaterId);
return this.baseMapper.selectList(queryWrapper);
}
public void removeByRiceWaterId(Long riceWaterId) {
LambdaQueryWrapper<RiceIrrigationUse> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(RiceIrrigationUse::getRiceWaterId, riceWaterId);
this.remove(queryWrapper);
}
}