Commit 4654935c by 郑永强

feat: [none] 支持复合查询

parent ae1bedc2
...@@ -1001,6 +1001,11 @@ public class BookAdviserBizImpl implements BookAdviserBiz { ...@@ -1001,6 +1001,11 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
@ParamLog("获取编辑书刊列表(ERP项目用)") @ParamLog("获取编辑书刊列表(ERP项目用)")
public PageBeanNew<ErpAdviserBookVO> listAdviserBook4Erp(String isbn, String uniqueNumber, String adviserName, Long agentId, Integer currentPage, Integer numPerPage) { public PageBeanNew<ErpAdviserBookVO> listAdviserBook4Erp(String isbn, String uniqueNumber, String adviserName, Long agentId, Integer currentPage, Integer numPerPage) {
Map<String, Object> paramMap = new HashMap<>(); 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("isbn", isbn);
paramMap.put("uniqueNumber", uniqueNumber); paramMap.put("uniqueNumber", uniqueNumber);
if(!StringUtil.isEmpty(adviserName)) { if(!StringUtil.isEmpty(adviserName)) {
......
...@@ -541,6 +541,10 @@ public class BookFacadeImpl implements BookFacade { ...@@ -541,6 +541,10 @@ public class BookFacadeImpl implements BookFacade {
} }
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookName", bookName != null && "".equals(bookName.trim()) ? null : bookName); 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("channelId", channelId);
paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode); paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode);
paramMap.put("mainEditorName", paramMap.put("mainEditorName",
......
...@@ -1236,6 +1236,13 @@ ...@@ -1236,6 +1236,13 @@
<if test="bookName!=null"> <if test="bookName!=null">
AND (B.BOOK_NAME LIKE CONCAT('%',#{bookName},'%') AND (B.BOOK_NAME LIKE CONCAT('%',#{bookName},'%')
OR B.ISBN 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"> <if test="adviserIds!=null and adviserIds.size()>0">
OR OR
A.ADVISER_ID in A.ADVISER_ID in
......
...@@ -619,7 +619,15 @@ ...@@ -619,7 +619,15 @@
ba.IS_DELETE = 0 ba.IS_DELETE = 0
AND b.IS_DELETE = 0 AND b.IS_DELETE = 0
<if test="isbn != null"> <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>
<if test="uniqueNumber != null"> <if test="uniqueNumber != null">
AND CONCAT('BK', ba.BOOK_ID) LIKE CONCAT('%', #{uniqueNumber}, '%') 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