Commit 56d3d02e by 田超

Merge branch 'fixbug/1004585' into 'master'

bug:[1004585]  书刊权益空格分词搜索

See merge request rays/pcloud-book!1255
parents 37ea1821 1cf4308d
......@@ -2141,7 +2141,12 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
paramMap.put("rightsSettingType", rightsSetting.getRightsSettingType());
PageBeanNew<RightsSettingDto> rightsSettingDtoPageBeanNew;
if (rightsSetting.getRightsSettingType() == 2) {//书刊权益
paramMap.put("bookQuery", rightsSetting.getBookQuery());
if (!StringUtil.isEmpty(rightsSetting.getBookQuery())) {
String bookQueryString = rightsSetting.getBookQuery().trim();
String[] bookQuerys = bookQueryString.split(" ");
List<String> bookQueryList = Arrays.stream(bookQuerys).map(e -> e.trim()).filter(e -> StringUtil.isNotBlank(e)).collect(Collectors.toList());
paramMap.put("bookQueryList", bookQueryList);
}
Long agentId = rightsSetting.getAgentId();
if (null != agentId && agentId>0){
List<Long> adviserIds = adviserConsr.getByAgentId(agentId);
......
......@@ -301,6 +301,12 @@
<if test="bookQuery !=null">
AND (b.BOOK_NAME LIKE CONCAT("%",#{bookQuery},"%") OR b.ISBN LIKE CONCAT("%",#{bookQuery},"%"))
</if>
<if test="bookQueryList != null">
AND
<foreach collection="bookQueryList" item="item" index="index" separator="or" open="(" close=")">
(b.BOOK_NAME LIKE CONCAT("%",'${item}',"%") OR b.ISBN LIKE CONCAT("%",'${item}',"%"))
</foreach>
</if>
<if test="adviserIds != null and adviserIds.size>0">
AND a.ADVISER_ID in
<foreach collection="adviserIds" item="item" index="index" separator="," open="(" close=")">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment