lyhzzz 2 年 前
コミット
e0f67bb837
1 ファイル変更9 行追加3 行削除
  1. 9 3
      src/main/resources/mapper/tk/RoomVisitLogMapper.xml

+ 9 - 3
src/main/resources/mapper/tk/RoomVisitLogMapper.xml

@@ -14,7 +14,10 @@
         SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as dataKey , count(1) as dataCount  FROM ${tb}
         WHERE tb_status = 0
         <if test="roomIds != null roomIds.size >0">
-           and  room_id =#{roomId}
+            and  room_id in
+            <foreach item="roomId" collection="roomIds" open="(" separator="," close=")">
+                #{roomId}
+            </foreach>
         </if>
         <if test="startTime != null and startTime !='' and endTime != null and endTime !=''">
             and  DATE_FORMAT(create_time,'%Y-%m-%d')  &gt;= #{startTime}   and  DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{endTime}
@@ -26,8 +29,11 @@
     <select id="getByDGroupRoomId" resultType="com.fdkankan.tk.response.DataCount">
         SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as dataKey , count(DISTINCT user_id) as dataCount  FROM ${tb}
         WHERE tb_status = 0
-        <if test="roomId != null and roomId !=''">
-            and  room_id =#{roomId}
+        <if test="roomIds != null roomIds.size >0">
+            and  room_id in
+            <foreach item="roomId" collection="roomIds" open="(" separator="," close=")">
+                #{roomId}
+            </foreach>
         </if>
         <if test="startTime != null and startTime !='' and endTime != null and endTime !=''">
             and  DATE_FORMAT(create_time,'%Y-%m-%d')  &gt;= #{startTime}   and  DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{endTime}