package cn.com.ty.lift.business.push.mapper;

import cn.com.ty.lift.business.project.dao.entity.Region;
import cn.com.ty.lift.business.push.entity.InspectionTips;
import cn.com.ty.lift.business.push.entity.RepairTips;
import cn.com.ty.lift.business.push.entity.TaskTips;
import cn.com.ty.lift.common.model.PushUserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 推送用户
 *
 * @author wcz
 * @since 2020/4/24
 */
public interface PushUserMapper extends BaseMapper<PushUserInfo> {

    List<PushUserInfo> listByUserIds(@Param("mtCompanyId") Long mtCompanyId, @Param("userIds") List<Long> userIds);

    PushUserInfo listByUserId(@Param("mtCompanyId") Long mtCompanyId, @Param("userId") Long userId);

    List<PushUserInfo> listByRoleCodes(@Param("mtCompanyId") Long mtCompanyId, @Param("roleCodes") List<String> roleCodes);

    List<PushUserInfo> listByRoleCode(@Param("mtCompanyId") Long mtCompanyId, @Param("roleCode") String roleCode);

    Region findRegionByEmergencyRepair(@Param("id") Long repairId, @Param("mtCompanyId") Long mtCompanyId);

    Region findRegionByAnnualInspection(@Param("id") Long inspectionId, @Param("mtCompanyId") Long mtCompanyId);

    Region findRegionByProject(@Param("id") Long projectId, @Param("mtCompanyId") Long mtCompanyId);

    IPage<InspectionTips> pageMtCompanyByAnnualInspection(IPage<InspectionTips> page, @Param("days") int days);

    List<RepairTips> listMtCompanyByEmergencyRepairForRegion();

    List<RepairTips> listMtCompanyByEmergencyRepairForDirector();

    IPage<TaskTips> pageRepairAndMaintainForClerk(IPage<TaskTips> page);

    List<TaskTips> listMaintainForEnterpriseAdmin();
}
