浏览代码

在达人公海,添加渠道人员筛选

zhaoxian 2 年之前
父节点
当前提交
c452860629

+ 2 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouPromoterController.java

@@ -62,11 +62,12 @@ public class KuaishouPromoterController extends BaseController {
     @GetMapping("/list2")
     @ApiOperation(value = "达人公海")
     public TableDataInfo list2(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) Long promoterId,
+                               @ApiParam("渠道人员ID") @RequestParam(value = "userId", required = false) Long userId,
                                @ApiParam("达人名称") @RequestParam(value = "promoterNickName", required = false) String promoterNickName,
                                @ApiParam("认领状态,1-认领,2-未认领") @RequestParam(value = "status", required = false) String status,
                                @ApiParam("排序参数") @RequestParam(value = "parameter", required = false) String parameter,
                                @ApiParam("正序倒叙") @RequestParam(value = "orderBy", required = false) String orderBy) {
-        List<JSONObject> list = kuaishouPromoterService.selectKuaishouPromoterList2(promoterId, promoterNickName, status, parameter, orderBy);
+        List<JSONObject> list = kuaishouPromoterService.selectKuaishouPromoterList2(userId, promoterId, promoterNickName, status, parameter, orderBy);
         return getDataTable(list);
     }
 

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouPromoterMapper.java

@@ -68,7 +68,7 @@ public interface KuaishouPromoterMapper {
 
     void updateKuaishouPromoterByPromoterId(KuaishouPromoter promoters);
 
-    List<JSONObject> selectAllPromoterList(@Param("promoterId") Long promoterId, @Param("promoterNickName") String promoterNickName, @Param("status") String status, @Param("parameter") String parameter, @Param("orderBy") String orderBy);
+    List<JSONObject> selectAllPromoterList(@Param("userId") Long userId, @Param("promoterId") Long promoterId, @Param("promoterNickName") String promoterNickName, @Param("status") String status, @Param("parameter") String parameter, @Param("orderBy") String orderBy);
 
     List<KuaishouPromoter> getFailInfo();
 

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouPromoterService.java

@@ -62,7 +62,7 @@ public interface IKuaishouPromoterService {
 
     JSONObject getgetMonthPromoterTotal(List<Long> userList, String start, String end);
 
-    List<JSONObject> selectKuaishouPromoterList2(Long promoterId, String promoterNickName, String status, String parameter, String orderBy);
+    List<JSONObject> selectKuaishouPromoterList2(Long userId, Long promoterId, String promoterNickName, String status, String parameter, String orderBy);
 
     Result supplementInfo();
 

+ 2 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -120,7 +120,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
-    public List<JSONObject> selectKuaishouPromoterList2(Long promoterId, String promoterNickName, String status, String parameter, String orderBy) {
+    public List<JSONObject> selectKuaishouPromoterList2(Long userId, Long promoterId, String promoterNickName, String status, String parameter, String orderBy) {
         if (Check.isNull(parameter)) {
             parameter = "promoterId";
         } else if ("avgVideoSales".equals(parameter)) {
@@ -132,7 +132,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
             orderBy = "desc";
         }
         PageUtils.startPage();
-        List<JSONObject> list = kuaishouPromoterMapper.selectAllPromoterList(promoterId, promoterNickName, status, parameter, orderBy);
+        List<JSONObject> list = kuaishouPromoterMapper.selectAllPromoterList(userId, promoterId, promoterNickName, status, parameter, orderBy);
         return list;
     }
 

+ 14 - 1
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -114,7 +114,15 @@
         FROM
         promoter_info t0
         LEFT JOIN promoter_oerder_amount t1 ON t1.promoter_id = t0.promoter_id
-        LEFT JOIN (
+        <choose>
+            <when test="userId !=null and userId !='' ">
+                RIGHT
+            </when>
+            <otherwise>
+                LEFT
+            </otherwise>
+        </choose>
+        JOIN (
         SELECT
         promoter_id,
         group_concat( user_name ) AS 'userName',
@@ -124,6 +132,11 @@
         avg_video_sales,
         video_sales
         FROM kuaishou_promoter
+        <where>
+            <if test="userId != null ">
+                and user_id = #{userId}
+            </if>
+        </where>
         GROUP BY promoter_id
         ) t2 ON t1.promoter_id = t2.promoter_id
         <where>