package com.community.huiju.dao;

import com.community.huiju.model.TpTicket;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface TpTicketMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TpTicket record);

    int insertSelective(TpTicket record);

    TpTicket selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TpTicket record);

    int updateByPrimaryKey(TpTicket record);

    /**
     * 根据 小区ID 用户ID 类型 查询数据
     * @param map
     * @return
     */
    List<TpTicket> selectByCommuniytIdAndByTaUserIdAndByType(Map map);
    
    /**
     * 获取报修进度
     * @param communityId
     * @param ticketId
     * @return
     */
	TpTicket selectByTicketId(@Param("communityId") String communityId,@Param("ticketId") Integer ticketId);

    void updateTpUserId(@Param("ticketId") Integer ticketId);

    /**
     * 查看当前工单分配人
     * @param ticketId
     * @param communityId
     * @return
     */
    TpTicket getTicketTpUserId(@Param("ticketId") Integer ticketId, @Param("communityId") Integer communityId);

    Integer selectRecordStatus(@Param("communityId") Integer communityId, @Param("ticketId")Integer ticketId);

    TpTicket selectTpTicketName(@Param("communityId")Integer communityId, @Param("type")String type, @Param("ticketTitle")String ticketTitle);
}