
package org.sky.scientific.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.sky.scientific.pojo.dto.XmAssetHoursDto;
import org.sky.scientific.pojo.entity.XmAssetHoursEntity;
import org.sky.scientific.pojo.vo.DailyAttendance;
import org.sky.scientific.pojo.vo.XmAssetHoursVO;

import java.util.List;

/**
 * 科研仪器设备工时 Mapper 接口
 *
 * @author Kd
 * @since 2025-06-29
 */
public interface XmAssetHoursMapper extends BaseMapper<XmAssetHoursEntity> {

	List<XmAssetHoursEntity> selectByYearAndMonth(@Param("yearAndMonth") String yearAndMonth, @Param("xmId") Long xmId, @Param("assetId") Long assetId);
//
	int batchUpdate(List<XmAssetHoursEntity> list);

	int batchInsert(List<XmAssetHoursEntity> list);
//
	List<DailyAttendance> selectHoursByXmIdAndAssetId(@Param("xmId") Long xmId, @Param("assetId") Long assetId, @Param("yearAndMonth") String yearAndMonth);
//
	List<XmAssetHoursVO> selectXmAssetHoursPage(IPage<XmAssetHoursVO> page, @Param("ew") XmAssetHoursDto dto);

	/**
	 * 清除工时数据
	 * @param dto
	 * @return
	 */
	int clearXmAssetHours(@Param("yearAndMonth") String yearAndMonth, @Param("xmId") Long xmId, @Param("assetId") Long assetId);
}
