diff --git a/src/main/java/com/service/SubClassifyInfoService.java b/src/main/java/com/service/SubClassifyInfoService.java new file mode 100644 index 0000000..79709a3 --- /dev/null +++ b/src/main/java/com/service/SubClassifyInfoService.java @@ -0,0 +1,56 @@ +package com.example.service; + +import cn.hutool.json.JSONUtil; +import com.example.dao.SubClassifyInfoDao; +import org.springframework.stereotype.Service; +import com.example.entity.SubClassifyInfo; +import com.example.entity.AuthorityInfo; +import com.example.entity.Account; +import com.example.vo.SubClassifyInfoVo; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +@Service +public class SubClassifyInfoService { + + @Resource + private SubClassifyInfoDao subClassifyInfoDao; + + public SubClassifyInfo add(SubClassifyInfo subClassifyInfo) { + subClassifyInfoDao.insertSelective(subClassifyInfo); + return subClassifyInfo; + } + + public void delete(Long id) { + subClassifyInfoDao.deleteByPrimaryKey(id); + } + + public void update(SubClassifyInfo subClassifyInfo) { + subClassifyInfoDao.updateByPrimaryKeySelective(subClassifyInfo); + } + + public SubClassifyInfo findById(Long id) { + return subClassifyInfoDao.selectByPrimaryKey(id); + } + + public List findAll() { + return subClassifyInfoDao.findByName("all"); + } + + public PageInfo findPage(String name, Integer pageNum, Integer pageSize, HttpServletRequest request) { + PageHelper.startPage(pageNum, pageSize); + List all = findAllPage(request, name); + return PageInfo.of(all); + } + + public List findAllPage(HttpServletRequest request, String name) { + return subClassifyInfoDao.findByName(name); + } + +}