package com.zcxk.service;


import com.zcxk.dao.UserTagMapper;
import com.zcxk.entity.UserTagEntity;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Arrays;
/**
 *
 * 用户标签Service接口
 * @author: WYY
 * @date 2020-10-23 15:43
 */
@Service
public class UserTagService extends ServiceImpl<UserTagMapper,UserTagEntity> {
	@Resource
	private UserTagMapper userTagMapper;

	/**
	 * 查列表
	 */
	public List<UserTagEntity> findList(UserTagEntity userTagEntity) {
		return userTagMapper.findList(userTagEntity);
	}

	/**
	 * 批量删除
	 */
	@Transactional(rollbackFor = Exception.class)
	public boolean delUserTagByIds(Long[] ids) {
		return this.removeByIds(Arrays.asList(ids));

	}

	/**
	 * 单个删除
	 */
	public boolean delUserTagById(Long id) {
		return this.removeById(id);

	}

	/**
	 * 保存
	 */
	public boolean addUserTag(UserTagEntity userTag) {
		if (this.save(userTag)) {
			return true;
		}
		return false;
	}

	/**
	 * 修改根居ID
	 */
	public boolean updateUserTagById(UserTagEntity userTag) {
		if (this.updateById(userTag)) {
			return true;
		}
		return false;
	}

	/**
	 * 根居ID获取对象
	 */
	public UserTagEntity findUserTagById(Long id) {
		return userTagMapper.findUserTagById(id);
	}
}
