|
@@ -64,6 +64,37 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
|
|
|
"inner join sys_owner d on d.uptown_id = c.uptown_id " +
|
|
|
"inner join sys_user_role e on e.property_id = d.owner_id and e.role_id = 2 " +
|
|
|
"where a.report_status = 1 and a.ms_status = 2 and a.report_date = #{reportDate} and e.user_id = #{userId} " +
|
|
|
+ "union all " +
|
|
|
+ "SELECT DISTINCT " +
|
|
|
+ "sum(a.safety_num) AS yc," +
|
|
|
+ "'' as uptownName " +
|
|
|
+ "FROM " +
|
|
|
+ "ms_report a " +
|
|
|
+ "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id " +
|
|
|
+ "INNER JOIN sys_uptown_unit c ON c.unit_id = b.unit_id " +
|
|
|
+ "INNER JOIN sys_owner d ON d.uptown_id = c.uptown_id " +
|
|
|
+ "INNER JOIN sys_user_role e ON e.property_id = d.owner_id " +
|
|
|
+ "AND e.role_id = 2 " +
|
|
|
+ "WHERE a.report_status = 1 " +
|
|
|
+ "AND a.report_date = #{reportDate} " +
|
|
|
+ "and e.user_id = #{userId} " +
|
|
|
+ "GROUP BY a.house_id " +
|
|
|
+ "union all " +
|
|
|
+ "SELECT DISTINCT " +
|
|
|
+ "sum(a.suspected_num+a.sure_num+a.single_num) AS ycnum," +
|
|
|
+ "'' as uptownName " +
|
|
|
+ "FROM " +
|
|
|
+ "ms_report a " +
|
|
|
+ "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id " +
|
|
|
+ "INNER JOIN sys_uptown_unit c ON c.unit_id = b.unit_id " +
|
|
|
+ "INNER JOIN sys_owner d ON d.uptown_id = c.uptown_id " +
|
|
|
+ "INNER JOIN sys_user_role e ON e.property_id = d.owner_id " +
|
|
|
+ "AND e.role_id = 2 " +
|
|
|
+ "WHERE a.report_status = 1 " +
|
|
|
+ "and a.ms_status = 2 " +
|
|
|
+ "AND a.report_date = #{reportDate} " +
|
|
|
+ "and e.user_id = #{userId} " +
|
|
|
+ "GROUP BY a.house_id" +
|
|
|
") tt ")
|
|
|
List<MsSuspected> selecthuiz(@Param("userId") Long userId,@Param("reportDate") String reportDate);
|
|
|
|