Browse Source

人群包功能开发,查询列表入参条件变更

zhaoxian 4 years ago
parent
commit
39fabecf85

+ 3 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaishouCrowdPackMapper.java

@@ -17,9 +17,9 @@ import java.util.List;
  */
 public interface KuaishouCrowdPackMapper extends BaseMapper<KuaishouCrowdPack> {
 
-    Long getTotal(@Param(value = "status") Integer status, @Param(value = "accountName") String accountName, @Param(value = "orientationName") String orientationName);
+    Long getTotal(@Param(value = "status") Integer status, @Param(value = "accountId") Long accountId, @Param(value = "orientationName") String orientationName);
 
-    List<JSONObject> queryPageList(@Param(value = "status") Integer status, @Param(value = "accountName") String accountName, @Param(value = "orientationName") String orientationName);
+    List<JSONObject> queryPageList(@Param(value = "status") Integer status, @Param(value = "accountId") Long accountId, @Param(value = "orientationName") String orientationName);
 
     List<KuaishouCrowdPack> queryListByStatus();
 
@@ -33,7 +33,7 @@ public interface KuaishouCrowdPackMapper extends BaseMapper<KuaishouCrowdPack> {
 
     Integer queryProjectCount(@Param(value = "signature") String signature);
 
-    KuaishouCrowdPack queryByAccountId(@Param(value = "accountId") Long accountId,@Param(value = "orientationId") Long orientationId);
+    KuaishouCrowdPack queryByAccountId(@Param(value = "accountId") Long accountId, @Param(value = "orientationId") Long orientationId);
 
     Integer queryAccountCount(@Param(value = "signature") String signature);
 

+ 9 - 9
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaishouCrowdPackMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="cn.com.ctop.kuaishou.modules.ai.mapper.KuaishouCrowdPackMapper">
 
     <select id="getTotal" resultType="java.lang.Long">
-        SELECT COUNT(1) FROM(
+        SELECT  IFNULL(COUNT(1),0) FROM(
         SELECT 1
         FROM ctop_kuaishou_crowd_package t1
         LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
@@ -14,8 +14,8 @@
         <if test="orientationName !=null">
             AND orientation_name LIKE CONCAT('%',#{orientationName},'%')
         </if>
-        <if test="accountName !=null">
-            AND t2.auth_name LIKE CONCAT('%',#{accountName},'%')
+        <if test="accountId !=null">
+            AND t2.account_id = #{accountId}
         </if>
         <if test="status !=null">
             AND t1.`status` =#{status}
@@ -105,8 +105,8 @@
         <if test="orientationName !=null">
             AND orientation_name LIKE CONCAT('%',#{orientationName},'%')
         </if>
-        <if test="accountName !=null">
-            AND t2.auth_name LIKE CONCAT('%',#{accountName},'%')
+        <if test="accountId !=null">
+            AND t2.account_id =#{accountId}
         </if>
         <if test="status !=null">
             AND t1.`status` =#{status}
@@ -125,8 +125,8 @@
         <if test="orientationName !=null">
             AND orientation_name LIKE CONCAT('%',#{orientationName},'%')
         </if>
-        <if test="accountName !=null">
-            AND t2.auth_name LIKE CONCAT('%',#{accountName},'%')
+        <if test="accountId !=null">
+            AND t2.account_id =#{accountId}
         </if>
         <if test="status !=null">
             AND t4.`status` =#{status}
@@ -249,7 +249,7 @@
     </select>
 
     <select id="queryProjectCount" resultType="java.lang.Integer">
-        SELECT COUNT(1)
+        SELECT IFNULL(COUNT(1),0)
         FROM (SELECT t2.project_id
               FROM ctop_kuaishou_crowd_package t1
                        INNER JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
@@ -260,7 +260,7 @@
               GROUP BY project_id) t
     </select>
     <select id="queryAccountCount" resultType="java.lang.Integer">
-        SELECT COUNT(1)
+        SELECT IFNULL(COUNT(1),0)
         FROM (
                  SELECT account_id
                  FROM ctop_kuaishou_crowd_package

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouCrowdPackServiceImpl.java

@@ -62,9 +62,9 @@ public class KuaishouCrowdPackServiceImpl extends ServiceImpl<KuaishouCrowdPackM
 
     @Override
     public Result<Object> queryPageList(KuaishouCrowdPack kuaishouCrowdPack, Integer pageNo, Integer pageSize) {
-        Long total = crowdPackMapper.getTotal(kuaishouCrowdPack.getStatus(), kuaishouCrowdPack.getAccountName(), kuaishouCrowdPack.getOrientationName());
+        Long total = crowdPackMapper.getTotal(kuaishouCrowdPack.getStatus(), kuaishouCrowdPack.getAccountId(), kuaishouCrowdPack.getOrientationName());
         PageHelper.startPage(pageNo, pageSize, false);
-        List<JSONObject> list = crowdPackMapper.queryPageList(kuaishouCrowdPack.getStatus(), kuaishouCrowdPack.getAccountName(), kuaishouCrowdPack.getOrientationName());
+        List<JSONObject> list = crowdPackMapper.queryPageList(kuaishouCrowdPack.getStatus(), kuaishouCrowdPack.getAccountId(), kuaishouCrowdPack.getOrientationName());
         for (JSONObject object : list) {
             int count = crowdPackMapper.queryProjectCount(object.getString("signature"));
             object.put("projectCount", count);