浏览代码

关键词库

zhijiezhao 2 年之前
父节点
当前提交
5f5907a989

+ 67 - 74
src/main/java/com/caimei365/commodity/controller/ProductPageApi.java

@@ -47,6 +47,7 @@ public class ProductPageApi {
     public ResponseJson delSku(Integer skuId) {
         return pageService.delSku(skuId);
     }
+
     /**
      * 获取分类列表
      *
@@ -491,107 +492,113 @@ public class ProductPageApi {
 //-----------------------------------------------1.3.3采美百科词条----------------------------------------------------------------------------------------
 
     /**
-     *
-     * @param id 词条id
-     * @param entryName 词条名称
-     * @param typeId 分类id
-     * @param auditStatus 审核状态
+     * @param id           词条id
+     * @param entryName    词条名称
+     * @param typeId       分类id
+     * @param auditStatus  审核状态
      * @param onlineStatus 上线状态
-     * @param status 状态
-     * @param pageNum 页数
-     * @param pageSize 条数
+     * @param status       状态
+     * @param pageNum      页数
+     * @param pageSize     条数
      * @return
      */
     @GetMapping("/get/authuser/list")
-    public  ResponseJson<PaginationVo<BaikeProductVo>> getAuthUserList(Integer id,String name,Integer typeId,Integer auditStatus,Integer onlineStatus,Integer status,Integer shopId, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
-                                                                           @RequestParam(value = "pageSize", defaultValue = "20") int pageSize){
-            BaikeProductVo baikeProductVo=new BaikeProductVo();
-            baikeProductVo.setProductId(id);
-            baikeProductVo.setName(name);
-            baikeProductVo.setTypeId(typeId);
-            baikeProductVo.setAuditStatus(auditStatus);
-            baikeProductVo.setOnlineStatus(onlineStatus);
-            baikeProductVo.setStatus(status);
-            baikeProductVo.setShopId(shopId);
-            return pageService.getAuthUserList(baikeProductVo,pageNum,pageSize);
-        }
+    public ResponseJson<PaginationVo<BaikeProductVo>> getAuthUserList(Integer id, String name, Integer typeId, Integer auditStatus, Integer onlineStatus, Integer status, Integer shopId, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                      @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        BaikeProductVo baikeProductVo = new BaikeProductVo();
+        baikeProductVo.setProductId(id);
+        baikeProductVo.setName(name);
+        baikeProductVo.setTypeId(typeId);
+        baikeProductVo.setAuditStatus(auditStatus);
+        baikeProductVo.setOnlineStatus(onlineStatus);
+        baikeProductVo.setStatus(status);
+        baikeProductVo.setShopId(shopId);
+        return pageService.getAuthUserList(baikeProductVo, pageNum, pageSize);
+    }
 
     /**
      * 修改状态  0保存草稿箱  1已发布
+     *
      * @param id
      * @return
      */
     @GetMapping("/up/entry/status")
-    public  ResponseJson upEntryStatusById(Integer id,Integer status){
-        return pageService.upEntryStatusById(id,status);
+    public ResponseJson upEntryStatusById(Integer id, Integer status) {
+        return pageService.upEntryStatusById(id, status);
     }
 
     /**
      * 根据id删除词条
+     *
      * @param id
      * @return
      */
     @GetMapping("/del/entry")
-    public  ResponseJson delEntryStatusById(Integer id){
+    public ResponseJson delEntryStatusById(Integer id) {
         return pageService.delEntryStatusById(id);
     }
 
     /**
      * 根据id查询详细信息
+     *
      * @param id
      * @return
      */
     @GetMapping("/get/entry/info/by/id")
-    public ResponseJson<BaikeProductVo> getEntryInfoById(Integer id){
+    public ResponseJson<BaikeProductVo> getEntryInfoById(Integer id) {
         return pageService.getEntryInfoById(id);
     }
+
     /**
      * 根据id删除资料
+     *
      * @param id
      * @return
      */
     @GetMapping("/del/Reference")
-    public ResponseJson delReferenceById(Integer id){
+    public ResponseJson delReferenceById(Integer id) {
         return pageService.delReferenceById(id);
     }
 
     /**
      * 根据id查询资料
+     *
      * @param id
      * @return
      */
     @GetMapping("/get/Reference")
-    public ResponseJson<CmBaikeReferenceInfo> getReferenceById(Integer id){
+    public ResponseJson<CmBaikeReferenceInfo> getReferenceById(Integer id) {
         return pageService.getReferenceById(id);
     }
 
     /**
      * 保存资料
+     *
      * @param params
      * @return
      */
     @PostMapping("/save/referenceInfo")
-    public ResponseJson saveReferenceInfoByid(@RequestBody String params){
+    public ResponseJson saveReferenceInfoByid(@RequestBody String params) {
         JSONObject paramsMap = JSONObject.parseObject(params);
-        Integer id=paramsMap.getInteger("id");
-        Integer referenceType=paramsMap.getInteger("referenceType");
-        String website=paramsMap.getString("website");
-        String articleName=paramsMap.getString("articleName");
-        String publishTimeStr=paramsMap.getString("publishTimeStr");
-        String acitationTimeStr=paramsMap.getString("acitationTimeStr");
-        String author=paramsMap.getString("author");
-        String workName=paramsMap.getString("workName");
-        String publicationPlace=paramsMap.getString("publicationPlace");
-        String press=paramsMap.getString("press");
-        String publicationYearStr=paramsMap.getString("publicationYearStr");
-        String acitationWeb=paramsMap.getString("acitationWeb");
-        String referenceDescription=paramsMap.getString("referenceDescription");
-        String imageDescription=paramsMap.getString("imageDescription");
-        String imageUrl=paramsMap.getString("imageUrl");
-        Integer entryId=paramsMap.getInteger("entryId");
-        String entryType=paramsMap.getString("entryType");
-        String ctrlId=paramsMap.getString("ctrlId");
-        CmBaikeReferenceInfo cmBaikeReferenceInfo=new CmBaikeReferenceInfo();
+        Integer id = paramsMap.getInteger("id");
+        Integer referenceType = paramsMap.getInteger("referenceType");
+        String website = paramsMap.getString("website");
+        String articleName = paramsMap.getString("articleName");
+        String publishTimeStr = paramsMap.getString("publishTimeStr");
+        String acitationTimeStr = paramsMap.getString("acitationTimeStr");
+        String author = paramsMap.getString("author");
+        String workName = paramsMap.getString("workName");
+        String publicationPlace = paramsMap.getString("publicationPlace");
+        String press = paramsMap.getString("press");
+        String publicationYearStr = paramsMap.getString("publicationYearStr");
+        String acitationWeb = paramsMap.getString("acitationWeb");
+        String referenceDescription = paramsMap.getString("referenceDescription");
+        String imageDescription = paramsMap.getString("imageDescription");
+        String imageUrl = paramsMap.getString("imageUrl");
+        Integer entryId = paramsMap.getInteger("entryId");
+        String entryType = paramsMap.getString("entryType");
+        String ctrlId = paramsMap.getString("ctrlId");
+        CmBaikeReferenceInfo cmBaikeReferenceInfo = new CmBaikeReferenceInfo();
         cmBaikeReferenceInfo.setId(id);
         cmBaikeReferenceInfo.setReferenceType(referenceType);
         cmBaikeReferenceInfo.setWebsite(website);
@@ -610,71 +617,57 @@ public class ProductPageApi {
         cmBaikeReferenceInfo.setEntryId(entryId);
         cmBaikeReferenceInfo.setEntryType(entryType);
         cmBaikeReferenceInfo.setCtrlId(ctrlId);
-        if(null!=cmBaikeReferenceInfo.getId()){
+        if (null != cmBaikeReferenceInfo.getId()) {
             return pageService.upReferenceInfoByid(cmBaikeReferenceInfo);
-        }else{
+        } else {
             return pageService.insertReferenceInfo(cmBaikeReferenceInfo);
         }
     }
 
     /**
      * 获取分类下来列表
+     *
      * @return
      */
     @GetMapping("/get/type/list")
-    public ResponseJson<List<BaikeTypeVo>> geTypeList(){
+    public ResponseJson<List<BaikeTypeVo>> geTypeList() {
         return pageService.geTypeList();
     }
 
     /**
      * 保存词条详细信息
+     *
      * @return
      */
     @PostMapping("/save/entry/info")
-    public ResponseJson saveEntryInfo(BaikeProductVo baikeProductVo){
-//        BaikeProductVo baikeProductVo =new BaikeProductVo();
-//        baikeProductVo.setId(id);
-//        baikeProductVo.setName(name);
-//        baikeProductVo.setAlias(alias);
-//        baikeProductVo.setDiscription(discriotion);
-//        baikeProductVo.setImage(img);
-//        baikeProductVo.setTypeId(typeId);
-//        baikeProductVo.setSeoKeyword(seoKeyword);
-//        baikeProductVo.setStatus(status);
-//        baikeProductVo.setImageList(imageList);
-//        baikeProductVo.setInfoList(infoList);
-//        baikeProductVo.setReferenceList(referenceList);
-//        baikeProductVo.setVideoList(videoList);
+    public ResponseJson saveEntryInfo(BaikeProductVo baikeProductVo) {
         //json转集合对象 概述图册
-        String imgListStr =baikeProductVo.getImageListStr();
+        String imgListStr = baikeProductVo.getImageListStr();
         List<BaikeImageVo> baikeImageVos = JSONArray.parseArray(imgListStr, BaikeImageVo.class);
         baikeProductVo.setImageList(baikeImageVos);
         //json转集合对象 信息栏
-        String infoListStr =baikeProductVo.getInfoListStr();
+        String infoListStr = baikeProductVo.getInfoListStr();
         List<BaikeInfoVo> infoList = JSONArray.parseArray(infoListStr, BaikeInfoVo.class);
         baikeProductVo.setInfoList(infoList);
         //json转集合对象 正文
-        String textlistStr =baikeProductVo.getTextInfoListStr();
+        String textlistStr = baikeProductVo.getTextInfoListStr();
         List<BaikeTextInfoVo> textlist = JSONArray.parseArray(textlistStr, BaikeTextInfoVo.class);
         baikeProductVo.setTextInfoList(textlist);
         //json转集合对象 参考资料
-        String referenceListStr =baikeProductVo.getReferenceListStr();
+        String referenceListStr = baikeProductVo.getReferenceListStr();
         List<CmBaikeReferenceInfo> referenceList = JSONArray.parseArray(referenceListStr, CmBaikeReferenceInfo.class);
         baikeProductVo.setReferenceList(referenceList);
         //json转集合对象 视频
-        String videoListStr =baikeProductVo.getVideoListStr();
+        String videoListStr = baikeProductVo.getVideoListStr();
         List<BaikeVideoVo> videoList = JSONArray.parseArray(videoListStr, BaikeVideoVo.class);
         baikeProductVo.setVideoList(videoList);
-        if(null!=baikeProductVo&&null!=baikeProductVo.getId()){
-            baikeProductVo.setProductId(baikeProductVo.getId());
-        }
-        if(null!=baikeProductVo&&null!= baikeProductVo.getProductId()){
+        if (null != baikeProductVo && null != baikeProductVo.getId()) {
             //编辑
             return pageService.upEntryInfo(baikeProductVo);
-        }else{
+        } else {
             //新增
             return pageService.insertEntryInfo(baikeProductVo);
-
         }
     }
+
 }

+ 5 - 0
src/main/java/com/caimei365/commodity/controller/SearchProductApi.java

@@ -250,6 +250,11 @@ public class SearchProductApi {
         return ResponseJson.success(searchProductService.getKeywordList(searchKeywordyVo.getKeyword()));
     }
 
+    @GetMapping("/keyword/list")
+    public ResponseJson<List<SearchKeywordyVo>> getKeywordLIstByData(String keyword) {
+        return ResponseJson.success(searchProductService.getKeywordLIstByData(keyword));
+    }
+
     @GetMapping("/conKeyWord")
     public void conKeyWord() {
         searchProductService.conKeyWord();

+ 8 - 6
src/main/java/com/caimei365/commodity/mapper/PageMapper.java

@@ -30,6 +30,7 @@ public interface PageMapper {
 
     /**
      * 查询页面内容标签
+     *
      * @param pageId
      * @return
      */
@@ -419,7 +420,7 @@ public interface PageMapper {
 
     List<BaikeProductVo> getAuthUserList(BaikeProductVo baikeProductVo);
 
-    void upEntryStatusById(Integer id,Integer status,Date publishTime);
+    void upEntryStatusById(Integer id, Integer status, Date publishTime);
 
     void delEntryStatusById(Integer id);
 
@@ -451,11 +452,14 @@ public interface PageMapper {
     void insertEntryInfo(BaikeProductVo cmBaikeReferenceInfo);
 
     void delImageListByEntryId(Integer id);
+
     void delVideoListByEntryId(Integer id);
+
     void delInfoListByEntryId(Integer id);
+
     void delTextListByEntryId(Integer id);
-    void delreferenceByEntryId(Integer id);
 
+    void delreferenceByEntryId(Integer id);
 
     void insertImage(BaikeImageVo baikeImageVo);
 
@@ -467,11 +471,9 @@ public interface PageMapper {
 
     void insertreference(CmBaikeReferenceInfo baikeInfoVo);
 
-
-
-    Integer getentryId();
-
     Integer getShopid(Integer authUserId);
 
     String getHelpContent(Integer helpId);
+
+    List<String> findLabels(String labelIds);
 }

+ 9 - 1
src/main/java/com/caimei365/commodity/model/vo/BaikeProductVo.java

@@ -17,6 +17,14 @@ import java.util.Map;
 @Data
 public class BaikeProductVo implements Serializable {
     private static final long serialVersionUID = 1L;
+    /**
+     * 关联标签库回显
+     */
+    private List<String> labels;
+    /**
+     * 关联标签库id
+     */
+    private String labelIds;
 
     private Integer productId;
 
@@ -66,7 +74,7 @@ public class BaikeProductVo implements Serializable {
      */
     private Integer typeId;
     /**
-     *分类名称
+     * 分类名称
      */
     private String typeName;
 

+ 2 - 0
src/main/java/com/caimei365/commodity/model/vo/SearchKeywordyVo.java

@@ -6,6 +6,8 @@ import java.sql.Date;
 
 @Data
 public class SearchKeywordyVo {
+
+    private Integer id;
     /**
      * 关键词
      */

+ 2 - 0
src/main/java/com/caimei365/commodity/service/SearchProductService.java

@@ -118,4 +118,6 @@ public interface SearchProductService {
     List<SearchKeywordyVo> getKeywordList(String keyword);
 
     void conKeyWord();
+
+    List<SearchKeywordyVo> getKeywordLIstByData(String keyword);
 }

+ 18 - 69
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -1445,6 +1445,9 @@ public class PageServiceImpl implements PageService {
         entryInfo.setReferenceList(referenceList);
         //分类集合
         List<BaikeTypeVo> TypeList = pageMapper.geTypeList();
+        if (StringUtils.isNotBlank(entryInfo.getLabelIds())) {
+            entryInfo.setLabels(pageMapper.findLabels(entryInfo.getLabelIds()));
+        }
         entryInfo.setTypeList(TypeList);
         return ResponseJson.success(entryInfo);
     }
@@ -1530,12 +1533,6 @@ public class PageServiceImpl implements PageService {
     @Override
     @Transactional
     public ResponseJson upEntryInfo(BaikeProductVo baikeProductVo) {
-//       //根据authUserId获取shopid
-//       if(null!=baikeProductVo&&null!=baikeProductVo.getAuthUserId()){
-//           Integer shopid = pageMapper.getShopid(baikeProductVo.getAuthUserId());
-//           baikeProductVo.setShopId(shopid);
-//           baikeProductVo.setPublishSource(2);
-//       }
         if (null != baikeProductVo && null != baikeProductVo.getShopId()) {
             baikeProductVo.setPublishSource(2);
         }
@@ -1546,17 +1543,17 @@ public class PageServiceImpl implements PageService {
         }
         pageMapper.upEntryInfo(baikeProductVo);
         //删除概述图片(视频)/信息栏/正文信息
-        pageMapper.delImageListByEntryId(baikeProductVo.getProductId());//图片
-        pageMapper.delVideoListByEntryId(baikeProductVo.getProductId());//视频
-        pageMapper.delInfoListByEntryId(baikeProductVo.getProductId());//信息栏
-        pageMapper.delTextListByEntryId(baikeProductVo.getProductId());//正文
-        pageMapper.delreferenceByEntryId(baikeProductVo.getProductId());//资料
+        pageMapper.delImageListByEntryId(baikeProductVo.getId());//图片
+        pageMapper.delVideoListByEntryId(baikeProductVo.getId());//视频
+        pageMapper.delInfoListByEntryId(baikeProductVo.getId());//信息栏
+        pageMapper.delTextListByEntryId(baikeProductVo.getId());//正文
+        pageMapper.delreferenceByEntryId(baikeProductVo.getId());//资料
 
         //保存新的概述图册
         List<BaikeImageVo> imageList = baikeProductVo.getImageList();
         if (null != imageList && imageList.size() > 0) {
             for (BaikeImageVo baikeImageVo : imageList) {
-                baikeImageVo.setEntryId(baikeProductVo.getProductId());
+                baikeImageVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertImage(baikeImageVo);
             }
         }
@@ -1564,7 +1561,7 @@ public class PageServiceImpl implements PageService {
         List<BaikeVideoVo> videoList = baikeProductVo.getVideoList();
         if (null != videoList && videoList.size() > 0) {
             for (BaikeVideoVo baikeVideoVo : videoList) {
-                baikeVideoVo.setEntryId(baikeProductVo.getProductId());
+                baikeVideoVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertVideo(baikeVideoVo);
             }
         }
@@ -1572,7 +1569,7 @@ public class PageServiceImpl implements PageService {
         List<BaikeInfoVo> infoList = baikeProductVo.getInfoList();
         if (null != infoList && infoList.size() > 0) {
             for (BaikeInfoVo baikeInfoVo : infoList) {
-                baikeInfoVo.setEntryId(baikeProductVo.getProductId());
+                baikeInfoVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertInfo(baikeInfoVo);
             }
         }
@@ -1580,7 +1577,7 @@ public class PageServiceImpl implements PageService {
         List<BaikeTextInfoVo> TextList = baikeProductVo.getTextInfoList();
         if (null != infoList && infoList.size() > 0) {
             for (BaikeTextInfoVo baikeInfoVo : TextList) {
-                baikeInfoVo.setEntryId(baikeProductVo.getProductId());
+                baikeInfoVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertText(baikeInfoVo);
             }
         }
@@ -1588,27 +1585,7 @@ public class PageServiceImpl implements PageService {
         List<CmBaikeReferenceInfo> referenceList = baikeProductVo.getReferenceList();
         if (null != referenceList && referenceList.size() > 0) {
             for (CmBaikeReferenceInfo reference : referenceList) {
-                if (null != reference) {
-                    if (null == reference.getPublicationYear()) {
-                        reference.setPublicationYear(null);
-                    }
-                    if (StringUtils.isEmpty(reference.getPublicationYearStr())) {
-                        reference.setPublicationYearStr(null);
-                    }
-                    if (null == reference.getPublishTime()) {
-                        reference.setPublishTime(null);
-                    }
-                    if (StringUtils.isEmpty(reference.getPublishTimeStr())) {
-                        reference.setPublishTimeStr(null);
-                    }
-                    if (null == reference.getAcitationTime()) {
-                        reference.setAcitationTime(null);
-                    }
-                    if (StringUtils.isEmpty(reference.getAcitationTimeStr())) {
-                        reference.setAcitationTimeStr(null);
-                    }
-                }
-                reference.setEntryId(baikeProductVo.getProductId());
+                reference.setEntryId(baikeProductVo.getId());
                 pageMapper.insertreference(reference);
             }
         }
@@ -1624,12 +1601,6 @@ public class PageServiceImpl implements PageService {
     @Override
     @Transactional
     public ResponseJson insertEntryInfo(BaikeProductVo baikeProductVo) {
-        //根据authUserId获取shopid
-//        if(null!=baikeProductVo&&null!=baikeProductVo.getAuthUserId()){
-//            Integer shopid = pageMapper.getShopid(baikeProductVo.getAuthUserId());
-//            baikeProductVo.setShopId(shopid);
-//            baikeProductVo.setPublishSource(2);
-//        }
         if (null != baikeProductVo && null != baikeProductVo.getShopId()) {
             baikeProductVo.setPublishSource(2);
         }
@@ -1639,13 +1610,11 @@ public class PageServiceImpl implements PageService {
         }
         //新增词条信息
         pageMapper.insertEntryInfo(baikeProductVo);
-        //查询新添加的词条id
-        Integer id = pageMapper.getentryId();
         //保存新的概述图册
         List<BaikeImageVo> imageList = baikeProductVo.getImageList();
         if (null != imageList && imageList.size() > 0) {
             for (BaikeImageVo baikeImageVo : imageList) {
-                baikeImageVo.setEntryId(id);
+                baikeImageVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertImage(baikeImageVo);
             }
         }
@@ -1653,7 +1622,7 @@ public class PageServiceImpl implements PageService {
         List<BaikeVideoVo> videoList = baikeProductVo.getVideoList();
         if (null != videoList && videoList.size() > 0) {
             for (BaikeVideoVo baikeVideoVo : videoList) {
-                baikeVideoVo.setEntryId(id);
+                baikeVideoVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertVideo(baikeVideoVo);
             }
         }
@@ -1661,7 +1630,7 @@ public class PageServiceImpl implements PageService {
         List<BaikeInfoVo> infoList = baikeProductVo.getInfoList();
         if (null != infoList && infoList.size() > 0) {
             for (BaikeInfoVo baikeInfoVo : infoList) {
-                baikeInfoVo.setEntryId(id);
+                baikeInfoVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertInfo(baikeInfoVo);
             }
         }
@@ -1669,7 +1638,7 @@ public class PageServiceImpl implements PageService {
         List<BaikeTextInfoVo> TextList = baikeProductVo.getTextInfoList();
         if (null != infoList && infoList.size() > 0) {
             for (BaikeTextInfoVo baikeInfoVo : TextList) {
-                baikeInfoVo.setEntryId(id);
+                baikeInfoVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertText(baikeInfoVo);
             }
         }
@@ -1677,27 +1646,7 @@ public class PageServiceImpl implements PageService {
         List<CmBaikeReferenceInfo> referenceList = baikeProductVo.getReferenceList();
         if (null != referenceList && referenceList.size() > 0) {
             for (CmBaikeReferenceInfo reference : referenceList) {
-                if (null != reference) {
-                    if (null == reference.getPublicationYear()) {
-                        reference.setPublicationYear(null);
-                    }
-                    if (StringUtils.isEmpty(reference.getPublicationYearStr())) {
-                        reference.setPublicationYearStr(null);
-                    }
-                    if (null == reference.getPublishTime()) {
-                        reference.setPublishTime(null);
-                    }
-                    if (StringUtils.isEmpty(reference.getPublishTimeStr())) {
-                        reference.setPublishTimeStr(null);
-                    }
-                    if (null == reference.getAcitationTime()) {
-                        reference.setAcitationTime(null);
-                    }
-                    if (StringUtils.isEmpty(reference.getAcitationTimeStr())) {
-                        reference.setAcitationTimeStr(null);
-                    }
-                }
-                reference.setEntryId(baikeProductVo.getProductId());
+                reference.setEntryId(baikeProductVo.getId());
                 pageMapper.insertreference(reference);
             }
         }

+ 5 - 1
src/main/java/com/caimei365/commodity/service/impl/SearchProductServiceImpl.java

@@ -631,7 +631,6 @@ public class SearchProductServiceImpl implements SearchProductService {
             SearchFrequencyVo sea = new SearchFrequencyVo();
             sea.setKeyword(keyword);
             sea.setFrequency(1);
-            sea.setPath(path);
             sea.setFromSearch(fromType);
             sea.setSearchTime(new java.sql.Date(date.getTime()));
             searchFrequencyMapper.saveInfo(sea);
@@ -678,4 +677,9 @@ public class SearchProductServiceImpl implements SearchProductService {
             }
         }
     }
+
+    @Override
+    public List<SearchKeywordyVo> getKeywordLIstByData(String keyword) {
+        return searchFrequencyMapper.getKeywordList(keyword);
+    }
 }

+ 282 - 171
src/main/resources/mapper/PageMapper.xml

@@ -2,8 +2,9 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.commodity.mapper.PageMapper">
     <delete id="delSku">
-        delete from cm_sku
-        where skuId=#{skuId}
+        delete
+        from cm_sku
+        where skuId = #{skuId}
     </delete>
     <select id="getPageTypeSort" resultType="java.lang.Integer">
         select typeSort
@@ -156,38 +157,54 @@
         </if>
     </select>
     <select id="getProductItemById" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
-        select p.productID         as productId,
+        select p.productID                                                                          as productId,
                p.actStatus,
                p.name,
                p.aliasName,
-               p.mainImage         as image,
-               p.productCode       as code,
+               p.mainImage                                                                          as image,
+               p.productCode                                                                        as code,
                p.priceFlag,
-               (select unit from cm_sku where productID=#{productId} order by price asc LIMIT 1) as unit,
-               (select price from cm_sku where productID=#{productId} order by price asc LIMIT 1) as price,
-               (select price from cm_sku where productID=#{productId} order by price asc LIMIT 1) as originalPrice,
-               p.shopID            as shopId,
-               p.searchKey         as keyword,
-               (select minBuyNumber from cm_sku where productID=#{productId} order by price asc LIMIT 1) as minBuyNumber,
-               (select ladderPriceFlag from cm_sku where productID=#{productId} order by price asc LIMIT 1) as ladderPriceFlag,
-               (select normalPrice from cm_sku where productID=#{productId} order by price asc LIMIT 1) as normalPrice,
+               (select unit from cm_sku where productID = #{productId} order by price asc LIMIT 1)  as unit,
+               (select price from cm_sku where productID = #{productId} order by price asc LIMIT 1) as price,
+               (select price
+                from cm_sku
+                where productID = #{productId}
+                order by price asc
+                LIMIT 1)                                                                            as originalPrice,
+               p.shopID                                                                             as shopId,
+               p.searchKey                                                                          as keyword,
+               (select minBuyNumber
+                from cm_sku
+                where productID = #{productId}
+                order by price asc
+                LIMIT 1)                                                                            as minBuyNumber,
+               (select ladderPriceFlag
+                from cm_sku
+                where productID = #{productId}
+                order by price asc
+                LIMIT 1)                                                                            as ladderPriceFlag,
+               (select normalPrice
+                from cm_sku
+                where productID = #{productId}
+                order by price asc
+                LIMIT 1)                                                                            as normalPrice,
                p.step,
-               p.shopID            as shopId,
-               p.taxPoint          as taxRate,
+               p.shopID                                                                             as shopId,
+               p.taxPoint                                                                           as taxRate,
                p.includedTax,
                p.invoiceType,
-               p.productCategory   as productCategory,
+               p.productCategory                                                                    as productCategory,
                p.validFlag,
                p.featuredFlag,
                p.commodityType,
-               p.bigTypeID         as bigTypeId,
-               p.smallTypeID       as smallTypeId,
-               p.tinyTypeID        as tinyTypeId,
-               p.visibility        as visibility,
-               cshd.detailTalkFlag as detailTalkFlag,
+               p.bigTypeID                                                                          as bigTypeId,
+               p.smallTypeID                                                                        as smallTypeId,
+               p.tinyTypeID                                                                         as tinyTypeId,
+               p.visibility                                                                         as visibility,
+               cshd.detailTalkFlag                                                                  as detailTalkFlag,
                p.productType
         from product p
-        left join cm_second_hand_detail cshd on p.productID = cshd.productID
+                 left join cm_second_hand_detail cshd on p.productID = cshd.productID
         where p.productID = #{productId}
           and p.validFlag = 2
     </select>
@@ -213,24 +230,32 @@
         order by - sort desc,createDate desc
     </select>
     <select id="getProductDetails" resultType="com.caimei365.commodity.model.vo.ProductDetailVo">
-        select p.productID         as productId,
-               p.shopID            as shopId,
-               (select normalPrice from cm_sku where productId=#{productId} order by price asc limit 1) as normalPrice,
-               ifnull((select stock from cm_sku where productId=#{productId} order by price asc limit 1),0) as stock,
-               (select minBuyNumber from cm_sku where productId=#{productId} order by price asc limit 1) as minBuyNumber,
-               (select unit from cm_sku where productId=#{productId} order by price asc limit 1) as unit,
+        select p.productID                                                                                     as productId,
+               p.shopID                                                                                        as shopId,
+               (select normalPrice
+                from cm_sku
+                where productId = #{productId}
+                order by price asc
+                limit 1)                                                                                       as normalPrice,
+               ifnull((select stock from cm_sku where productId = #{productId} order by price asc limit 1), 0) as stock,
+               (select minBuyNumber
+                from cm_sku
+                where productId = #{productId}
+                order by price asc
+                limit 1)                                                                                       as minBuyNumber,
+               (select unit from cm_sku where productId = #{productId} order by price asc limit 1)             as unit,
                p.name,
                p.aliasName,
                p.commodityType,
                p.mainImage,
                p.invoiceType,
-               p.bigTypeID         as bigTypeId,
-               p.smallTypeID       as smallTypeId,
-               p.tinyTypeID        as tinyTypeId,
+               p.bigTypeID                                                                                     as bigTypeId,
+               p.smallTypeID                                                                                   as smallTypeId,
+               p.tinyTypeID                                                                                    as tinyTypeId,
                p.searchKey,
                p.visibility,
                p.commodityDetailsFlag,
-               p.brandID           as brandId,
+               p.brandID                                                                                       as brandId,
                p.productType,
                p.tags,
                p.includedTax,
@@ -259,51 +284,51 @@
                p.trainingType,
                p.trainingFee,
                p.productRemarks,
-               p.productDetail     as productDetailChose,
-               s.shopType          as shopType,
-               p.qualificationNo   as qualificationNo,
-               p.productName       as productName,
-               p.qualificationTime as qualificationTime,
-               p.qualificationLink as qualificationLink,
+               p.productDetail                                                                                 as productDetailChose,
+               s.shopType                                                                                      as shopType,
+               p.qualificationNo                                                                               as qualificationNo,
+               p.productName                                                                                   as productName,
+               p.qualificationTime                                                                             as qualificationTime,
+               p.qualificationLink                                                                             as qualificationLink,
                p.returnGoodsStutas
         from product p
                  left join shop s on s.shopId = p.shopId
         where p.productID = #{productId}
     </select>
     <select id="getBuyAgainProducts" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
-        select p.productID                as productId,
+        select p.productID                 as productId,
                p.actStatus,
                p.name,
                p.aliasName,
-               p.mainImage                as image,
+               p.mainImage                 as image,
                rpp.skuId,
                cs.unit,
-               p.productCode              as code,
+               p.productCode               as code,
                p.priceFlag,
                cs.price,
                cs.costPrice,
                ifnull(cs.costCheckFlag, 1) as costCheckFlag,
-               p.searchKey                as keyword,
+               p.searchKey                 as keyword,
                cs.minBuyNumber             as minBuyNumber,
                cs.ladderPriceFlag,
                cs.normalPrice,
                p.step,
-               p.shopID                   as shopId,
-               p.taxPoint                 as taxRate,
+               p.shopID                    as shopId,
+               p.taxPoint                  as taxRate,
                p.includedTax,
                p.invoiceType,
-               p.productCategory          as productCategory,
+               p.productCategory           as productCategory,
                p.validFlag,
                p.featuredFlag,
                p.commodityType,
-               p.bigTypeID                as bigTypeId,
-               p.smallTypeID              as smallTypeId,
-               p.tinyTypeID               as tinyTypeId,
-               rpp.currentPrice           as discountPrice,
+               p.bigTypeID                 as bigTypeId,
+               p.smallTypeID               as smallTypeId,
+               p.tinyTypeID                as tinyTypeId,
+               rpp.currentPrice            as discountPrice,
                p.productType
         from repeat_purchase_price rpp
-        left join product p on rpp.productId = p.productID
-        left join cm_sku cs on rpp.skuId = cs.skuId
+                 left join product p on rpp.productId = p.productID
+                 left join cm_sku cs on rpp.skuId = cs.skuId
         where rpp.delFlag = '0'
           and p.validFlag = '2'
           and rpp.userId = #{userId}
@@ -537,6 +562,7 @@
             AND appletsStatus = 1
         </if>
     </select>
+
     <select id="getProductArchiveList" resultType="com.caimei365.commodity.model.vo.ArchiveVo">
         select cpa.id AS "archiveId",
         cpa.productId AS "productId",
@@ -560,6 +586,7 @@
         </where>
         order by cpa.addTime desc
     </select>
+
     <select id="getImageArchiveList" resultType="com.caimei365.commodity.model.vo.ArchiveContentVo">
         select id as archiveContentId, title, addTime
         from cm_product_archive_content
@@ -567,6 +594,7 @@
           and type = 1
         order by addTime desc
     </select>
+
     <select id="getVideoArchiveList" resultType="com.caimei365.commodity.model.vo.ArchiveContentVo">
         select id as archiveContentId, title, addTime
         from cm_product_archive_content
@@ -574,6 +602,7 @@
           and type = 2
         order by addTime desc
     </select>
+
     <select id="getFileArchiveList" resultType="com.caimei365.commodity.model.vo.ArchiveContentVo">
         select id as archiveContentId, title, addTime
         from cm_product_archive_content
@@ -581,17 +610,20 @@
           and type = 3
         order by addTime desc
     </select>
+
     <select id="getArchiveImageList" resultType="java.lang.String">
         select ifnull(waterOssUrl, ossUrl) as ossUrl
         from cm_product_archive_file
         where archiveContentId = #{archiveContentId}
     </select>
+
     <select id="getArchiveFile" resultType="com.caimei365.commodity.model.po.ArchiveFilePo">
         select fileName, if(cc.type = 2, ossName, ifnull(waterOssName, ossName)) as ossName, uploadTime
         from cm_product_archive_file cf
                  left join cm_product_archive_content cc on cf.archiveContentId = cc.id
         where archiveContentId = #{archiveContentId}
     </select>
+
     <select id="getArchiveByArchiveId" resultType="com.caimei365.commodity.model.po.ArchivePo">
         select cpa.id                                                       AS "archiveId",
                cpa.productId                                                AS "productId",
@@ -607,60 +639,78 @@
                  left join shop s on p.shopID = s.shopID
         where cpa.id = #{archiveId}
     </select>
+
     <select id="getClubTypeByUserId" resultType="java.lang.Integer">
         select ifnull(firstClubType, 0)
         from club
         where userID = #{userId}
     </select>
+
     <select id="getArchiveIdById" resultType="java.lang.Integer">
         select id
         from cm_product_archive
         where productId = #{productId}
     </select>
+
     <select id="findBeansHistoryByArchiveId" resultType="java.lang.Integer">
         select id
         from user_beans_history
         where userId = #{userId}
           and archiveId = #{archiveId}
     </select>
+
     <select id="getSvipProductAdsImage" resultType="java.lang.String">
         select if(#{source} = 1, pcImage, appletsImage)
         from cm_svip_product_adsimage
         limit 1
     </select>
+
     <select id="getSvipProductList" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
-        select p.productID       as productId,
+        select p.productID                                                                           as productId,
                p.actStatus,
                p.name,
                p.aliasName,
-               p.mainImage       as image,
-               (select unit from cm_sku where productId=csp.productId order by price asc limit 1)as unit,
-               p.productCode     as code,
+               p.mainImage                                                                           as image,
+               (select unit from cm_sku where productId = csp.productId order by price asc limit 1)  as unit,
+               p.productCode                                                                         as code,
                p.priceFlag,
-               (select price from cm_sku where productId=csp.productId order by price asc limit 1)as price,
-               p.shopID          as shopId,
-               p.searchKey       as keyword,
-               (select minBuyNumber from cm_sku where productId=csp.productId order by price asc limit 1)as minBuyNumber,
-               (select ladderPriceFlag from cm_sku where productId=csp.productId order by price asc limit 1)as ladderPriceFlag,
-               (select normalPrice from cm_sku where productId=csp.productId order by price asc limit 1)as normalPrice,
+               (select price from cm_sku where productId = csp.productId order by price asc limit 1) as price,
+               p.shopID                                                                              as shopId,
+               p.searchKey                                                                           as keyword,
+               (select minBuyNumber
+                from cm_sku
+                where productId = csp.productId
+                order by price asc
+                limit 1)                                                                             as minBuyNumber,
+               (select ladderPriceFlag
+                from cm_sku
+                where productId = csp.productId
+                order by price asc
+                limit 1)                                                                             as ladderPriceFlag,
+               (select normalPrice
+                from cm_sku
+                where productId = csp.productId
+                order by price asc
+                limit 1)                                                                             as normalPrice,
                p.step,
-               p.shopID          as shopId,
-               p.taxPoint        as taxRate,
+               p.shopID                                                                              as shopId,
+               p.taxPoint                                                                            as taxRate,
                p.includedTax,
                p.invoiceType,
-               p.productCategory as productCategory,
+               p.productCategory                                                                     as productCategory,
                p.validFlag,
                p.featuredFlag,
                p.commodityType,
-               p.bigTypeID       as bigTypeId,
-               p.smallTypeID     as smallTypeId,
-               p.tinyTypeID      as tinyTypeId,
-               p.visibility      as visibility
+               p.bigTypeID                                                                           as bigTypeId,
+               p.smallTypeID                                                                         as smallTypeId,
+               p.tinyTypeID                                                                          as tinyTypeId,
+               p.visibility                                                                          as visibility
         from cm_svip_product csp
                  left join product p on p.productID = csp.productId
         where p.validFlag = 2
         order by -csp.sort desc, csp.addTime desc
     </select>
+
     <select id="getSvipUserIdByUserId" resultType="java.lang.Integer">
         select userId
         from cm_svip_user
@@ -668,12 +718,14 @@
           and delFlag = '0'
           and now() <![CDATA[ < ]]> endTime
     </select>
+
     <select id="getBannerImages" resultType="com.caimei365.commodity.model.vo.ImageLinkVo">
         select id, title, link, crmImage as image, crmImage, crmLink, crmTitle
         from new_page_homeimage
         where crmEnabledStatus = 1
         order by sort desc, createDate desc
     </select>
+
     <select id="getAfterSale" resultType="com.caimei365.commodity.model.vo.AfterSaleVo">
         SELECT id,
                organizeName,
@@ -692,12 +744,14 @@
         WHERE id = 0
           AND delFlag = '0'
     </select>
+
     <select id="getPageIdByTypeSort" resultType="java.lang.Integer">
         SELECT id
         FROM cm_page
         WHERE enabledStatus = 1
           AND typeSort = #{typeSort}
     </select>
+
     <select id="getSidebarLive" resultType="com.caimei365.commodity.model.vo.LiveVo">
         SELECT
         id,
@@ -726,6 +780,7 @@
         </if>
         ORDER BY topPosition
     </select>
+
     <select id="getSidebarInfo" resultType="com.caimei365.commodity.model.vo.InfoVo">
         SELECT id,
                typeId,
@@ -754,6 +809,7 @@
           AND enabledStatus = '1'
         ORDER BY topPosition
     </select>
+
     <select id="getSidebarPageImage" resultType="com.caimei365.commodity.model.vo.PageImageVo">
         SELECT
         id,
@@ -789,11 +845,13 @@
         </if>
         ORDER BY topPosition
     </select>
+
     <select id="getLiveAdvertisingImage" resultType="java.lang.String">
         SELECT advertisingImage
         FROM new_page_live_advertising_image
         LIMIT 1;
     </select>
+
     <select id="getAuthProductByProductId" resultType="com.caimei365.commodity.model.vo.AuthProductVo">
         select p.name       as productName,
                p.snCode,
@@ -829,6 +887,7 @@
           and a.auditStatus = 1
           and p.auditStatus = 1
     </select>
+
     <select id="getStatementFile" resultType="com.caimei365.commodity.model.vo.StatementFileVo">
         select name, ossName, md5Hex, uploadTime
         from cm_brand_auth_file
@@ -836,19 +895,22 @@
           and brandId = #{brandId}
         limit 1
     </select>
+
     <select id="getAuthProductParams" resultType="com.caimei365.commodity.model.po.BrandProductParamPo">
         select name, content
         from cm_brand_product_param
         where productId = #{productId}
     </select>
+
     <select id="getSidebarBaike" resultType="com.caimei365.commodity.model.vo.BaikeProductVo">
-        select id as productId,id, commodityType, name, image, publishTime
+        select id as productId, id, commodityType, name, image, publishTime
         from cm_baike_product
         WHERE topPosition IN (1, 2, 3)
           and status = 1
           and NOW() > publishTime
         order by topPosition
     </select>
+
     <select id="getBaikeTypeList" resultType="com.caimei365.commodity.model.vo.BaikeTypeVo">
         select id as typeId, name
         from cm_baike_type
@@ -856,6 +918,7 @@
           and status = 1
         order by -sort desc, addTime desc
     </select>
+
     <select id="getBaikeProducts" resultType="com.caimei365.commodity.model.vo.BaikeProductVo">
         select id as productId, id,commodityType, image, name, discription, publishTime, (basePv + actualPv) as pv
         from cm_baike_product
@@ -873,12 +936,14 @@
             limit #{limitNum}
         </if>
     </select>
+
     <select id="getBaikeQuestionList" resultType="java.lang.String">
         select question
         from cm_baike_product_question
         where productId = #{productId}
         limit 3
     </select>
+
     <select id="findHeheHomePage" resultType="com.caimei365.commodity.model.vo.CmPageVo">
         select id,
                type,
@@ -940,6 +1005,7 @@
         order by p.sortIndex desc,newshowTime desc
         limit 5
     </select>
+
     <select id="getNewFloorList" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
         SELECT DISTINCT
         (select price from cm_sku where productID=p.productID order by price asc limit 1)as price,
@@ -1090,74 +1156,81 @@
             and p.id=#{productId}
         </if>
         <if test="null !=typeId">
-            and  p.typeId=#{typeId}
+            and p.typeId=#{typeId}
         </if>
         <if test="null !=auditStatus">
-            and  p.auditStatus=#{auditStatus}
+            and p.auditStatus=#{auditStatus}
         </if>
         <if test="null !=onlineStatus">
             and p.onlineStatus=#{onlineStatus}
         </if>
         <if test="null !=status">
-            and  p.status=#{status}
+            and p.status=#{status}
         </if>
         <if test="null !=shopId">
-            and  p.shopId=#{shopId}
+            and p.shopId=#{shopId}
         </if>
         <if test="null !=name and '' != name">
-            and  p.name like concat('%',#{name},'%')
+            and p.name like concat('%',#{name},'%')
         </if>
         order by p.addTime desc
     </select>
 
     <update id="upEntryStatusById">
-        update cm_baike_product set status=#{status},publishTime=#{publishTime} where id=#{id};
+        update cm_baike_product
+        set status=#{status},
+            publishTime=#{publishTime}
+        where id = #{id};
     </update>
     <delete id="delEntryStatusById">
-        delete from cm_baike_product where id=#{id};
+        delete
+        from cm_baike_product
+        where id = #{id};
     </delete>
 
     <select id="getEntryInfoById" resultType="com.caimei365.commodity.model.vo.BaikeProductVo">
-        select
-        p.id as productId,
-        p.id,
-        p.commodityType,
-        p.name,
-        p.discription,
-        p.typeId,
-        p.actualPv as pv,
-        p.auditStatus,
-        p.onlineStatus,
-        p.status,
-        p.publishTime,
-        p.addTime,
-        p.alias,
-        p.image,
-        t.name as typeName,
-        p.publishSource,
-        p.shopId,
-        p.seoKeyword
+        select p.id       as productId,
+               p.id,
+               p.commodityType,
+               p.name,
+               p.discription,
+               p.typeId,
+               p.actualPv as pv,
+               p.auditStatus,
+               p.onlineStatus,
+               p.status,
+               p.publishTime,
+               p.addTime,
+               p.alias,
+               p.image,
+               t.name     as typeName,
+               p.publishSource,
+               p.shopId,
+               p.seoKeyword,
+               p.labelIds
         from cm_baike_product p
-        left join cm_baike_type t on p.typeId=t.id
-        where p.id=#{id}
+                 left join cm_baike_type t on p.typeId = t.id
+        where p.id = #{id}
     </select>
-    <select id="getImageListById"  resultType="com.caimei365.commodity.model.vo.BaikeImageVo">
-    select  id,productId as entryId,image from cm_baike_product_image
-        where productId=#{id}
+    <select id="getImageListById" resultType="com.caimei365.commodity.model.vo.BaikeImageVo">
+        select id, productId as entryId, image
+        from cm_baike_product_image
+        where productId = #{id}
     </select>
 
-    <select id="getInfoListById"  resultType="com.caimei365.commodity.model.vo.BaikeInfoVo">
-        select  id,productId as entryId,name as infoName,content as infoContent from cm_baike_product_param
-        where productId=#{id}
+    <select id="getInfoListById" resultType="com.caimei365.commodity.model.vo.BaikeInfoVo">
+        select id, productId as entryId, name as infoName, content as infoContent
+        from cm_baike_product_param
+        where productId = #{id}
     </select>
 
-    <select id="getTextInfoListById"  resultType="com.caimei365.commodity.model.vo.BaikeTextInfoVo">
-        select  id,productId as entryId,textType,dictionaryContent,referenceId,parentId,dictionaryType from cm_baike_text_info
-        where productId=#{id}
+    <select id="getTextInfoListById" resultType="com.caimei365.commodity.model.vo.BaikeTextInfoVo">
+        select id, productId as entryId, textType, dictionaryContent, referenceId, parentId, dictionaryType
+        from cm_baike_text_info
+        where productId = #{id}
     </select>
-    <select id="getReferenceListById"  resultType="com.caimei365.commodity.model.vo.CmBaikeReferenceInfo">
-        select
-               id,
+    <select id="getReferenceListById" resultType="com.caimei365.commodity.model.vo.CmBaikeReferenceInfo">
+        select id,
                referenceType,
                website,
                articleName,
@@ -1174,51 +1247,52 @@
                imageDescription,
                imageUrl,
                ctrlId,
-               productId as entryId,
+               productId   as entryId,
                productType as entryType
         from cm_baike_reference_info
-        where productId=#{id}
+        where productId = #{id}
     </select>
-    <select id="geTypeList"  resultType="com.caimei365.commodity.model.vo.BaikeTypeVo">
-        select  id as typeId,name from cm_baike_type
+    <select id="geTypeList" resultType="com.caimei365.commodity.model.vo.BaikeTypeVo">
+        select id as typeId, name
+        from cm_baike_type
     </select>
     <select id="getVideoListById" resultType="com.caimei365.commodity.model.vo.BaikeVideoVo">
-        select id, productId as entryId, fileTitle, fileName, ossName,ossUrl
+        select id, productId as entryId, fileTitle, fileName, ossName, ossUrl
         from cm_baike_product_file
         where productId = #{id}
     </select>
     <delete id="delReferenceById">
-        delete from cm_baike_reference_info where id=#{id}
+        delete
+        from cm_baike_reference_info
+        where id = #{id}
     </delete>
     <select id="getReferenceById" resultType="com.caimei365.commodity.model.vo.CmBaikeReferenceInfo">
-        select
-            id,
-            referenceType,
-            website,
-            articleName,
-            websiteName,
-            publishTime,
-            acitationTime,
-            author,
-            workName,
-            publicationPlace,
-            press,
-            publicationYear,
-            acitationWeb,
-            referenceDescription,
-            imageDescription,
-            imageUrl,
-            ctrlId,
-            productId as entryId,
-            productType as entryType
+        select id,
+               referenceType,
+               website,
+               articleName,
+               websiteName,
+               publishTime,
+               acitationTime,
+               author,
+               workName,
+               publicationPlace,
+               press,
+               publicationYear,
+               acitationWeb,
+               referenceDescription,
+               imageDescription,
+               imageUrl,
+               ctrlId,
+               productId   as entryId,
+               productType as entryType
         from cm_baike_reference_info
-        where id=#{id}
+        where id = #{id}
     </select>
 
     <update id="upReferenceInfoByid">
         update cm_baike_reference_info
-        set
-            referenceType=#{referenceType},
+        set referenceType=#{referenceType},
             website=#{website},
             articleName=#{articleName},
             websiteName=#{websiteName},
@@ -1234,22 +1308,25 @@
             referenceDescription=#{referenceDescription},
             imageDescription=#{imageDescription},
             imageUrl=#{imageUrl}
-        where id=#{id}
+        where id = #{id}
     </update>
     <insert id="insertReferenceInfo">
-        insert into
-            cm_baike_reference_info(referenceType, website, articleName,websiteName,publishTime,acitationTime,author,workName,publicationPlace,press,publicationYear,acitationWeb,referenceDescription,imageDescription,imageUrl,productId,productType,ctrlId)
-        values (#{referenceType}, #{website}, #{articleName},#{websiteName},#{publishTimeStr},#{acitationTimeStr},#{author},#{workName},#{publicationPlace},#{press},#{publicationYearStr},#{acitationWeb},#{referenceDescription},#{imageDescription},#{imageUrl},#{entryId},#{entryType},#{ctrlId})
+        insert into cm_baike_reference_info(referenceType, website, articleName, websiteName, publishTime,
+                                            acitationTime, author, workName, publicationPlace, press, publicationYear,
+                                            acitationWeb, referenceDescription, imageDescription, imageUrl, productId,
+                                            productType, ctrlId)
+        values (#{referenceType}, #{website}, #{articleName}, #{websiteName}, #{publishTimeStr}, #{acitationTimeStr},
+                #{author}, #{workName}, #{publicationPlace}, #{press}, #{publicationYearStr}, #{acitationWeb},
+                #{referenceDescription}, #{imageDescription}, #{imageUrl}, #{entryId}, #{entryType}, #{ctrlId})
     </insert>
 
     <update id="upEntryInfo">
         update cm_baike_product
-            set
-            commodityType=#{commodityType},
+        set commodityType=#{commodityType},
             name=#{name},
             discription=#{discription},
             typeId=#{typeId},
-            auditStatus =1,
+            auditStatus  =1,
             onlineStatus=1,
             status=#{status},
             publishTime=#{publishTime},
@@ -1258,60 +1335,94 @@
             image=#{image},
             publishSource=#{publishSource},
             shopId=#{shopId},
-            seoKeyword=#{seoKeyword}
-        where id=#{id}
+            seoKeyword=#{seoKeyword},
+            labelIds = #{labelIds}
+        where id = #{id}
     </update>
 
-    <insert id="insertEntryInfo">
+    <insert id="insertEntryInfo" useGeneratedKeys="true" keyProperty="id">
         insert into cm_baike_product
-            (commodityType, name, discription,typeId,actualPv,auditStatus,onlineStatus,status,publishTime,addTime,alias,image,seoKeyword,publishSource,shopId)
-        values (#{commodityType}, #{name}, #{discription},#{typeId},0,1,1,#{status},#{publishTime},NOW(),#{alias},#{image},#{seoKeyword},#{publishSource},#{shopId})
+        (commodityType, name, discription, typeId, actualPv, auditStatus, onlineStatus, status, publishTime, addTime,
+         alias, image, seoKeyword, publishSource, shopId, labelIds)
+        values (#{commodityType}, #{name}, #{discription}, #{typeId}, 0, 1, 1, #{status}, #{publishTime}, NOW(),
+                #{alias}, #{image}, #{seoKeyword}, #{publishSource}, #{shopId}, #{labelIds})
     </insert>
+
     <delete id="delImageListByEntryId">
-        delete from cm_baike_product_image where productId=#{id}
+        delete
+        from cm_baike_product_image
+        where productId = #{id}
     </delete>
+
     <delete id="delVideoListByEntryId">
-        delete from cm_baike_product_file where productId=#{id}
+        delete
+        from cm_baike_product_file
+        where productId = #{id}
     </delete>
+
     <delete id="delInfoListByEntryId">
-        delete from cm_baike_product_param where productId=#{id}
+        delete
+        from cm_baike_product_param
+        where productId = #{id}
     </delete>
+
     <delete id="delTextListByEntryId">
-        delete from cm_baike_text_info where productId=#{id}
+        delete
+        from cm_baike_text_info
+        where productId = #{id}
     </delete>
+
     <delete id="delreferenceByEntryId">
-        delete from cm_baike_reference_info where productId=#{id}
+        delete
+        from cm_baike_reference_info
+        where productId = #{id}
     </delete>
 
     <insert id="insertImage">
-        insert into cm_baike_product_image(productId,image)
-        values(#{entryId},#{image})
+        insert into cm_baike_product_image(productId, image)
+        values (#{entryId}, #{image})
     </insert>
+
     <insert id="insertVideo">
-        insert into cm_baike_product_file(productId,fileTitle,fileName,ossName,ossUrl)
-        values(#{entryId},#{fileTitle},#{fileName},#{ossName},#{ossUrl})
+        insert into cm_baike_product_file(productId, fileTitle, fileName, ossName, ossUrl)
+        values (#{entryId}, #{fileTitle}, #{fileName}, #{ossName}, #{ossUrl})
     </insert>
+
     <insert id="insertInfo">
-        insert into cm_baike_product_param(productId,name,content)
-        values(#{entryId},#{infoName},#{infoContent})
+        insert into cm_baike_product_param(productId, name, content)
+        values (#{entryId}, #{infoName}, #{infoContent})
     </insert>
+
     <insert id="insertText">
-        insert into cm_baike_text_info(textType,productId,dictionaryContent,referenceId,parentId,dictionaryType)
-        values(#{textType},#{entryId},#{dictionaryContent},#{referenceId},#{parentId},#{dictionaryType})
+        insert into cm_baike_text_info(textType, productId, dictionaryContent, referenceId, parentId, dictionaryType)
+        values (#{textType}, #{entryId}, #{dictionaryContent}, #{referenceId}, #{parentId}, #{dictionaryType})
     </insert>
+
     <insert id="insertreference">
-        insert into
-            cm_baike_reference_info(referenceType, website, articleName,websiteName,publishTime,acitationTime,author,workName,publicationPlace,press,publicationYear,acitationWeb,referenceDescription,imageDescription,imageUrl,productId,productType,ctrlId)
-        values (#{referenceType}, #{website}, #{articleName},#{websiteName},#{publishTimeStr},#{acitationTimeStr},#{author},#{workName},#{publicationPlace},#{press},#{publicationYearStr},#{acitationWeb},#{referenceDescription},#{imageDescription},#{imageUrl},#{entryId},#{entryType},#{ctrlId})
+        insert into cm_baike_reference_info(referenceType, website, articleName, websiteName, publishTime,
+                                            acitationTime, author, workName, publicationPlace, press, publicationYear,
+                                            acitationWeb, referenceDescription, imageDescription, imageUrl, productId,
+                                            productType, ctrlId)
+        values (#{referenceType}, #{website}, #{articleName}, #{websiteName}, #{publishTimeStr}, #{acitationTimeStr},
+                #{author}, #{workName}, #{publicationPlace}, #{press}, #{publicationYearStr}, #{acitationWeb},
+                #{referenceDescription}, #{imageDescription}, #{imageUrl}, #{entryId}, #{entryType}, #{ctrlId})
     </insert>
-    <select id="getentryId" resultType="java.lang.Integer">
-        select id from cm_baike_product order by id desc limit 1
-    </select>
 
     <select id="getShopid" resultType="java.lang.Integer">
-        select cmShopId from cm_brand_auth_user where authUserId=#{authUserId}
+        select cmShopId
+        from cm_brand_auth_user
+        where authUserId = #{authUserId}
     </select>
     <select id="getHelpContent" resultType="java.lang.String">
-        select content from helppage where helpPageID=#{helpId}
+        select content
+        from helppage
+        where helpPageID = #{helpId}
+    </select>
+    <select id="findLabels" resultType="java.lang.String">
+        select keyword
+        from cm_user_search_frequency
+        where trueStatus = 1
+        and delStatus = 1
+        and id in (#{labelIds})
     </select>
 </mapper>

+ 3 - 4
src/main/resources/mapper/SearchFrequencyMapper.xml

@@ -26,9 +26,8 @@
     </select>
 
     <insert id="saveInfo" parameterType="com.caimei365.commodity.model.vo.SearchFrequencyVo">
-        insert into cm_user_search_frequency(fromSearch, path, keyword, frequency, searchTime)
-        values (#{fromSearch}, #{path}, #{keyword}, #{frequency}, #{searchTime})
-
+        insert into cm_user_search_frequency(fromSearch, keyword, frequency, searchTime)
+        values (#{fromSearch}, #{keyword}, #{frequency}, #{searchTime})
     </insert>
 
     <update id="upFrequencyById">
@@ -39,7 +38,7 @@
 
     <select id="getKeywordList" resultType="com.caimei365.commodity.model.vo.SearchKeywordyVo">
         select
-        keyword
+        id,keyword
         from cm_user_search_frequency
         where trueStatus=1
         and delStatus=1