package com.ruoyi.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.demo.entity.Equipment;
import com.ruoyi.demo.entity.vo.EquipmentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface EquipmentMapper extends BaseMapper<Equipment> {
    @Update("update dl_equipment set equipment_name=#{equipmentName},annotation=#{annotation},addr_info=#{addrInfo},addr_code=#{addrCode},addr_code_info=#{addrCodeInfo},state=#{state},enter_time=#{enter_time},lat=#{lat},lng=#{lng},manufacturers=#{manufacturers},maintain_name=#{maintainName},maintain_telephone=#{maintainTelephone} where equipment_id = #{equipmentId} and deleted = 0")
    void updateEquipment(EquipmentVo equipmentVo);

    @Update("update dl_equipment set store_id=#{storeId} where equipment_id = #{equipmentId} and deleted = 0")
    void addStoreEquipment(EquipmentVo equipmentVo);

    @Update("update dl_equipment set store_id=#{storeId} where equipment_id = #{equipmentId} and deleted = 0")
    void deleteStoreEquipment(String[] equipmentIds);
}
