Commit 1cf4308d by 吴博

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

parent 37ea1821
...@@ -2141,7 +2141,12 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -2141,7 +2141,12 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
paramMap.put("rightsSettingType", rightsSetting.getRightsSettingType()); paramMap.put("rightsSettingType", rightsSetting.getRightsSettingType());
PageBeanNew<RightsSettingDto> rightsSettingDtoPageBeanNew; PageBeanNew<RightsSettingDto> rightsSettingDtoPageBeanNew;
if (rightsSetting.getRightsSettingType() == 2) {//书刊权益 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(); Long agentId = rightsSetting.getAgentId();
if (null != agentId && agentId>0){ if (null != agentId && agentId>0){
List<Long> adviserIds = adviserConsr.getByAgentId(agentId); List<Long> adviserIds = adviserConsr.getByAgentId(agentId);
......
...@@ -301,6 +301,12 @@ ...@@ -301,6 +301,12 @@
<if test="bookQuery !=null"> <if test="bookQuery !=null">
AND (b.BOOK_NAME LIKE CONCAT("%",#{bookQuery},"%") OR b.ISBN LIKE CONCAT("%",#{bookQuery},"%")) AND (b.BOOK_NAME LIKE CONCAT("%",#{bookQuery},"%") OR b.ISBN LIKE CONCAT("%",#{bookQuery},"%"))
</if> </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"> <if test="adviserIds != null and adviserIds.size>0">
AND a.ADVISER_ID in AND a.ADVISER_ID in
<foreach collection="adviserIds" item="item" index="index" separator="," open="(" close=")"> <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