| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.TBroadcast; |
| | | import com.stylefeng.guns.modular.system.dao.TBroadcastMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITBroadcastService; |
| | |
| | | private TBroadcastMapper tBroadcastMapper; |
| | | |
| | | @Override |
| | | public Boolean isExit(String id, Integer sort) { |
| | | public Boolean isExit(Integer id, Integer sort) { |
| | | Integer count = tBroadcastMapper.selectCount(new EntityWrapper<TBroadcast>() |
| | | .eq("sort", sort)); |
| | | if (StringUtils.hasLength(id)) { |
| | | .eq("sort", sort) |
| | | .ne("status", StatusEnum.DELETE.getCode())); |
| | | if (Objects.nonNull(id)) { |
| | | // 修改 |
| | | TBroadcast tBroadcast = tBroadcastMapper.selectById(id); |
| | | return Objects.nonNull(tBroadcast) && !tBroadcast.getSort().equals(sort) && count > 0; |