|
@@ -75,7 +75,7 @@ public interface SqlConstants {
|
|
|
" where mr.lift_id = #{liftId}" +
|
|
|
" order by mr.work_date desc";
|
|
|
|
|
|
- //物管,根据用户id和月份,查询那一月每天的(待保养/保养中/已完成/计划超期)的数量
|
|
|
+ //物管。根据用户id和月份,查询那一月每天的(待保养/保养中/已完成/计划超期)的数量
|
|
|
String QUERY_MAINTENANCE_PLAN_MONTH_TASK_NUM =
|
|
|
"select DATE_FORMAT(plan_date, '%d') day, status status, count(status) count" +
|
|
|
" from maintenance_plan" +
|
|
@@ -83,7 +83,7 @@ public interface SqlConstants {
|
|
|
" and DATE_FORMAT(plan_date, '%Y-%m') = #{yearMonth}" +
|
|
|
" group by plan_date, status";
|
|
|
|
|
|
- //动态消息,当日急修完成是否已经评价列表
|
|
|
+ //物管。动态消息,当日急修完成是否已经评价列表
|
|
|
String QUERY_EMERGENCY_REPAIR_DYNAMIC_MESSAGE =
|
|
|
"select er.id id,l.device_position devicePosition, has_evaluate hasEvaluate" +
|
|
|
" from emergency_repair er" +
|
|
@@ -91,7 +91,7 @@ public interface SqlConstants {
|
|
|
" where DATE_FORMAT(er.recovery_date, '%Y%m%d') = DATE_FORMAT(CURDATE(), '%Y%m%d')" +
|
|
|
" and project_id in (select project_id from project_user where user_id = #{userId})";
|
|
|
|
|
|
- //动态消息,当日维保完成是否已经评价列表
|
|
|
+ //物管。动态消息,当日维保完成是否已经评价列表
|
|
|
String QUERY_MAINTENANCE_SUCCESS_DYNAMIC_MESSAGE =
|
|
|
"select mr.id id,l.device_position devicePosition, has_evaluate hasEvaluate" +
|
|
|
" from maintenance_record mr" +
|
|
@@ -99,13 +99,13 @@ public interface SqlConstants {
|
|
|
" where DATE_FORMAT(mr.recovery_date, '%Y%m%d') = DATE_FORMAT(CURDATE(), '%Y%m%d')" +
|
|
|
" and project_id in (select project_id from project_user where user_id = #{userId})";
|
|
|
|
|
|
- //根据用户Id查询加入的项目列表
|
|
|
+ //物管。根据用户Id查询加入的项目列表
|
|
|
String QUERY_JOIN_PROJECT_LIST =
|
|
|
"select id projectId, project_name projectName, mt_company_id mtCompanyId" +
|
|
|
" from project" +
|
|
|
" where id in (select project_id from project_user where user_id = #{userId})";
|
|
|
|
|
|
- //查询急修/维保id是否有评价权限
|
|
|
+ //物管。查询急修/维保id是否有评价权限
|
|
|
String QUERY_EVALUATE_AUTH =
|
|
|
"select temp.id id, pu.user_role userRole" +
|
|
|
" from ${table} temp" +
|
|
@@ -113,24 +113,46 @@ public interface SqlConstants {
|
|
|
" where user_role in (21, 22)" +
|
|
|
" and user_id =#{userId}";
|
|
|
|
|
|
- //查询用户加入的项目的急修列表
|
|
|
+ //物管。查询用户加入的项目的急修列表
|
|
|
String QUERY_REPAIR_LIST =
|
|
|
- "select er.id repairId," +
|
|
|
- " p.project_name projectName," +
|
|
|
- " er.is_critical isCritical," +
|
|
|
- " er.repair_reason repairReason," +
|
|
|
- " er.source source," +
|
|
|
- " er.caller_date callerDate," +
|
|
|
- " l.registration_code registrationCode," +
|
|
|
- " l.lift_type liftType," +
|
|
|
- " l.category category," +
|
|
|
- " l.device_position devicePosition," +
|
|
|
- " ui.name workerName" +
|
|
|
- " from emergency_repair er" +
|
|
|
- " left join project_user pu on er.project_id = pu.project_id" +
|
|
|
+ "select distinct er.id repairId," +
|
|
|
+ " p.project_name projectName," +
|
|
|
+ " er.is_critical isCritical," +
|
|
|
+ " er.repair_reason repairReason," +
|
|
|
+ " er.source source," +
|
|
|
+ " er.caller_date callerDate," +
|
|
|
+ " l.registration_code registrationCode," +
|
|
|
+ " l.lift_type liftType," +
|
|
|
+ " l.category category," +
|
|
|
+ " l.device_position devicePosition," +
|
|
|
+ " ui.name workerName," +
|
|
|
+ " TimeStampDiff(SECOND ,er.assign_time,ifnull(er.taking_time, now())) * 1000 AS waitDiff," +
|
|
|
+ " er.create_date" +
|
|
|
+ " from emergency_repair er" +
|
|
|
+ " left join project_user pu on pu.project_id = er.project_id" +
|
|
|
" left join project p on er.project_id = p.id" +
|
|
|
" left join lift l on er.lift_id = l.id" +
|
|
|
" left join project_lift_relevance plr on er.lift_id = plr.lift_id" +
|
|
|
- " left join user_info ui on plr.worker_id = ui.user_id" +
|
|
|
- " where pu.user_id = #{userId}";
|
|
|
+ " left join user_info ui on er.worker_id = ui.user_id" +
|
|
|
+ " where er.status = #{status}" +
|
|
|
+ " and er.project_id in (select er.project_id" +
|
|
|
+ " from project_user pu" +
|
|
|
+ " where pu.user_id = #{userId}) order by er.create_date desc";
|
|
|
+
|
|
|
+ //查询区域列表
|
|
|
+ String QUERY_REGIONS =
|
|
|
+ "select r.area_name areaName" +
|
|
|
+ " , r.area_code areaCode" +
|
|
|
+ " , r.city_code cityCode" +
|
|
|
+ " , r.remark remark" +
|
|
|
+ " , r.province_code provinceCode" +
|
|
|
+ " , r.clerk clerk" +
|
|
|
+ " , r.mt_company_id mtCompanyId" +
|
|
|
+ " , ui.name name" +
|
|
|
+ " , r.id id" +
|
|
|
+ " from region r" +
|
|
|
+ " left join user_info ui on r.user_id = ui.user_id" +
|
|
|
+ " where mt_company_id = #{mtCompanyId}" +
|
|
|
+ " and (r.area_name like '%${name}%' or ui.name like '%${name}%')" +
|
|
|
+ " order by create_time desc";
|
|
|
}
|