lyhzzz 4 months ago
parent
commit
c547487cb7

+ 1 - 1
src/main/resources/mapper/agent/CameraDetailMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.fdkankan.agent.mapper.ICameraDetailMapper">
 
     <select id="getCountGroupByUserId" resultType="com.fdkankan.agent.response.GroupByCount">
-        SELECT user_id as id, count(id) as count FROM t_camera_detail  WHERE rec_status = 'A' and    user_id in
+        SELECT user_id as id, count(id) as count FROM t_camera_detail  WHERE rec_status = 'A'   and agent_id is not null and user_id in
         <foreach item="userId" collection="userIdList" open="(" separator="," close=")">
             #{userId}
         </foreach>

+ 2 - 2
src/main/resources/mapper/agent/ScenePlusMapper.xml

@@ -3,8 +3,8 @@
 <mapper namespace="com.fdkankan.agent.mapper.IScenePlusMapper">
 
     <select id="getCountGroupByUserId" resultType="com.fdkankan.agent.response.GroupByCount">
-        SELECT user_id as id, count(p.id) as count FROM t_scene_plus p
-        WHERE  p.rec_status = 'A' and  p.user_id in
+        SELECT p.user_id as id, count(p.id) as count FROM t_scene_plus p left join t_camera_deatil d on p.camera_id = d.camera_id
+        WHERE  p.rec_status = 'A' and agent_id is not null and  p.user_id in
         <foreach item="userId" collection="userIdList" open="(" separator="," close=")">
             #{userId}
         </foreach>

+ 4 - 3
src/main/resources/mapper/agent/SceneProMapper.xml

@@ -29,12 +29,13 @@
     </select>
 
     <select id="getCountGroupByUserId" resultType="com.fdkankan.agent.response.GroupByCount">
-        SELECT user_id as id, count(id) as count FROM t_scene_pro  WHERE  rec_status = 'A' and is_upgrade = 0
-        and  user_id in
+        SELECT p.user_id as id, count(p.id) as count FROM t_scene_pro p left join t_camera_deatil d on p.camera_id = d.camera_id
+                                                 WHERE  p.rec_status = 'A' and is_upgrade = 0 and agent_id is not null
+        and  p.user_id in
         <foreach item="userId" collection="userIdList" open="(" separator="," close=")">
             #{userId}
         </foreach>
-        GROUP BY user_id
+        GROUP BY p.user_id
     </select>
 
     <sql id="commonWhere">