|
@@ -11,24 +11,51 @@
|
|
|
<sql id="maintenanceTodoQuerySql">
|
|
|
where
|
|
|
mp.mt_company_id = #{mtCompanyId}
|
|
|
+ and
|
|
|
+ mp.status <![CDATA[ != ]]> 1
|
|
|
</sql>
|
|
|
|
|
|
<!-- 急修记录查询条件sql -->
|
|
|
<sql id="emergencyTodoQuerySql">
|
|
|
where
|
|
|
er.mt_company_id = #{mtCompanyId}
|
|
|
+ and
|
|
|
+ er.status <![CDATA[ != ]]> 2
|
|
|
+ and
|
|
|
+ er.status <![CDATA[ != ]]> 3
|
|
|
+
|
|
|
</sql>
|
|
|
|
|
|
<!-- 大修记录查询条件sql -->
|
|
|
<sql id="capitalTodoQuerySql">
|
|
|
where
|
|
|
cr.mt_company_id = #{mtCompanyId}
|
|
|
+ and
|
|
|
+ cr.projectStatus <![CDATA[ != ]]> 4
|
|
|
</sql>
|
|
|
|
|
|
<!-- 年检记录查询条件sql -->
|
|
|
<sql id="annualInspectionTodoSql">
|
|
|
where
|
|
|
ai.mt_company_id = #{mtCompanyId}
|
|
|
+ and
|
|
|
+ ai.status = 1
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 区域项目查询 -->
|
|
|
+ <sql id="regionProjectSql">
|
|
|
+ <if test="clerkId != null || regionChargeId != null">
|
|
|
+ and p.region_id in (
|
|
|
+ select id from region r
|
|
|
+ where true
|
|
|
+ <if test="clerkId != null">
|
|
|
+ and r.cleck find_in_set(#{clerkId}, r.clerk)
|
|
|
+ </if>
|
|
|
+ <if test="regionChargeId != null">
|
|
|
+ and r.user_id = #{regionChargeId}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</sql>
|
|
|
|
|
|
|
|
@@ -50,11 +77,21 @@
|
|
|
lift l
|
|
|
on
|
|
|
mp.lift_id = l.id
|
|
|
+ left join
|
|
|
+ project_lift_relevance plr
|
|
|
+ on
|
|
|
+ l.id = plr.lift_id
|
|
|
+ left join
|
|
|
+ project p
|
|
|
+ on
|
|
|
+ plr.project_id = p.id
|
|
|
left join
|
|
|
user_info ui
|
|
|
on
|
|
|
mp.worker_id = ui.user_id
|
|
|
<include refid="maintenanceTodoQuerySql"/>
|
|
|
+ <include refid="regionProjectSql"/>
|
|
|
+ order by plan_date
|
|
|
<include refid="pageQuerySql"/>
|
|
|
</select>
|
|
|
|
|
@@ -89,6 +126,8 @@
|
|
|
on
|
|
|
er.worker_id = ui.user_id
|
|
|
<include refid="emergencyTodoQuerySql"/>
|
|
|
+ <include refid="regionProjectSql"/>
|
|
|
+ order by er.assign_time
|
|
|
<include refid="pageQuerySql"/>
|
|
|
</select>
|
|
|
|
|
@@ -97,15 +136,17 @@
|
|
|
parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.TodoRequest"
|
|
|
resultType="cn.com.ty.lift.system.homepage.dao.dto.response.CapitalRepairResponse">
|
|
|
select
|
|
|
- cr.id as capitalRepairId,
|
|
|
- cr.project_name as projectName,
|
|
|
- cr.project_address as projectAddress,
|
|
|
- cr.start_date as startDate,
|
|
|
- cr.end_date as endDate,
|
|
|
- cr.push_flag as pushFlag
|
|
|
+ p.id as capitalRepairId,
|
|
|
+ p.project_name as projectName,
|
|
|
+ p.project_address as projectAddress,
|
|
|
+ p.start_date as startDate,
|
|
|
+ p.end_date as endDate,
|
|
|
+ p.push_flag as pushFlag
|
|
|
from
|
|
|
- capital_repair cr
|
|
|
+ capital_repair p
|
|
|
<include refid="capitalTodoQuerySql"/>
|
|
|
+ <include refid="regionProjectSql"/>
|
|
|
+ order by p.create_date
|
|
|
<include refid="pageQuerySql"/>
|
|
|
</select>
|
|
|
|
|
@@ -142,6 +183,7 @@
|
|
|
on
|
|
|
ui.user_id = plr.worker_id
|
|
|
<include refid="annualInspectionTodoSql"/>
|
|
|
+ <include refid="regionProjectSql"/>
|
|
|
<include refid="pageQuerySql"/>
|
|
|
</select>
|
|
|
|
|
@@ -199,7 +241,16 @@
|
|
|
count(1)
|
|
|
from
|
|
|
emergency_repair er
|
|
|
+ left join
|
|
|
+ lift l
|
|
|
+ on
|
|
|
+ er.lift_id = l.id
|
|
|
+ left join
|
|
|
+ project p
|
|
|
+ on
|
|
|
+ er.project_id = p.id
|
|
|
<include refid="emergencyTodoQuerySql"/>
|
|
|
+ <include refid="regionProjectSql"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 获取维保待办条数 -->
|
|
@@ -210,7 +261,20 @@
|
|
|
count(1)
|
|
|
from
|
|
|
maintenance_plan mp
|
|
|
+ left join
|
|
|
+ lift l
|
|
|
+ on
|
|
|
+ mp.lift_id = l.id
|
|
|
+ left join
|
|
|
+ project_lift_relevance plr
|
|
|
+ on
|
|
|
+ l.id = plr.lift_id
|
|
|
+ left join
|
|
|
+ project p
|
|
|
+ on
|
|
|
+ plr.project_id = p.id
|
|
|
<include refid="maintenanceTodoQuerySql"/>
|
|
|
+ <include refid="regionProjectSql"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 获取大修待办条数 -->
|
|
@@ -222,6 +286,7 @@
|
|
|
from
|
|
|
capital_repair cr
|
|
|
<include refid="capitalTodoQuerySql"/>
|
|
|
+ <include refid="regionProjectSql"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 获取年检待办条数 -->
|
|
@@ -232,7 +297,20 @@
|
|
|
count(1)
|
|
|
from
|
|
|
annual_inspection ai
|
|
|
+ left join
|
|
|
+ lift l
|
|
|
+ on
|
|
|
+ ai.lift_id = l.id
|
|
|
+ left join
|
|
|
+ project_lift_relevance plr
|
|
|
+ on
|
|
|
+ plr.lift_id = l.id
|
|
|
+ left join
|
|
|
+ project p
|
|
|
+ on
|
|
|
+ plr.project_id = p.id
|
|
|
<include refid="annualInspectionTodoSql"/>
|
|
|
+ <include refid="regionProjectSql"/>
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|