package com.jwipc.sys.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.sys.entity.DealtWithTargetInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jwipc.sys.model.dto.DwtItemDto;
import com.jwipc.sys.model.po.DealtWithTargetInfoPO;
import com.jwipc.sys.model.po.UserDwtItemPO;
import com.jwipc.sys.model.query.DealtInfoQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 指标信息表 Mapper 接口
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-01-30
 */
public interface DealtWithTargetInfoMapper extends BaseMapper<DealtWithTargetInfo> {

    List<DealtWithTargetInfoPO> findPageByQuery(@Param("query") DealtInfoQuery query);

    List<DealtWithTargetInfoPO> findPageByQuery(Page<DealtWithTargetInfo> dbPage, @Param("query") DealtInfoQuery query);

    DealtWithTargetInfoPO getDataById(@Param("id") Long id);

    List<UserDwtItemPO> selectUserDwtData(@Param("userId") Long userId, @Param("category") Integer category);

    Integer getSqlCount(@Param("sql") String sql);

    /**
     * 获取工作台中指标数据
     *
     * @param userId 当前登录人
     * @param category 1:代办 2:提醒 3.统计
     * @return 结果
     */
    List<DwtItemDto> findWorkbenchDwtData(@Param("userId") Long userId, @Param("category") Integer category);
}
