package com.sptg.estate.biz.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.sptg.estate.api.entity.ServerUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * title: ServerUserMapper
 * package: com.sptg.estate.biz.mapper
 * description: 服务人员-DAO接口
 *
 *                
 *                 
 */
public interface ServerUserMapper extends BaseMapper<ServerUser> {
    /**
     * 功能描述:更新启用状态
     * @param id
     * @param isEnable
     * @return boolean
     *                
     *                       
     */
    @Update("update  estate_server_user set   i_is_enable=#{isEnable} where  l_id=#{id} and i_status=0 ")
    public Integer updateIsEnable(@Param(value ="id") long id,@Param(value ="isEnable") int isEnable);
    /**
     * 功能描述:批量删除服务人员更新删除状态
     * @param ids
     * @return int
     *                
     *                       
     */
    @Update("<script>update  estate_server_user set   i_status=-1 " +
            "where  " +
            "l_id in " +
            "<foreach collection='ids' index='index' item='item' " +
            "        separator=',' open='(' close=')'> " +
            "        #{item} " +
            "    </foreach>" +
            "</script>")
    public Integer deleteServerUserList(@Param(value ="ids") List<Long> ids);
}
