New file |
| | |
| | | package com.dy.pipIrrBase.rtuUpgrade.task; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.UgRtuTaskMapper; |
| | | import com.dy.pipIrrGlobal.pojoUg.UgRtuTask; |
| | | 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 org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/11/5 8:33 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class UgRtuTaskSv { |
| | | |
| | | @Autowired |
| | | private UgRtuTaskMapper dao ; |
| | | |
| | | /** |
| | | * 得到一个一些升级程序 |
| | | * @param id 一些升级程序ID |
| | | * @return 一些升级程序实体 |
| | | */ |
| | | public UgRtuTask selectById(Long id){ |
| | | return this.dao.selectByPrimaryKey(id) ; |
| | | } |
| | | |
| | | /** |
| | | * 得到一些升级程序 |
| | | * @return 一些升级程序 |
| | | */ |
| | | public QueryResultVo<List<UgRtuTask>> selectSome(QueryTaskVo queryVo){ |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ; |
| | | Long itemTotal = this.dao.selectTotal(params) ; |
| | | |
| | | QueryResultVo<List<UgRtuTask>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = this.dao.selectSome(params) ; |
| | | |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 得到所有升级程序记录ID和文件名称 |
| | | * @return 一些升级程序 |
| | | */ |
| | | public QueryResultVo<List<UgRtuTask>> selectAll(){ |
| | | QueryResultVo<List<UgRtuTask>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.obj = this.dao.selectAll() ; |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 新增保存分水口实体 |
| | | * @param po 实体 |
| | | * @return 数量 |
| | | */ |
| | | @Transactional |
| | | public int save(UgRtuTask po){ |
| | | return this.dao.insertSelective(po) ; |
| | | } |
| | | /** |
| | | * 保存修改实体 |
| | | * @param po 实体 |
| | | * @return 数量 |
| | | */ |
| | | @Transactional |
| | | public int update(UgRtuTask po){ |
| | | return this.dao.updateByPrimaryKeySelective(po) ; |
| | | } |
| | | |
| | | /** |
| | | * 执行任务 |
| | | * @param id 实体ID |
| | | * @return 数量 |
| | | */ |
| | | @Transactional |
| | | public int execute(Long id){ |
| | | return this.dao.executeById(id) ; |
| | | } |
| | | |
| | | /** |
| | | * 结束任务 |
| | | * @param id 实体ID |
| | | * @return 数量 |
| | | */ |
| | | @Transactional |
| | | public int over(Long id){ |
| | | return this.dao.overById(id) ; |
| | | } |
| | | |
| | | /** |
| | | * 执行任务 |
| | | * @param id 实体ID |
| | | * @return 数量 |
| | | */ |
| | | @Transactional |
| | | public int isExecute(Long id){ |
| | | return this.dao.isExecuteById(id) ; |
| | | } |
| | | |
| | | /** |
| | | * 结束任务 |
| | | * @param id 实体ID |
| | | * @return 数量 |
| | | */ |
| | | @Transactional |
| | | public int isOver(Long id){ |
| | | return this.dao.isOverById(id) ; |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除实体 |
| | | * @param id 实体ID |
| | | * @return 数量 |
| | | */ |
| | | @Transactional |
| | | public int delete(Long id){ |
| | | return this.dao.deleteLogicById(id) ; |
| | | } |
| | | |
| | | } |