|
@@ -148,28 +148,48 @@
|
|
JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
|
|
JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
|
|
JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
|
|
JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
|
|
JOIN scene_natural d ON d.natural_name = c.scene_name AND d.is_deleted = '0'
|
|
JOIN scene_natural d ON d.natural_name = c.scene_name AND d.is_deleted = '0'
|
|
- WHERE a.user_id = #{userId}
|
|
|
|
|
|
+ <where> d.share='2'
|
|
|
|
+ <if test="userId != null and userId!=''">
|
|
|
|
+ and a.user_id = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ UNION ALL SELECT COUNT(*) AS num from scene_natural where is_deleted = '0' and share='1'
|
|
UNION ALL
|
|
UNION ALL
|
|
SELECT COUNT(DISTINCT c.scene_name) AS num
|
|
SELECT COUNT(DISTINCT c.scene_name) AS num
|
|
FROM system_user_scene a
|
|
FROM system_user_scene a
|
|
JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
|
|
JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
|
|
JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
|
|
JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
|
|
JOIN scene_accident d ON d.scene_name = c.scene_name AND d.is_deleted = '0'
|
|
JOIN scene_accident d ON d.scene_name = c.scene_name AND d.is_deleted = '0'
|
|
- WHERE a.user_id = #{userId}
|
|
|
|
|
|
+ <where> d.share='2'
|
|
|
|
+ <if test="userId != null and userId!=''">
|
|
|
|
+ and a.user_id = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ UNION ALL SELECT COUNT(*) AS num from scene_accident where is_deleted = '0' and share='1'
|
|
UNION ALL
|
|
UNION ALL
|
|
SELECT COUNT(DISTINCT c.scene_name) AS num
|
|
SELECT COUNT(DISTINCT c.scene_name) AS num
|
|
FROM system_user_scene a
|
|
FROM system_user_scene a
|
|
JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
|
|
JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
|
|
JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
|
|
JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
|
|
JOIN scene_standards_regulations d ON d.scene_name = c.scene_name AND d.is_deleted = '0'
|
|
JOIN scene_standards_regulations d ON d.scene_name = c.scene_name AND d.is_deleted = '0'
|
|
- WHERE a.user_id = #{userId}
|
|
|
|
|
|
+ <where> d.share='2'
|
|
|
|
+ <if test="userId != null and userId!=''">
|
|
|
|
+ and a.user_id = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ UNION ALL SELECT COUNT(*) AS num from scene_standards_regulations where is_deleted = '0' and share='1'
|
|
UNION ALL
|
|
UNION ALL
|
|
SELECT COUNT(DISTINCT c.scene_name) AS num
|
|
SELECT COUNT(DISTINCT c.scene_name) AS num
|
|
FROM system_user_scene a
|
|
FROM system_user_scene a
|
|
JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
|
|
JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
|
|
JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
|
|
JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
|
|
JOIN scene_general_template d ON d.scene_id = c.scene_name AND d.is_deleted = '0'
|
|
JOIN scene_general_template d ON d.scene_id = c.scene_name AND d.is_deleted = '0'
|
|
- WHERE a.user_id = #{userId}) AS t
|
|
|
|
|
|
+ <where> d.share='2'
|
|
|
|
+ <if test="userId != null and userId!=''">
|
|
|
|
+ and a.user_id = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ UNION ALL SELECT COUNT(*) AS num from scene_general_template where is_deleted = '0' and share='1') AS t
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|