全局搜索,我们把全局搜索提供,需要博客和资源修改新增的时候同步Context的文本
This commit is contained in:
22
src/main/java/com/quinn/mapper/FindMapper.java
Normal file
22
src/main/java/com/quinn/mapper/FindMapper.java
Normal 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);
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
30
src/main/java/com/quinn/mapper/xml/FindMapper.xml
Normal file
30
src/main/java/com/quinn/mapper/xml/FindMapper.xml
Normal 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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user