package cn.datax.service.system.dao;

import cn.datax.service.system.api.entity.UserPostEntity;
import cn.datax.common.base.BaseDao;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yuwei
 * @since 2019-09-11
 */
@Mapper
public interface UserPostDao extends BaseDao<UserPostEntity> {

    void insertBatch(List<UserPostEntity> list);

    @Delete("delete from sys_user_post where user_id = #{id}")
    void deleteByUserId(String id);

    @Delete("<script>" +
            "delete from sys_user_post where user_id in <foreach collection='list' item='id' open='(' separator=',' close=')'>#{id}</foreach>" +
            "</script>")
    void deleteByUserIds(List<String> ids);
}
