package com.cool.store.mapper;

import com.cool.store.entity.PointAuditRecordDO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.PointTodoInfoDO;
import com.cool.store.request.PointTodoPageRequest;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface PointTodoInfoMapper extends Mapper<PointTodoInfoDO> {

    /**
     * 批量插入
     * @param addList
     * @return
     */
    Integer batchInsertSelective(@Param("addList") List<PointTodoInfoDO> addList);

    /**
     * 获取待办用户列表
     * @param pointId
     * @return
     */
    List<String> getTodoUserList(@Param("pointId") Long pointId);

    /**
     * 获取待办列表
     * @param pointId
     * @return
     */
    List<PointTodoInfoDO> getTodoList(@Param("pointId") Long pointId);

    /**
     * 更新待办
     * @param pointId
     * @param code
     * @param cycleCount
     * @param handlerUserId
     * @return
     */
    Integer updatePointTodoInfo(@Param("pointId") Long pointId, @Param("nodeNo") Integer nodeNo, @Param("cycleCount") Integer cycleCount, @Param("handlerUserId") String handlerUserId);

    /**
     * 获取用户关于某个铺位的待办
     * @param userId
     * @param pointId
     * @return
     */
    PointTodoInfoDO getPointToDoByUserIdAndPointId(String userId, Long pointId);

    /**
     * 获取待办
     * @param request
     * @return
     */
    Page<PointInfoDO> getUserTodoList(@Param("request") PointTodoPageRequest request);

    /**
     * 获取当前节点
     * @param pointId
     * @return
     */
    Integer getCurNodeNoByPoint(@Param("pointId") Long pointId);

}