package cn.com.ty.lift.ud.dataBank.mapper;


import java.util.List;

import cn.com.ty.lift.ud.dataBank.controller.query.LiftCategoryQuery;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import  com.baomidou.mybatisplus.core.mapper.BaseMapper;

import cn.com.ty.lift.ud.dataBank.mapper.entity.LiftCategoryEntity;
/**
 * 资料分类 -Repository
 * 
 * @author Xson
 * @date 2020-04-23
 */
public interface LiftCategoryMapper extends BaseMapper<LiftCategoryEntity> {

	List<LiftCategoryEntity> selectByQuery(@Param("ew") Wrapper wrapper, @Param("page") LiftCategoryQuery page);

    int countByQuery(@Param("ew") Wrapper wrapper);
    
    @Select("select * from lift_category where statuz=1 and brand_id =#{brandId} order by sort asc")
    List<LiftCategoryEntity>selectByBrandId(@Param("brandId")Long brandId);
    
    @Select("select * from lift_category where statuz=1 ")
    List<LiftCategoryEntity>selectAll();

    @Insert("${sql}")
    int execuSql(@Param("sql") String sql);
}
