package com.lz.modules.equipment.dao;
/**
* <p>
*  服务类
* </p>
*
* @author quyixiao
* @since 2020-07-24
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lz.modules.equipment.entity.EquipmentInfo;
import com.lz.modules.equipment.entity.EquipmentInfoReq;
import com.lz.modules.equipment.entity.model.FindByNameModel;
import com.lz.modules.equipment.entity.model.FindEquipmentsByNameModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface EquipmentInfoMapper extends BaseMapper<EquipmentInfo> {


	EquipmentInfo selectEquipmentInfoById(@Param("id") Long id);


	Long insertEquipmentInfo(EquipmentInfo equipmentInfo);


	int updateEquipmentInfoById(EquipmentInfo equipmentInfo);


	int updateCoverEquipmentInfoById(EquipmentInfo equipmentInfo);


	int deleteEquipmentInfoById(@Param("id") Long id);

	EquipmentInfo selectEquipmentInfoByCode(@Param("code") String code);


    List<EquipmentInfo> selectByCondition(@Param("page") IPage page, @Param("req") EquipmentInfoReq req);

    List<EquipmentInfo> selectByStaffIdOrDepId(@Param("page") IPage page, @Param("nameModel") FindEquipmentsByNameModel nameModel);

	EquipmentInfo selectEquipmentInfoByCount(Integer count);

	int selectCountAllByState(@Param("num") Integer num);

	int selectCountByState(@Param("num") Integer num, @Param("state") int state);

	int selectCountByDepartmentIds(@Param("num") Integer num, @Param("asList") List<String> asList);

	int selectCountByNotFind(@Param("num") Integer num);

	int selectCountAllDepartment(@Param("num") Integer num);

    int updateCoverEquipmentInfoByTypeId(@Param("id") Long id, @Param("type") String type);
	int updateCoverEquipmentInfoByBrandId(@Param("id") Long id, @Param("brand") String brand);
	int updateCoverEquipmentInfoBySpecsId(@Param("id") Long id, @Param("specs") String specs);
}