package com.pj.project.sys_dict_item;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pj.utils.so.SoMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Service: sys_dict_item -- 
 * @author qzyReal 
 */
@Service
public class SysDictItemService  extends ServiceImpl <SysDictItemMapper,SysDictItem> implements IService<SysDictItem>  {

	/** 底层 Mapper 对象 */
	@Autowired
	SysDictItemMapper sysDictItemMapper;

	/** 增 */
	int add(SysDictItem s){
		return sysDictItemMapper.add(s);
	}

	/** 删 */
	int delete(String id){
		return sysDictItemMapper.delete(id);
	}

	/** 改 */
	int update(SysDictItem s){
		return sysDictItemMapper.update(s);
	}

	/** 查 */
	SysDictItem getById(String id){
		return sysDictItemMapper.getById(id);
	}

	/** 查集合 - 根据条件（参数为空时代表忽略指定条件） */  
	List<SysDictItem> getList(SoMap so) {
		return sysDictItemMapper.getList(so);	
	}
	

	public List<SysDictItem> findByDictId(Long dictId){
		QueryWrapper<SysDictItem>ew=new QueryWrapper<>();
		ew.eq("dict_id",dictId);
		return this.list(ew);
	}
}
