package cn.iocoder.yudao.module.museum.dal.mysql.museumpicture;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.museum.dal.database.museumpicture.MuseumPictureDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface MuseumPictureMapper extends BaseMapperX<MuseumPictureDO> {

    @Update("UPDATE museum_picture_dan SET picture_path=#{picture_path} WHERE picture_id =#{picture_id}")
    void updateMuseumPicture(MuseumPictureDO museumPictureDO);

    @Update("UPDATE museum_picture_dan SET deleted=1  WHERE picture_id =#{picture_id}")
    void deleteMuseumPicture(Integer picture_id);

    @Select("SELECT * FROM museum_picture_dan WHERE picture_id = #{picture_id} AND deleted =0 ")
    MuseumPictureDO selectMuseumPictureById(@Param("picture_id") Integer picture_id);

    @Select("SELECT * FROM museum_picture_dan WHERE group_id = #{group_id} AND deleted =0 ")
    List<MuseumPictureDO> selectMuseumPictureSetByGroupId(@Param("group_id") Integer group_id);

}
