package com.bonus.core.allocation.advise.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.core.allocation.advise.model.AllocPageDecoration;
import com.bonus.core.allocation.advise.model.AllocPageDecorationModel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AllocPageDecorationMapper extends BaseMapper<AllocPageDecoration> {
   @Select({"SELECT position_id, function_id, function_name, content_type FROM alloc_page_decoration WHERE  apply_page = #{applyPage} AND function_type = #{functionType}"})
   List<AllocPageDecorationModel> queryPageDecoration(@Param("applyPage") Integer applyPage, @Param("functionType") Integer functionType);

   @Delete({"DELETE FROM alloc_page_decoration WHERE apply_page = #{applyPage} AND function_type = #{functionType}"})
   void removeByApplyPage(@Param("applyPage") Integer applyPage, @Param("functionType") Integer functionType);
}
