Ver código fonte

模糊查询

yumeng 5 anos atrás
pai
commit
8f36cdd6b1

+ 20 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/MaterialRefuseController.java

@@ -95,9 +95,28 @@ public class MaterialRefuseController {
             return map;
         }
 
-
         return null;
     }
 
 
+    @PostMapping(value = "/selectByCreateName")
+    public Map<String, Object> selectByCreateName(@RequestBody JSONObject jsonObject) {
+        Map<String, Object> map = new HashMap<>();
+        try {
+            Long accountId = jsonObject.getLong("accountId");
+            String creativeName = jsonObject.getString("creativeName");
+            List<JSONObject> list = materialRefuseService.getRefuseCreativeByCreateName(accountId, creativeName);
+
+
+            map.put("code", 0);
+            map.put("data", list);
+        } catch (Exception e) {
+            map.put("code", -1);
+            e.printStackTrace();
+        }
+
+        return map;
+    }
+
+
 }

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/MaterialRefuseMapper.java

@@ -1,9 +1,12 @@
 package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 public interface MaterialRefuseMapper {
     List<JSONObject> selectRefuseCreativeByAccountId(Long accountId);
+
+    List<JSONObject> getRefuseCreativeByCreateName(@Param("accountId") Long accountId, @Param("creativeName") String creativeName);
 }

+ 22 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/MateriaRefuseMapper.xml

@@ -23,4 +23,26 @@
     </select>
 
 
+    <select id="getRefuseCreativeByCreateName" resultType="com.alibaba.fastjson.JSONObject">
+        select
+         t1.account_id accountId,
+         t1.campaign_id campaignId,
+         t1.unit_id unitId,
+         t1.creative_id creativeId,
+         t1.creative_name creativeName,
+         t2.url videoUrl,
+         t1.cover_url coverUrl,
+         t1.review_detail reviewDetail,
+         t1.description description
+    from
+        ctop_kuaishou_creative t1
+       left join ctop_kuaishou_video_get t2
+       on t1.account_id = t2.account_id
+       and t1.photo_id = t2.photo_id
+       where  t1.account_id = #{accountId}
+       and status = 42
+       and creative_name like '%'#{creativeName}'%'
+    </select>
+
+
 </mapper>

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IMaterialRefuseService.java

@@ -7,4 +7,6 @@ import java.util.List;
 
 public interface IMaterialRefuseService {
     List<JSONObject> getRefuseCreative(@Param("accountId") Long accountId);
+
+    List<JSONObject> getRefuseCreativeByCreateName(Long accountId, String creativeName);
 }

+ 6 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/MaterialRefuseServiceImpl.java

@@ -21,4 +21,10 @@ public class MaterialRefuseServiceImpl implements IMaterialRefuseService {
         List<JSONObject> refuseCreativeList = materialRefuseMapper.selectRefuseCreativeByAccountId(accountId);
         return refuseCreativeList;
     }
+
+    @Override
+    public List<JSONObject> getRefuseCreativeByCreateName(Long accountId, String creativeName) {
+        List<JSONObject> refuseCreativeList = materialRefuseMapper.getRefuseCreativeByCreateName(accountId, creativeName);
+        return refuseCreativeList;
+    }
 }