打卡11

所花时间(包括上课):

 2h

代码量(行):

 100左右

搏客量(篇):

 1

了解到的知识点:

 mybits

备注(其他):

 

 

package com.leap.jixianceshiboot.service.impl;


import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.leap.jixianceshiboot.entity.Policy;
import com.leap.jixianceshiboot.entity.PolicyTypeCount;
import com.leap.jixianceshiboot.mapper.PolicyQueryMapper;
import com.leap.jixianceshiboot.service.PolicyQueryService;
import com.leap.jixianceshiboot.util.PageBean;
import com.leap.jixianceshiboot.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class PolicyQueryServiceImpl implements PolicyQueryService {
@Autowired
private PolicyQueryMapper policyQueryMapper;

@Override
public PageBean<Policy> getPolicy(Integer pageNum, Integer pageSize, String name,String document,String organ,String text) {
PageBean<Policy> pageBean = new PageBean<>();

//开启分页查询PageHelper
PageHelper.startPage(pageNum,pageSize);
List<Policy> list = policyQueryMapper.getPolicy(name,document,organ,text);
Page<Policy> p = (Page<Policy>) list;

pageBean.setTotal(p.getTotal());
pageBean.setItems(p.getResult());
return pageBean;
}

@Override
public PageBean<Policy> getPolicy1(Integer pageNum, Integer pageSize, String type) {
PageBean<Policy> pageBean = new PageBean<>();

//开启分页查询PageHelper
PageHelper.startPage(pageNum,pageSize);
List<Policy> list = policyQueryMapper.getPolicy1(type);
Page<Policy> p = (Page<Policy>) list;

pageBean.setTotal(p.getTotal());
pageBean.setItems(p.getResult());
return pageBean;
}
@Override
public List<PolicyTypeCount> getPolicyCountsByType() {
return policyQueryMapper.findPolicyCountsByType();
}

@Override
public List<Policy> queryPolicy(String name) {
return policyQueryMapper.queryPolicy(name);
}

@Override
public List<Policy> getAll() {
return policyQueryMapper.getAll();
}
}
package com.leap.jixianceshiboot.mapper;
import com.leap.jixianceshiboot.entity.Policy;
import com.leap.jixianceshiboot.entity.PolicyTypeCount;
import com.leap.jixianceshiboot.util.Result;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface PolicyQueryMapper{
public List<Policy> getPolicy(String name,String document,String organ,String text);
List<PolicyTypeCount> findPolicyCountsByType();
List<Policy> getPolicy1(String type);

List<Policy> queryPolicy(String name);

List<Policy> getAll();
}

posted @   平安喜乐×  阅读(3)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
· 为什么 退出登录 或 修改密码 无法使 token 失效
点击右上角即可分享
微信分享提示