//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.luozhihui.project.mapper;

import com.luozhihui.project.entity.Brand;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;

public interface BrandMapper {
    @Select({"select * from  `brand`  LIMIT #{pageNum}, #{pageSize}"})
    List<Brand> FindAllBrandpage(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    @Select({"select * from  `brand`  "})
    List<Brand> FindAllBrand();

    @Select({"select * from  `brand` where `id`=#{id}"})
    List<Brand> FindBrandById(String Id);

    @Insert({"insert into `brand`(`brand_name_ch`,`brand_name_en`,`brand_logo`,`status`) VALUES(#{brand_name_ch},#{brand_name_en},#{brand_logo},#{status})"})
    @Transactional
    void addBrand(Brand brand);

    @Delete({"delete  from  `brand` where `id`=#{id}"})
    boolean DeleteBrandById(String Id);

    @Select({"select * from  `brand` where `id`=#{id}"})
    Brand BrandId(Integer Id);

    @Update({"UPDATE brand SET brand_name_ch = #{brand_name_ch}, brand_name_en = #{brand_name_en}, brand_logo = #{brand_logo}, status = #{status} where `id`=#{id}"})
    void update(Brand brand);

    @Select({" SELECT COUNT(*) FROM `brand` "})
    int countBrand();
}
