yumeng 1 год назад
Родитель
Сommit
78f8fc50f7

+ 174 - 15
ruixuan-live/src/main/java/com/ruixuan/jiaoyang/controller/JiaoYangReportController.java

@@ -6,6 +6,9 @@ import com.ruixuan.common.core.page.TableDataInfo;
 import com.ruixuan.common.utils.Check;
 import com.ruixuan.common.utils.DateUtils;
 import com.ruixuan.jiaoyang.service.IJiaoYangReportService;
+import com.ruixuan.system.service.ISysDeptService;
+import com.ruixuan.system.service.ISysRoleService;
+import com.ruixuan.system.service.ISysUserService;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.SneakyThrows;
@@ -16,17 +19,19 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @RestController
 @RequestMapping("/jy/report")
 public class JiaoYangReportController extends BaseController {
     @Autowired
     private IJiaoYangReportService jiaoYangReportService;
-
+    @Autowired
+    private ISysRoleService sysRoleService;
+    @Autowired
+    private ISysDeptService sysDeptService;
+    @Autowired
+    private ISysUserService sysUserService;
 
     /**
      * 商品数据
@@ -143,9 +148,28 @@ public class JiaoYangReportController extends BaseController {
                                   @ApiParam("订单结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
                                   @ApiParam("达人名称") @RequestParam(value = "promoterNickName", required = false) String promoterNickName,
                                   @ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) Long promoterId,
-                                  @ApiParam("类型") @RequestParam(value = "type", required = false) Long type) {
+                                  @ApiParam("类型") @RequestParam(value = "type", required = false) Long type,
+                                  Long userId) {
 
         Map<String, Object> requestMap = new HashMap<>();
+
+        String roleId = sysRoleService.getRoleBYUserId(userId);
+        if ("jy_bd".equals(roleId) || "jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId) || "jy_scissors".equals(roleId)) {
+            List<Long> userIds = new ArrayList<>();
+            if ("jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId)) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+            } else {
+                userIds.add(userId);
+            }
+            List<Long> promoterIds = jiaoYangReportService.getPromoterIdsByUserIds(userIds);
+            if (Check.isNull(promoterIds)) {
+                return getDataTable(new ArrayList<JSONObject>());
+            }
+            requestMap.put("promoterIds", promoterIds);
+        }
+
+
         if (!Check.isNull(orderStartDate)) {
             Long start = DateUtils.strDateToInt(orderStartDate);
             requestMap.put("start", start);
@@ -192,8 +216,23 @@ public class JiaoYangReportController extends BaseController {
             @ApiParam("订单开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
             @ApiParam("订单结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
             @ApiParam("商品名称") @RequestParam(value = "itemTitle", required = false) String itemTitle,
-            @ApiParam("商品ID") @RequestParam(value = "itemId", required = false) String itemId) {
+            @ApiParam("商品ID") @RequestParam(value = "itemId", required = false) String itemId, Long userId) {
         Map<String, Object> requestMap = new HashMap<>();
+        String roleId = sysRoleService.getRoleBYUserId(userId);
+        if ("jy_bd".equals(roleId) || "jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId) || "jy_scissors".equals(roleId)) {
+            List<Long> userIds = new ArrayList<>();
+            if ("jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId)) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+            } else {
+                userIds.add(userId);
+            }
+            List<Long> promoterIds = jiaoYangReportService.getPromoterIdsByUserIds(userIds);
+            if (Check.isNull(promoterIds)) {
+                return getDataTable(new ArrayList<>());
+            }
+            requestMap.put("promoterIds", promoterIds);
+        }
         if (!Check.isNull(orderStartDate)) {
             Long start = DateUtils.strDateToInt(orderStartDate);
             requestMap.put("start", start);
@@ -229,8 +268,24 @@ public class JiaoYangReportController extends BaseController {
     public JSONObject promoterStatistics(
             @ApiParam("达人Id") @RequestParam(value = "promoterId", required = false) String promoterId,
             @ApiParam("订单开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
-            @ApiParam("订单结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
+            @ApiParam("订单结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,Long userId) {
         Map<String, Object> requestMap = new HashMap<>();
+        String roleId = sysRoleService.getRoleBYUserId(userId);
+        if ("jy_bd".equals(roleId) || "jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId) || "jy_scissors".equals(roleId)) {
+            List<Long> userIds = new ArrayList<>();
+            if ("jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId)) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+            } else {
+                userIds.add(userId);
+            }
+            List<Long> promoterIds = jiaoYangReportService.getPromoterIdsByUserIds(userIds);
+            if (Check.isNull(promoterIds)) {
+                return new JSONObject();
+            }
+            requestMap.put("promoterIds", promoterIds);
+        }
+
         if (!Check.isNull(orderStartDate)) {
             Long start = DateUtils.strDateToInt(orderStartDate);
             requestMap.put("start", start);
@@ -271,9 +326,27 @@ public class JiaoYangReportController extends BaseController {
     public JSONObject orderTotal(
             @ApiParam("时间类型") @RequestParam(value = "dateType", required = false) Integer dateType,
             @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
-            @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
+            @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
+            @ApiParam("结束时间") @RequestParam(value = "userId", required = false) Long userId
+    ) {
         Map<String, Object> requestMap = new HashMap<>();
         JSONObject returnJson = new JSONObject();
+
+        String roleId = sysRoleService.getRoleBYUserId(userId);
+        if ("jy_bd".equals(roleId) || "jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId) || "jy_scissors".equals(roleId)) {
+            List<Long> userIds = new ArrayList<>();
+            if ("jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId)) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+            } else {
+                userIds.add(userId);
+            }
+            List<Long> promoterIds = jiaoYangReportService.getPromoterIdsByUserIds(userIds);
+            if (Check.isNull(promoterIds)) {
+                return returnJson;
+            }
+            requestMap.put("promoterIds", promoterIds);
+        }
         if (dateType == 0) {
             if (!Check.isNull(orderStartDate)) {
                 Long start = DateUtils.strDateToInt(orderStartDate); //当天开始时间
@@ -332,10 +405,29 @@ public class JiaoYangReportController extends BaseController {
     public JSONObject indexServiceAmountInfo(
             @ApiParam("时间类型") @RequestParam(value = "dateType", required = false) Integer dateType,
             @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
-            @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
+            @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
+            Long userId
+    ) {
         Map<String, Object> requestMap = new HashMap<>();
         JSONObject returnJson = new JSONObject();
 
+        String roleId = sysRoleService.getRoleBYUserId(userId);
+        if ("jy_bd".equals(roleId) || "jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId) || "jy_scissors".equals(roleId)) {
+            List<Long> userIds = new ArrayList<>();
+            if ("jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId)) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+            } else {
+                userIds.add(userId);
+            }
+            List<Long> promoterIds = jiaoYangReportService.getPromoterIdsByUserIds(userIds);
+            if (Check.isNull(promoterIds)) {
+                return returnJson;
+            }
+            requestMap.put("promoterIds", promoterIds);
+        }
+
+
         if (!Check.isNull(orderStartDate)) {
             Long start = DateUtils.strDateToInt(orderStartDate);
             requestMap.put("start", start);
@@ -363,9 +455,26 @@ public class JiaoYangReportController extends BaseController {
     public JSONObject indexAmountInfo(
             @ApiParam("时间类型") @RequestParam(value = "dateType", required = false) Integer dateType,
             @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
-            @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
+            @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
+            Long userId) {
         Map<String, Object> requestMap = new HashMap<>();
         JSONObject returnJson = new JSONObject();
+
+        String roleId = sysRoleService.getRoleBYUserId(userId);
+        if ("jy_bd".equals(roleId) || "jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId) || "jy_scissors".equals(roleId)) {
+            List<Long> userIds = new ArrayList<>();
+            if ("jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId)) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+            } else {
+                userIds.add(userId);
+            }
+            List<Long> promoterIds = jiaoYangReportService.getPromoterIdsByUserIds(userIds);
+            if (Check.isNull(promoterIds)) {
+                return returnJson;
+            }
+            requestMap.put("promoterIds", promoterIds);
+        }
         if (dateType == 0) {
             if (!Check.isNull(orderStartDate)) {
                 Long start = DateUtils.strDateToInt(orderStartDate); //当天开始时间
@@ -417,11 +526,28 @@ public class JiaoYangReportController extends BaseController {
             @ApiParam("时间类型") @RequestParam(value = "dateType", required = true) Integer dateType,
             @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = true) String orderStartDate,
             @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = true) String orderEndDate,
-            @ApiParam("userId") @RequestParam(value = "userId", required = false) Long userId,
-            @ApiParam("媒体,1-抖音;2-快手") @RequestParam(value = "mediaId", required = false) String mediaId
+            @ApiParam("userId") @RequestParam(value = "userId", required = false) Long userId
     ) {
 
         Map<String, Object> requestMap = new HashMap<>();
+
+        String roleId = sysRoleService.getRoleBYUserId(userId);
+        if ("jy_bd".equals(roleId) || "jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId) || "jy_scissors".equals(roleId)) {
+            List<Long> userIds = new ArrayList<>();
+            if ("jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId)) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+            } else {
+                userIds.add(userId);
+            }
+            List<Long> promoterIds = jiaoYangReportService.getPromoterIdsByUserIds(userIds);
+            if (Check.isNull(promoterIds)) {
+                return getDataTable(
+                        new ArrayList<>()
+                );
+            }
+            requestMap.put("promoterIds", promoterIds);
+        }
         if (dateType == 0) {
 
             if (!Check.isNull(orderStartDate)) {
@@ -514,8 +640,24 @@ public class JiaoYangReportController extends BaseController {
     public List<JSONObject> indexStatistics(
             @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
             @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
-            @ApiParam("类型") @RequestParam(value = "type", required = false) String type) {
+            @ApiParam("类型") @RequestParam(value = "type", required = false) String type,
+            Long userId) {
         Map<String, Object> requestMap = new HashMap<>();
+        String roleId = sysRoleService.getRoleBYUserId(userId);
+        if ("jy_bd".equals(roleId) || "jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId) || "jy_scissors".equals(roleId)) {
+            List<Long> userIds = new ArrayList<>();
+            if ("jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId)) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+            } else {
+                userIds.add(userId);
+            }
+            List<Long> promoterIds = jiaoYangReportService.getPromoterIdsByUserIds(userIds);
+            if (Check.isNull(promoterIds)) {
+                return new ArrayList<>();
+            }
+            requestMap.put("promoterIds", promoterIds);
+        }
         String nowDate = DateUtils.getNowDateStr();
         Long start = null;
         Long end = null;
@@ -552,8 +694,25 @@ public class JiaoYangReportController extends BaseController {
     @ApiOperation(value = "首页-时段对比")
     public JSONObject indexTimeIntervalRatio(
             @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
-            @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
+            @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
+            Long userId
+    ) {
         Map<String, Object> requestMap = new HashMap<>();
+        String roleId = sysRoleService.getRoleBYUserId(userId);
+        if ("jy_bd".equals(roleId) || "jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId) || "jy_scissors".equals(roleId)) {
+            List<Long> userIds = new ArrayList<>();
+            if ("jy_bd_manage".equals(roleId) || "jy_scissors_manage".equals(roleId)) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+            } else {
+                userIds.add(userId);
+            }
+            List<Long> promoterIds = jiaoYangReportService.getPromoterIdsByUserIds(userIds);
+            if (Check.isNull(promoterIds)) {
+                return new JSONObject();
+            }
+            requestMap.put("promoterIds", promoterIds);
+        }
         String nowDate = DateUtils.getNowDateStr();
         String thisCycleEnd = null; // 当前时段结束日期
         String thisCycleStart = null; // 当前时段开始日期

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/jiaoyang/mapper/JiaoYangReportMapper.java

@@ -40,4 +40,6 @@ public interface JiaoYangReportMapper {
     List<JSONObject> indexStatistics(Map<String, Object> requestMap);
 
     JSONObject getTimeIntervalRatio(Map<String, Object> requestMap);
+
+    List<Long> getPromoterIdsByUserIds(@Param("userIds") List<Long> userIds);
 }

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/jiaoyang/service/IJiaoYangReportService.java

@@ -39,4 +39,6 @@ public interface IJiaoYangReportService {
     List<JSONObject> indexStatistics(Map<String, Object> requestMap);
 
     JSONObject getTimeIntervalRatio(Map<String, Object> requestMap);
+
+    List<Long> getPromoterIdsByUserIds(List<Long> userIds);
 }

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/jiaoyang/service/impl/JiaoYangReportServiceImpl.java

@@ -98,4 +98,9 @@ public class JiaoYangReportServiceImpl implements IJiaoYangReportService {
     public JSONObject getTimeIntervalRatio(Map<String, Object> requestMap) {
         return jiaoYangReportMapper.getTimeIntervalRatio(requestMap);
     }
+
+    @Override
+    public List<Long> getPromoterIdsByUserIds(List<Long> userIds) {
+        return jiaoYangReportMapper.getPromoterIdsByUserIds(userIds);
+    }
 }

+ 106 - 2
ruixuan-live/src/main/resources/mapper/jiaoyang/JiaoYangReportMapper.xml

@@ -174,6 +174,13 @@
         <if test="end != null and end != ''">
             and stat_date &lt;= #{end}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t
         group by t.stat_date
         order by t.stat_date asc
@@ -233,7 +240,13 @@
         <if test="end != null and end != ''">
             and stat_date &lt;= #{end}
         </if>
-
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
 
     </select>
     <select id="getOrderTotalRatio" resultType="java.lang.Double">
@@ -248,6 +261,13 @@
         <if test="hour != null and hour != ''">
             and stat_hour &lt;= #{hour}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t1
         join (select count(oid) as 'oid'
         from jy_order_list
@@ -258,6 +278,13 @@
         <if test="hour != null and hour != ''">
             and stat_hour &lt;= #{hour}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t2
     </select>
     <select id="getServiceAmountTotal" resultType="com.alibaba.fastjson.JSONObject">
@@ -275,6 +302,13 @@
         <if test="end != null and end != ''">
             and stat_date &lt;= #{end}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
     </select>
     <select id="getAmountTotal" resultType="com.alibaba.fastjson.JSONObject">
         select
@@ -291,7 +325,13 @@
         <if test="end != null and end != ''">
             and stat_date &lt;= #{end}
         </if>
-
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
     </select>
     <select id="getAmountTotalRatio" resultType="java.lang.Double">
         select
@@ -305,6 +345,13 @@
         <if test="hour != null and hour != ''">
             and stat_hour &lt;= #{hour}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t1
         join (select sum(pay_amount) as 'payAmount'
         from jy_order_list
@@ -315,6 +362,13 @@
         <if test="hour != null and jhour != ''">
             and stat_hour &lt;= #{hour}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t2
     </select>
     <select id="getPromoterRankRatioList" resultType="com.alibaba.fastjson.JSONObject">
@@ -336,6 +390,13 @@
         <if test="hour != null and hour != ''">
             and stat_hour &lt;= #{hour}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         group by clip_user_id
         ) t1
         left join (select
@@ -349,6 +410,13 @@
         <if test="hour != null and hour != ''">
             and stat_hour &lt;= #{hour}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         group by clip_user_id
         ) t2 on t1.promoterId = t2.promoterId
         order by t1.orderNum desc
@@ -369,6 +437,13 @@
         <if test="end != null and end != ''">
             and stat_date &lt;= #{end}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         group by clip_user_id) t
         order by t.orderNum desc
     </select>
@@ -468,6 +543,13 @@
         <if test="end != null and end != ''">
             and stat_date &lt;= #{end}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t
         group by t.stat_date
         order by t.stat_date asc
@@ -487,6 +569,13 @@
         <if test="thisCycleEndTemp != null and thisCycleEndTemp != ''">
             and stat_date &lt;= #{thisCycleEndTemp}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t1
         join (
         select count(oid) as 'oid',
@@ -499,8 +588,23 @@
         <if test="lastCycleStartTemp != null and lastCycleStartTemp != ''">
             and stat_date &lt;= #{lastCycleEndTemp}
         </if>
+        <if test='promoterIds != null and promoterIds.size() > 0'>
+            AND clip_user_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t2
     </select>
+    <select id="getPromoterIdsByUserIds" resultType="java.lang.Long">
+        select promoter_id from jy_kuaishou_promoter where
+         1 = 1
+        and  user_id in
+        <foreach collection="userIds" item="userId" separator=","  open="(" close=")">
+            #{userId}
+        </foreach>
+    </select>
 
 
 </mapper>