package com.skr.mdm.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.skr.mdm.bean.bo.MdmAppVersionBO;
import com.skr.mdm.entity.MdmAppPushDO;
import com.skr.mdm.bean.qo.app.AppPushListQO;
import com.skr.mdm.bean.so.app.AppPushSO;
import com.skr.mdm.bean.vo.app.AppPushVO;
import com.skr.mdm.bean.vo.equipment.DeviceAppPushVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 应用推送(MdmAppPush)表数据库访问层
 *
 * @author nfq
 * @since 2022-12-02 15:48:59
 */
@Repository
public interface MdmAppPushDao extends BaseMapper<MdmAppPushDO> {

    /**
     * 根据公司ID删除
     * @param companyId 公司ID
     */
    void deleteByCompanyId(@Param("companyId") Integer companyId);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<MdmAppPush> 实例对象列表
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<MdmAppPushDO> entities);


    List<AppPushVO> listAppPushVO(AppPushListQO appPushListQO);

    MdmAppVersionBO getMdmAppVersionBO(Integer appPushId);

    String getFileUrlByAppPushId(Integer appPushId);

    List<AppPushSO> listAppPushSO(@Param("equipmentId") Integer equipmentId, @Param("state") Integer state);

    List<DeviceAppPushVO> listDeviceAppPushVO(@Param("equipmentId") Integer equipmentId);

}

