完成搜索功能
This commit is contained in:
@ -22,7 +22,7 @@ public interface SqBookmarkMapper extends MyMapper<SqBookmark>
|
||||
* @param userID 用户ID
|
||||
* @return 书签管理
|
||||
*/
|
||||
public List<SqBookmark> selectBymenuIdUserID(@Param("menuID") Long menuID, @Param("userID") Long userID);
|
||||
public List<SqBookmark> selectBymenuIdUserID(@Param("menuID") Long menuID, @Param("userID") Long userID,@Param("sort")Integer sort,@Param("sousuo") String sousuo);
|
||||
|
||||
/**
|
||||
* 查询书签管理
|
||||
|
@ -21,9 +21,11 @@ public interface ISqBookmarkService
|
||||
*
|
||||
* @param menuID 栏目ID
|
||||
* @param userID 用户ID
|
||||
* @param sort 排序方式
|
||||
* @param sousou 搜索
|
||||
* @return 书签管理
|
||||
*/
|
||||
public List<SqBookmark> selectBymenuIdUserID(Long menuID,Long userID);
|
||||
public List<SqBookmark> selectBymenuIdUserID(Long menuID,Long userID,Integer sort,String sousou);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -59,11 +59,13 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService
|
||||
*
|
||||
* @param menuID 栏目ID
|
||||
* @param userID 用户ID
|
||||
* @param sort 排序方式
|
||||
* @param sousou 搜索
|
||||
* @return 书签管理
|
||||
*/
|
||||
@Override
|
||||
public List<SqBookmark> selectBymenuIdUserID(Long menuID, Long userID) {
|
||||
return sqBookmarkMapper.selectBymenuIdUserID(menuID,userID);
|
||||
public List<SqBookmark> selectBymenuIdUserID(Long menuID, Long userID,Integer sort,String sousou) {
|
||||
return sqBookmarkMapper.selectBymenuIdUserID(menuID,userID, sort,sousou);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -123,6 +123,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectBymenuIdUserID" parameterType="SqBookmark" resultMap="SqBookmarkResult">
|
||||
<include refid="selectSqBookmarkVo"/>
|
||||
where menu_id = #{menuID} and userid=#{userID} order by create_time desc
|
||||
where userid=#{userID}
|
||||
<if test="sousuo == null or sousuo == ''"> and menu_id = #{menuID}</if>
|
||||
<if test="sousuo != null and sousuo != ''"> and title like concat('%', #{sousuo}, '%')</if>
|
||||
order by
|
||||
<choose>
|
||||
<when test="sort == 0">
|
||||
create_time desc
|
||||
</when>
|
||||
<when test="sort == 1">
|
||||
create_time asc
|
||||
</when>
|
||||
<when test="sort == 2">
|
||||
CONVERT(title USING GBK) asc
|
||||
</when>
|
||||
<when test="sort == 3">
|
||||
CONVERT(title USING GBK) desc
|
||||
</when>
|
||||
<otherwise>
|
||||
create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user