package com.ruoyi.pay.mapper;

import com.ruoyi.pay.domain.PayWorkOrderBaohuo;
import com.ruoyi.pay.domain.vo.ExportBaohuoVo;
import com.ruoyi.pay.domain.vo.PayWorkOrderBaohuoVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.HashSet;
import java.util.List;

/**
 * 包活派工单Mapper接口
 *
 * @author ruoyi
 * @date 2025-05-12
 */
public interface PayWorkOrderBaohuoMapper extends BaseMapperPlus<PayWorkOrderBaohuoMapper, PayWorkOrderBaohuo, PayWorkOrderBaohuoVo> {
    @Select("SELECT IFNULL(dept_name, '') as deptName FROM sys_dept WHERE dept_id  = #{deptId}")
    String getDeptNameById(Long deptId);
    @Delete("delete from pay_baohuo_product where wo_id = #{woid}")
    void deleteAllProdByWoId(Long id);
    @Delete("delete from pay_baohuo_employee where wo_id = #{woid}")
    void deleteAllEmpByWoId(Long id);
    @Delete("delete from pay_baohuo_worktime where wo_id = #{woid}")
    void deleteAllWorkTimeByWoId(Long id);

    List<ExportBaohuoVo> getWorkOrderListByDate(@Param("tenantId")Long tenantId, @Param("exportDate")Date exportDate);

    HashSet<Long> getWoIdSet(@Param("workDate")String workDate, @Param("empId") Long empId);
}
