You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
3.4 KiB
95 lines
3.4 KiB
package com.example.demo.serviceImpl;
|
|
|
|
import com.example.demo.domain.entity.DetailY;
|
|
import com.example.demo.domain.entity.UserDetailExport;
|
|
import com.example.demo.domain.vo.DetailExport;
|
|
import com.example.demo.domain.vo.DetailYgold;
|
|
import com.example.demo.domain.vo.SumDetailY;
|
|
import com.example.demo.mapper.DetailYMapper;
|
|
import com.example.demo.sevice.DetailYService;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.cache.annotation.CacheConfig;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import java.util.List;
|
|
|
|
@Service
|
|
@Transactional
|
|
@RequiredArgsConstructor
|
|
@CacheConfig(cacheNames = "detailY")
|
|
public class DetailYServiceImpl implements DetailYService {
|
|
|
|
private final DetailYMapper detailYMapper;
|
|
|
|
@Override
|
|
public int add(DetailY detailY) {
|
|
return detailYMapper.add(detailY);
|
|
}
|
|
@Cacheable(key = "#root.method.name + ':' + #detailY.hashCode()")
|
|
@Override
|
|
public DetailY getCount(DetailY detailY) {
|
|
return detailYMapper.getCount(detailY);
|
|
}
|
|
|
|
@Override
|
|
public DetailYgold getgold(DetailYgold detailYgold) {
|
|
return (DetailYgold) detailYMapper.selectgold(detailYgold);
|
|
}
|
|
@Cacheable(key = "#root.method.name + ':' + #pageNum + '-' + #pageSize + '-' + #detailYgold.hashCode()")
|
|
@Override
|
|
public PageInfo<DetailYgold> selectgold(int pageNum, int pageSize, DetailYgold detailYgold) {
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
List<DetailYgold> list = detailYMapper.selectgold(detailYgold);
|
|
return new PageInfo<>(list);
|
|
}
|
|
|
|
|
|
@Cacheable(key = "#root.method.name + ':' + #pageNum + '-' + #pageSize + '-' + #detailY.hashCode()")
|
|
@Override
|
|
public PageInfo<DetailY> getDetailByPage(int pageNum, int pageSize, DetailY detailY) {
|
|
if(detailY.getNum()!=null) {
|
|
if (detailY.getNum().equals("1")) {
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
List<DetailY> list = detailYMapper.select(detailY);
|
|
return new PageInfo<>(list);
|
|
} else if (detailY.getNum().equals("2")) {
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
List<DetailY> list = detailYMapper.select1(detailY);
|
|
return new PageInfo<>(list);
|
|
}
|
|
}
|
|
else if (detailY.getNum() == null) {
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
List<DetailY> list = detailYMapper.select(detailY);
|
|
return new PageInfo<>(list);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public List<UserDetailExport> searchAll(DetailExport detailExport) {
|
|
return detailYMapper.searchAll(detailExport);
|
|
}
|
|
|
|
@Override
|
|
public List<SumDetailY> getDetailY(SumDetailY sumdetailY) {
|
|
System.out.println("------------------------------------------------------------------");
|
|
System.out.println(detailYMapper.getDetailY(sumdetailY));
|
|
System.out.println("------------------------------------------------------------------");
|
|
return detailYMapper.getDetailY(sumdetailY);
|
|
}
|
|
|
|
@Override
|
|
public List<String> getarea() {
|
|
return detailYMapper.getarea();
|
|
}
|
|
|
|
// @Override
|
|
// public List<UserDetailExport> searchAll(UserDetailExport userDetailExport) {
|
|
// return detailYMapper.searchExport();
|
|
// }
|
|
}
|