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

import java.util.List;

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.controller.query.LiftFileQuery;
import cn.com.ty.lift.ud.dataBank.mapper.entity.LiftFileEntity;

/**
 * 资料库文件 -Repository
 * 
 * @author Xson
 * @date 2020-04-23
 */
public interface LiftFileMapper extends BaseMapper<LiftFileEntity> {

    @Select("SELECT * FROM lift_file WHERE data_id=#{dataId} and data_table=#{type} and statuz=1 order by create_time desc")
    List<LiftFileEntity> getListByDataIdAndDataTable(@Param(value = "dataId") Long dataId,
        @Param(value = "type") Integer type);
    
    List<LiftFileEntity> selectByQuery(@Param("ew") Wrapper wrapper, @Param("page") LiftFileQuery page);

    int countByQuery(@Param("ew") Wrapper wrapper);
}
