|
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Repository;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Mapper
|
|
@Mapper
|
|
@Repository
|
|
@Repository
|
|
@@ -41,62 +42,24 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
|
|
"where b.house_id = #{houseId} and DATE_FORMAT(a.time_update,'%Y-%m-%d') = #{dateStr}")
|
|
"where b.house_id = #{houseId} and DATE_FORMAT(a.time_update,'%Y-%m-%d') = #{dateStr}")
|
|
List<MsSuspected> selectYcXq(@Param("houseId") Long houseId, @Param("dateStr") String dateStr);
|
|
List<MsSuspected> selectYcXq(@Param("houseId") Long houseId, @Param("dateStr") String dateStr);
|
|
|
|
|
|
- @Select("select * from " +
|
|
|
|
- "(" +
|
|
|
|
- "select count(*) as num,e.uptown_name as uptownName from sys_uptown_house a " +
|
|
|
|
- "inner join sys_uptown_unit b on b.unit_id = a.unit_id " +
|
|
|
|
- "inner join sys_uptown e on b.uptown_id = e.uptown_id " +
|
|
|
|
- "inner join sys_owner c on c.uptown_id = b.uptown_id " +
|
|
|
|
- "inner join sys_user_role d on d.property_id = c.owner_id and d.role_id = 2 " +
|
|
|
|
- "where d.user_id = #{userId} " +
|
|
|
|
- "GROUP BY e.uptown_name " +
|
|
|
|
- "union all " +
|
|
|
|
- "select DISTINCT count(*) as num,'' 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} " +
|
|
|
|
- "union all " +
|
|
|
|
- "select DISTINCT count(*) as num,'' 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} " +
|
|
|
|
- "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);
|
|
|
|
|
|
+ @Select(
|
|
|
|
+ "select count(a.report_id) as yichangCount\n" +
|
|
|
|
+ "from ms_report a \n" +
|
|
|
|
+ "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id\n" +
|
|
|
|
+ "INNER JOIN sys_uptown_unit c ON c.unit_id = b.unit_id and c.uptown_id = #{uptownId}\n" +
|
|
|
|
+ "where a.report_date = #{date} and a.ms_status = 2"
|
|
|
|
+ )
|
|
|
|
+ Map<String, Integer> selectyicahng(@Param("uptownId") Long uptownId, @Param("date") String date);
|
|
|
|
+
|
|
|
|
+ @Select(
|
|
|
|
+ "select sum(a.safety_num) AS safetyNum, sum(suspected_num) as suspectedNum\n" +
|
|
|
|
+ ", count(b.house_id) as houseCount, count(a.report_id) as reportCount\n" +
|
|
|
|
+ "from ms_report a \n" +
|
|
|
|
+ "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id\n" +
|
|
|
|
+ "INNER JOIN sys_uptown_unit c ON c.unit_id = b.unit_id and c.uptown_id = #{uptownId}\n" +
|
|
|
|
+ "where a.report_date = #{date}"
|
|
|
|
+ )
|
|
|
|
+ Map<String, Integer> selecthuiz(@Param("uptownId") Long uptownId, @Param("date") String date);
|
|
|
|
|
|
@Select(
|
|
@Select(
|
|
"select suu.ridgepole,suu.unit,suh.doorplate,suho.linkman,suho.phone,msr.safety_num as safetyNum," +
|
|
"select suu.ridgepole,suu.unit,suh.doorplate,suho.linkman,suho.phone,msr.safety_num as safetyNum," +
|