src/com/shop/serviceImpl/CategoryServiceImpl.java

(完整代码) 1KB

package com.shop.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.shop.mapper.CategoryMapper;
import com.shop.po.Category;
import com.shop.po.CategoryExample;
import com.shop.service.CategoryService;


public class CategoryServiceImpl implements CategoryService{

	@Autowired
	private CategoryMapper categoryMapper;
	
	@Override//查询一级目录
	public List<Category> findCategory() throws Exception {
		List<Category> list = categoryMapper.findCategoryAndSecondcategory();
		if(list!=null && list.size()>0){
			return list;
		}
		return null;
	}
	@Override
	public void addCategory(Category addCategory) throws Exception {
		categoryMapper.insert(addCategory);
	}
	
	@Override
	public List<Category> adminbFindCategory() {
		System.out.println("3333333333333");
		CategoryExample example = new CategoryExample();
		
		List<Category> list = categoryMapper.selectByExample(example);
		if(list!=null && list.size()>0){
			return list;
		}
		return null;
	}
	@Override
	public Category findCategory(int cid) throws Exception {
		return categoryMapper.selectByPrimaryKey(cid);
	}
	@Override
	public void adminCategory_update(Category category) {
		categoryMapper.updateByPrimaryKey(category);
	}
	@Override
	public void deleteCategoryByCid(int cid) throws Exception {
		categoryMapper.deleteByPrimaryKey(cid);
	}
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。