优化博客
This commit is contained in:
@@ -2,6 +2,11 @@ package com.quinn.mapper;
|
||||
|
||||
import com.quinn.pojo.Source;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.quinn.pojo.SourceWithStar;
|
||||
import com.quinn.vo.MyPageParam;
|
||||
import com.quinn.vo.QuerySource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +18,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface SourceMapper extends BaseMapper<Source> {
|
||||
|
||||
List<SourceWithStar> listPageStar(QuerySource querySource, MyPageParam myPageParam);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,20 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.quinn.mapper.SourceMapper">
|
||||
|
||||
<select id="listPageStar" resultType="com.quinn.pojo.SourceWithStar">
|
||||
select id,sid,source_name,detail,source_type,category_id,category_name,en_name,file_type,down_record,gmt_create,gmt_update,
|
||||
(select count(1) from qn_star c where c.topic_id = sid and c.topic_category = 'SOURCE') as star
|
||||
from qn_source
|
||||
<where>
|
||||
<if test="querySource.name!=null and querySource.name != ''">
|
||||
and source_name like CONCAT('%',#{querySource.name},'%')
|
||||
</if>
|
||||
<if test="querySource.category > 0">
|
||||
and category_id = #{querySource.category}
|
||||
</if>
|
||||
</where>
|
||||
order by gmt_create desc
|
||||
limit #{myPageParam.pageNum},#{myPageParam.size}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user