package com.gkhy.safePlatform.targetDuty.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.safePlatform.targetDuty.repository.RewardPunishmentStandardRepository; import com.gkhy.safePlatform.targetDuty.entity.RewardPunishmentStandard; import com.gkhy.safePlatform.targetDuty.service.RewardPunishmentStandardService; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import com.gkhy.safePlatform.commons.enums.ResultCodes; import com.gkhy.safePlatform.commons.query.PageQuery; import com.gkhy.safePlatform.commons.vo.ResultVO; import com.gkhy.safePlatform.commons.vo.SearchResultVO; import com.gkhy.safePlatform.targetDuty.model.dto.req.RewardPunishmentStandardQueryCriteria; import com.gkhy.safePlatform.targetDuty.model.dto.resp.RewardPunishmentStandardDto; import com.gkhy.safePlatform.targetDuty.utils.QueryHelpPlus; import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; import java.util.List; /** * (RewardPunishmentStandard)表服务实现类 * * @author xurui * @since 2022-07-21 10:20:10 */ @Service("rewardPunishmentStandardService") public class RewardPunishmentStandardServiceImpl extends ServiceImpl implements RewardPunishmentStandardService { @Autowired private RewardPunishmentStandardRepository rewardPunishmentStandardRepository; @Override public ResultVO queryAll(PageQuery pageQuery) { Long pageIndex = pageQuery.getPageIndex(); Long pageSize = pageQuery.getPageSize(); IPage page = new Page<>(pageIndex, pageSize); page = baseMapper.selectPage(page, QueryHelpPlus.getPredicate(RewardPunishmentStandard.class, pageQuery.getSearchParams())); List respList = BeanCopyUtils.copyBeanList(page.getRecords(), RewardPunishmentStandardDto.class); return new SearchResultVO<>( true, pageIndex, pageSize,page.getPages(), page.getTotal(), respList, ResultCodes.OK ); } @Override public List queryAll(RewardPunishmentStandardQueryCriteria criteria) { return baseMapper.selectList(QueryHelpPlus.getPredicate(RewardPunishmentStandard.class, criteria)); } }