package com.pj.project.tb_business_people;

import java.util.List;

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 com.pj.utils.sg.*;
import org.springframework.transaction.annotation.Transactional;

/**
 * Service: tb_business_people -- 核酸检测人员
 * @author qzy 
 */
@Service
@Transactional
public class TbBusinessPeopleService extends ServiceImpl<TbBusinessPeopleMapper,TbBusinessPeople>  implements IService<TbBusinessPeople> {

	/** 底层 Mapper 对象 */
	@Autowired
	TbBusinessPeopleMapper tbBusinessPeopleMapper;

	/** 增 */
	int add(TbBusinessPeople t){
		return tbBusinessPeopleMapper.add(t);
	}



	/** 改 */
	int update(TbBusinessPeople t){
		return tbBusinessPeopleMapper.update(t);
	}

	/** 查 */
	TbBusinessPeople getById(Long id){
		return tbBusinessPeopleMapper.getById(id);
	}

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


	public void removeByBusinessId(String businessId) {
		QueryWrapper<TbBusinessPeople>ew=new QueryWrapper<>();
		ew.eq("business_id",businessId);
		this.remove(ew);
	}

	public List<TbBusinessPeople> findByBusinessId(String businessId) {
		QueryWrapper<TbBusinessPeople>ew=new QueryWrapper<>();
		ew.eq("business_id",businessId);
		return list(ew);
	}
}
