package com.sw.common.accessory.server.mapper;

import com.sw.common.accessory.server.dto.AccessoryDetails;
import com.sw.common.accessory.server.dto.AccessoryDto;
import com.sw.common.accessory.server.entity.Accessory;
import com.sw.common.mybatisplus.base.BaseDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author
 * @Description：
 * @Date:
 * @Modified By:
 */
@Mapper
public interface AccessoryMapper extends BaseDao<Accessory> {

    List<AccessoryDetails> findAccessoryDetailsByEquipmentAccessoryId(@Param("equipmentAccessoryId") Long equipmentAccessoryId, @Param("statuss") Integer[] statuss, @Param("warnStatus") Integer warnStatus);

    List<AccessoryDto> findByEquipmentAccessoryId(@Param("equipmentAccessoryId")Long equipmentAccessoryId);
    @Select("select * from accy_accessory where equipment_code = #{equipmentCode} and material_code = #{materialCode} limit 1")
    Accessory findByEquipmentCodeAndMaterialCode(String equipmentCode, String materialCode);
}