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}
         SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as dataKey , count(1) as dataCount  FROM ${tb}
         WHERE tb_status = 0
         WHERE tb_status = 0
         <if test="roomIds != null roomIds.size >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>
         <if test="startTime != null and startTime !='' and endTime != null and endTime !=''">
         <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}
             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 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}
         SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as dataKey , count(DISTINCT user_id) as dataCount  FROM ${tb}
         WHERE tb_status = 0
         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>
         <if test="startTime != null and startTime !='' and endTime != null and endTime !=''">
         <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}
             and  DATE_FORMAT(create_time,'%Y-%m-%d')  &gt;= #{startTime}   and  DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{endTime}