package org.jeecg.modules.newWarning.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.newWarning.entity.TabQi;

import java.util.List;

@Mapper
public interface TabQiMapper extends BaseMapper<TabQi> {


    @Select("select * from  \"\"${jhTableName}\"\"@ljss  ${ew.customSqlSegment}")
    List<TabQi> selectList(@Param("jhTableName")String jhTableName, @Param("ew") QueryWrapper<TabQi> queryWrapper);

    @Select("select * from  \"\"${jhTableName}\"\"@ljss ${ew.customSqlSegment}")
    Page<TabQi> selectListPage(@Param("jhTableName")String jhTableName, @Param("ew") QueryWrapper<TabQi> queryWrapper,Page<TabQi> page);

    @Select("select * from  \"\"${jhTableName}\"\"@ljss  ${ew.customSqlSegment} Limit #{page},#{pageNo}")
    List<TabQi> selectListP(@Param("jhTableName")String jhTableName, @Param("ew") QueryWrapper<TabQi> queryWrapper,@Param("page")Integer page,@Param("pageNo")Integer pageNo);

    @Select("select * from  \"${jhTableName}\"@ljss  ${ew.customSqlSegment} LIMIT 1")
    TabQi selectOne(@Param("jhTableName")String jhTableName,@Param("ew") QueryWrapper<TabQi> queryWrapper);

    @Select("select * from   (select * from \"${jhTableName}\"@ljss  order by time desc ) where  rownum<2")
    TabQi selectOneOrcale(@Param("jhTableName")String jhTableName);

    @Select("select * from ( select * from  \"${jhTableName}\"@ljss  ${ew.customSqlSegment} )  where rownum<4 ")
    List<TabQi> selectListPOrcale(@Param("jhTableName")String jhTableName, @Param("ew") QueryWrapper<TabQi> queryWrapper);

    @Select("select * from   (select * from \"${jhTableName}\"@ljss  ${ew.customSqlSegment} ) where  rownum<2")
    TabQi selectWOneOrcale(@Param("jhTableName")String jhTableName, @Param("ew") QueryWrapper<TabQi> queryWrapper);

}
