34 lines
1.3 KiB
Java
34 lines
1.3 KiB
Java
|
|
package com.gunshi.project.ss.service;
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||
|
|
import com.gunshi.project.ss.mapper.RiceIrrigationUseMapper;
|
||
|
|
import com.gunshi.project.ss.model.RiceIrrigationUse;
|
||
|
|
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);
|
||
|
|
}
|
||
|
|
}
|