From e5c29d6ac2b210a9385723598d79a42ae5a9679e Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 23 四月 2025 15:20:13 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrIrrigateSchedulingSv.java | 97 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 97 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrIrrigateSchedulingSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrIrrigateSchedulingSv.java new file mode 100644 index 0000000..cd4dbe7 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrIrrigateSchedulingSv.java @@ -0,0 +1,97 @@ +package com.dy.pipIrrIrrigate.irrigateScheduling; + +import com.dy.common.webUtil.QueryResultVo; +import com.dy.pipIrrGlobal.daoIr.IrIrrigateSchedulingMapper; +import com.dy.pipIrrGlobal.pojoIr.IrIrrigateScheduling; +import com.dy.pipIrrGlobal.voIr.VoScheduling; +import com.dy.pipIrrGlobal.voIr.VoSchedulingOne; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.common.utils.PojoUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @author :WuZeYu + * @Date :2024/5/27 10:12 + * @LastEditTime :2024/5/27 10:12 + * @Description + */ +@Slf4j +@Service +public class IrIrrigateSchedulingSv { + + @Autowired + private IrIrrigateSchedulingMapper irIrrigateSchedulingMapper; + + /** + * 娣诲姞浣滅墿鐏屾簤鍒跺害 + * + * @param po + * @return + */ + public Integer addScheduling(IrIrrigateScheduling po) { + po.setDeleted((byte) 0); + po.setOperateDt(new Date()); + int rows = irIrrigateSchedulingMapper.insertSelective(po); + if (rows == 0) { + return 0; + } + return 1; + } + /** + * 鍒犻櫎浣滅墿鐏屾簤鍒跺害 + * + * @param id + */ + public Integer deleteScheduling(Long id) { + int rows = irIrrigateSchedulingMapper.deleteLogicById(id); + if (rows == 0) { + return 0; + } + return 1; + } + + /** + * 淇敼浣滅墿鐏屾簤鍒跺害 + * @param po + * @return + */ + public Integer updateScheduling(IrIrrigateScheduling po){ + int rows = irIrrigateSchedulingMapper.updateByPrimaryKeySelective(po); + if (rows == 0){ + return 0; + } + return 1; + } + + /** + * 鍒嗛〉鏌ヨ浣滅墿鐏屾簤鍒跺害 + * @param queryVo + * @return + */ + public QueryResultVo<List<VoScheduling>> getSchedulings(QueryVo queryVo){ + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); + Long itemTotal = irIrrigateSchedulingMapper.getRecordCount(params); + + QueryResultVo<List<VoScheduling>> rsVo = new QueryResultVo<>(); + rsVo.pageSize = queryVo.pageSize; + rsVo.pageCurr = queryVo.pageCurr; + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = irIrrigateSchedulingMapper.getSchedulings(params); + return rsVo; + } + + /** + * 鑾峰彇涓�涓綔鐗╃亴婧夊埗搴︽暟鎹� + * @param id + * @return + */ + public VoSchedulingOne selectById(Long id){ + VoSchedulingOne irCrop = irIrrigateSchedulingMapper.selectById(id); + return irCrop; + } +} -- Gitblit v1.8.0