全局搜索,我们把全局搜索提供,需要博客和资源修改新增的时候同步Context的文本

This commit is contained in:
limqhz
2022-05-11 01:40:57 +08:00
parent 759843e83d
commit 03d805641a
49 changed files with 508 additions and 702 deletions

View File

@@ -0,0 +1,22 @@
package com.quinn.mapper;
import com.quinn.pojo.FindResult;
import com.quinn.vo.MyPageParam;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author limqsh
* @since 2022-05-08
*/
public interface FindMapper {
int countListFinds(String findWhat);
List<FindResult> listFinds(String findWhat, MyPageParam myPageParam);
}

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.quinn.mapper.BlogStarMapper">
</mapper>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.quinn.mapper.DownloadMapper">
</mapper>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.quinn.mapper.FindMapper">
<select id="countListFinds" resultType="int">
select count(1) from (
select 1 from qn_source a
where a.source_name like CONCAT('%',#{findWhat},'%')
or a.content_json like CONCAT('%',#{findWhat},'%')
union all
select 1 from qn_blog b
where b.title like CONCAT('%',#{findWhat},'%')
or b.content_json like CONCAT('%',#{findWhat},'%')
) t
</select>
<select id="listFinds" resultType="com.quinn.pojo.FindResult">
select * from (
select a.sid as topicId,'SOURCE' as category,a.gmt_create as gmtCreate,a.source_name as topicName,a.content_json as contentText from qn_source a
where a.source_name like CONCAT('%',#{findWhat},'%')
or a.content_json like CONCAT('%',#{findWhat},'%')
union all
select b.bid as topicId,'BLOG' as category,b.gmt_create as gmtCreate,b.title as topicName,b.content_json as contentText from qn_blog b
where b.title like CONCAT('%',#{findWhat},'%')
or b.content_json like CONCAT('%',#{findWhat},'%')
) t order by gmtCreate
limit #{myPageParam.pageNum},#{myPageParam.size}
</select>
</mapper>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.quinn.mapper.QuestionCategoryMapper">
</mapper>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.quinn.mapper.QuestionMapper">
</mapper>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.quinn.mapper.SayMapper">
</mapper>