package com.rongwei.bscommon.sys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rongwei.bsentity.domain.EquMaintenanceScheduleDo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author shangmi
 * @title EquMaintenanceScheduleDao
 * @date 2023/11/27 14:58
 * @description 保养/维护计划
 */
public interface EquMaintenanceScheduleDao extends BaseMapper<EquMaintenanceScheduleDo> {

    @Insert("<script>" +
            "insert into equ_maintenance_schedule (ID,TENANTID,ROPTION,REMARK,CREATEDATE,CREATEUSERID,MODIFYDATE,MODIFYUSERID," +
            "CREATEUSERNAME,MODIFYUSERNAME,PLANYEAR,EQUIPMENTNAME,EQUIPMENTNUMBER,PLANTYPE,EQUIPMENTTYPE,PLANT,SPECIALEQUIPMENT,OBJECTTYPE," +
            "SPECIFICATION,WORKSHOPID,WORKSHOP,PLANNEDSTATUS,EQUIPMENTID) values " +
            "<foreach collection='list' item='info' separator=','>" +
            "(#{info.id},#{info.tenantid},#{info.roption},#{info.remark},#{info.createdate},#{info.createuserid},#{info.modifydate}," +
            "#{info.modifyuserid},#{info.createusername},#{info.modifyusername},#{info.planyear},#{info.equipmentname}," +
            "#{info.equipmentnumber},#{info.plantype},#{info.equipmenttype},#{info.plant},#{info.specialequipment}," +
            "#{info.objecttype},#{info.specification},#{info.workshopid},#{info.workshop},#{info.plannedstatus},#{info.equipmentid})" +
            "</foreach>" +
            "</script>")
    int saveBatchList(@Param("list") List<EquMaintenanceScheduleDo> maintenanceScheduleList);
}
