songhuangfeng123
2022-08-02 aace11a7e1201a8d1fc0b50b659368918d23e794
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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<RewardPunishmentStandardRepository, RewardPunishmentStandard> implements RewardPunishmentStandardService {
 
    @Autowired
    private RewardPunishmentStandardRepository rewardPunishmentStandardRepository;
 
 
 
    @Override
    public ResultVO queryAll(PageQuery<RewardPunishmentStandardQueryCriteria> pageQuery) {
        Long pageIndex = pageQuery.getPageIndex();
        Long pageSize = pageQuery.getPageSize();
        IPage<RewardPunishmentStandard> page = new Page<>(pageIndex, pageSize);
 
        page = baseMapper.selectPage(page,
                QueryHelpPlus.getPredicate(RewardPunishmentStandard.class, pageQuery.getSearchParams()));
        List<RewardPunishmentStandardDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), RewardPunishmentStandardDto.class);
 
        return new SearchResultVO<>(
                true,
                pageIndex,
                pageSize,page.getPages(),
                page.getTotal(),
                respList,
                ResultCodes.OK
        );
    }
 
 
    @Override
    public List<RewardPunishmentStandard> queryAll(RewardPunishmentStandardQueryCriteria criteria) {
        return baseMapper.selectList(QueryHelpPlus.getPredicate(RewardPunishmentStandard.class, criteria));
    }
}