所花时间(包括上课): |
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;标签:11,jixianceshiboot,String,List,leap,import,打卡,com From: https://www.cnblogs.com/pinganxile/p/18256648
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();
}