| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.TNoticeMapper; |
| | | import com.ruoyi.system.model.TNotice; |
| | | import com.ruoyi.system.model.TNotice; |
| | | import com.ruoyi.system.query.TNoticeQuery; |
| | | import com.ruoyi.system.service.TNoticeService; |
| | | import com.ruoyi.system.vo.TChildcareServicesVO; |
| | | import com.ruoyi.system.vo.TNoticeVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TNoticeServiceImpl extends ServiceImpl<TNoticeMapper, TNotice> implements TNoticeService { |
| | | |
| | | @Override |
| | | public boolean isExit(TNotice dto) { |
| | | if(StringUtils.isNotEmpty(dto.getId())){ |
| | | // 修改 |
| | | return this.count(Wrappers.lambdaQuery(TNotice.class).ne(TNotice::getId, dto.getId()).eq(TNotice::getNoticeTitle, dto.getNoticeTitle())) > 0; |
| | | }else { |
| | | // 新增 |
| | | return this.count(Wrappers.lambdaQuery(TNotice.class).eq(TNotice::getNoticeTitle, dto.getNoticeTitle())) > 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TNoticeVO> pageList(TNoticeQuery query) { |
| | | PageInfo<TNoticeVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TNoticeVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |