Commit 50855c42 by 田超

Merge branch 'feature/listPage4Agent' into 'master'

feat: [none] 支持复合查询

See merge request rays/pcloud-book!1231
parents ae1bedc2 4654935c
......@@ -1001,6 +1001,11 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
@ParamLog("获取编辑书刊列表(ERP项目用)")
public PageBeanNew<ErpAdviserBookVO> listAdviserBook4Erp(String isbn, String uniqueNumber, String adviserName, Long agentId, Integer currentPage, Integer numPerPage) {
Map<String, Object> paramMap = new HashMap<>();
if(!StringUtil.isEmpty(isbn)){
isbn = isbn.replaceAll("[/|-]","");
String [] nameList = isbn.trim().split("[\u00A0|\u3000|\u0020]");
paramMap.put("nameList", Lists.newArrayList(nameList));
}
paramMap.put("isbn", isbn);
paramMap.put("uniqueNumber", uniqueNumber);
if(!StringUtil.isEmpty(adviserName)) {
......
......@@ -541,6 +541,10 @@ public class BookFacadeImpl implements BookFacade {
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookName", bookName != null && "".equals(bookName.trim()) ? null : bookName);
if(!StringUtil.isEmpty(bookName)){
String [] nameList = bookName.trim().split("[\u00A0|\u3000|\u0020]");
paramMap.put("nameList", Lists.newArrayList(nameList));
}
paramMap.put("channelId", channelId);
paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode);
paramMap.put("mainEditorName",
......
......@@ -1236,6 +1236,13 @@
<if test="bookName!=null">
AND (B.BOOK_NAME LIKE CONCAT('%',#{bookName},'%')
OR B.ISBN LIKE CONCAT(#{bookName},'%')
<if test="nameList != null and nameList.size > 0">
OR (
<foreach collection="nameList" close=" " separator=" and " open=" " item="item">
(B.BOOK_NAME LIKE CONCAT('%', '${item}', '%'))
</foreach>
)
</if>
<if test="adviserIds!=null and adviserIds.size()>0">
OR
A.ADVISER_ID in
......
......@@ -619,7 +619,15 @@
ba.IS_DELETE = 0
AND b.IS_DELETE = 0
<if test="isbn != null">
AND (b.ISBN =#{isbn} or b.BOOK_NAME LIKE CONCAT('%', #{isbn}, '%'))
AND (b.ISBN =#{isbn} or b.BOOK_NAME LIKE CONCAT('%', #{isbn}, '%')
<if test="nameList != null and nameList.size > 0">
OR (
<foreach collection="nameList" close=" " separator=" and " open=" " item="item">
(b.BOOK_NAME LIKE CONCAT('%', '${item}', '%'))
</foreach>
)
</if>
)
</if>
<if test="uniqueNumber != null">
AND CONCAT('BK', ba.BOOK_ID) LIKE CONCAT('%', #{uniqueNumber}, '%')
......
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