package com.ruoyi.pay.mapper;

import com.ruoyi.pay.domain.PayEmployeeInfo;
import com.ruoyi.pay.domain.vo.PayEmployeeInfoVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 员工信息Mapper接口
 *
 * @author ruoyi
 * @date 2025-05-12
 */
public interface PayEmployeeInfoMapper extends BaseMapperPlus<PayEmployeeInfoMapper, PayEmployeeInfo, PayEmployeeInfoVo> {
    @Update("update pay_employee_info e set e.hours_per_day = #{newHour} where  e.hours_per_day = #{oldHour} and tenant_id = #{tenantId}")
    int updateSgrEmployeeHour(@Param("oldHour") String oldHour, @Param("newHour")String newHour,@Param("tenantId") Long tenantId);

    @Select("select * from pay_employee_info e ,sys_dept d where e.dept_id=d.dept_id and deleted = 0 and (d.dept_name='外贸' or d.dept_name='内贸') and tenant_id = #{tenantId}")
    List<PayEmployeeInfoVo> getSalesmanList(@Param("tenantId") Long tenantId);
}
