|
@@ -93,15 +93,15 @@
|
|
|
parameterType="cn.com.ty.lift.system.settings.dao.entity.model.MaintenanceCompanyRequest"
|
|
|
resultType="cn.com.ty.lift.system.homepage.dao.model.CountDataModel">
|
|
|
select
|
|
|
- <include refid="companyIdToCountSql"/>
|
|
|
+ <include refid="companyIdToCountSql"/>
|
|
|
from
|
|
|
- project
|
|
|
+ project
|
|
|
group by
|
|
|
- mt_company_id
|
|
|
+ mt_company_id
|
|
|
having
|
|
|
- 1=1
|
|
|
- <!-- 判断公司id是否在集合中 -->
|
|
|
- <include refid="setCompanyId"/>
|
|
|
+ 1=1
|
|
|
+ <!-- 判断公司id是否在集合中 -->
|
|
|
+ <include refid="setCompanyId"/>
|
|
|
|
|
|
</select>
|
|
|
|
|
@@ -110,15 +110,15 @@
|
|
|
parameterType="cn.com.ty.lift.system.settings.dao.entity.model.MaintenanceCompanyRequest"
|
|
|
resultType="cn.com.ty.lift.system.homepage.dao.model.CountDataModel">
|
|
|
select
|
|
|
- <include refid="companyIdToCountSql"/>
|
|
|
+ <include refid="companyIdToCountSql"/>
|
|
|
from
|
|
|
- maintenance_record
|
|
|
+ maintenance_record
|
|
|
group by
|
|
|
- mt_company_id
|
|
|
+ mt_company_id
|
|
|
having
|
|
|
- 1=1
|
|
|
- <!-- 判断公司id是否在集合中 -->
|
|
|
- <include refid="setCompanyId"/>
|
|
|
+ 1=1
|
|
|
+ <!-- 判断公司id是否在集合中 -->
|
|
|
+ <include refid="setCompanyId"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 获取公司急修记录 -->
|
|
@@ -126,15 +126,15 @@
|
|
|
parameterType="cn.com.ty.lift.system.settings.dao.entity.model.MaintenanceCompanyRequest"
|
|
|
resultType="cn.com.ty.lift.system.homepage.dao.model.CountDataModel">
|
|
|
select
|
|
|
- <include refid="companyIdToCountSql"/>
|
|
|
+ <include refid="companyIdToCountSql"/>
|
|
|
from
|
|
|
- emergency_repair
|
|
|
+ emergency_repair
|
|
|
group by
|
|
|
- mt_company_id
|
|
|
+ mt_company_id
|
|
|
having
|
|
|
- 1=1
|
|
|
- <!-- 判断公司id是否在集合中 -->
|
|
|
- <include refid="setCompanyId"/>
|
|
|
+ 1=1
|
|
|
+ <!-- 判断公司id是否在集合中 -->
|
|
|
+ <include refid="setCompanyId"/>
|
|
|
</select>
|
|
|
|
|
|
<!--################################################################################-->
|
|
@@ -146,22 +146,22 @@
|
|
|
parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.PlatformCalendarRequest"
|
|
|
resultType="cn.com.ty.lift.system.homepage.dao.model.MtPlanDataModel">
|
|
|
select
|
|
|
- <include refid="liftInfoSql"/>
|
|
|
- mp.plan_date as planDate,
|
|
|
- mp.status as status
|
|
|
+ <include refid="liftInfoSql"/>
|
|
|
+ mp.plan_date as planDate,
|
|
|
+ mp.status as status
|
|
|
from
|
|
|
- maintenance_plan mp
|
|
|
+ maintenance_plan mp
|
|
|
left join
|
|
|
- lift l
|
|
|
+ lift l
|
|
|
on
|
|
|
- mp.lift_id = l.id
|
|
|
- <include refid="liftInfoJoinSql"/>
|
|
|
+ mp.lift_id = l.id
|
|
|
+ <include refid="liftInfoJoinSql"/>
|
|
|
where
|
|
|
- mp.mt_company_id = #{mtCompanyId}
|
|
|
+ mp.mt_company_id = #{mtCompanyId}
|
|
|
and
|
|
|
- mp.plan_date <![CDATA[ >= ]]> #{monthEndStr}
|
|
|
+ mp.plan_date <![CDATA[ >= ]]> #{monthEndStr}
|
|
|
and
|
|
|
- mp.plan_date <![CDATA[ <= ]]> #{monthEndStr}
|
|
|
+ mp.plan_date <![CDATA[ <= ]]> #{monthEndStr}
|
|
|
|
|
|
</select>
|
|
|
|
|
@@ -170,22 +170,22 @@
|
|
|
parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.PlatformCalendarRequest"
|
|
|
resultType="cn.com.ty.lift.system.homepage.dao.model.MtRecordDataModel">
|
|
|
select
|
|
|
- <include refid="liftInfoSql"/>
|
|
|
- mr.work_date as workDate,
|
|
|
- mr.status as status
|
|
|
+ <include refid="liftInfoSql"/>
|
|
|
+ mr.work_date as workDate,
|
|
|
+ mr.status as status
|
|
|
from
|
|
|
- maintenance_record mr
|
|
|
+ maintenance_record mr
|
|
|
left join
|
|
|
- lift l
|
|
|
+ lift l
|
|
|
on
|
|
|
- mr.lift_id = l.id
|
|
|
- <include refid="liftInfoJoinSql"/>
|
|
|
+ mr.lift_id = l.id
|
|
|
+ <include refid="liftInfoJoinSql"/>
|
|
|
where
|
|
|
- mr.mt_company_id = #{mtCompanyId}
|
|
|
+ mr.mt_company_id = #{mtCompanyId}
|
|
|
and
|
|
|
- mr.work_date <![CDATA[ >= ]]> #{monthBeginStr}
|
|
|
+ mr.work_date <![CDATA[ >= ]]> #{monthBeginStr}
|
|
|
and
|
|
|
- mr.work_date <![CDATA[ <= ]]> #{monthEndStr}
|
|
|
+ mr.work_date <![CDATA[ <= ]]> #{monthEndStr}
|
|
|
|
|
|
</select>
|
|
|
|
|
@@ -194,23 +194,23 @@
|
|
|
parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.PlatformCalendarRequest"
|
|
|
resultType="cn.com.ty.lift.system.homepage.dao.model.EmergencyRecordDataModel">
|
|
|
select
|
|
|
- <include refid="liftInfoSql"/>
|
|
|
- er.caller_date as callerDate,
|
|
|
- er.recovery_date as recoveryDate,
|
|
|
- er.status as status
|
|
|
+ <include refid="liftInfoSql"/>
|
|
|
+ er.caller_date as callerDate,
|
|
|
+ er.recovery_date as recoveryDate,
|
|
|
+ er.status as status
|
|
|
from
|
|
|
- emergency_repair er
|
|
|
+ emergency_repair er
|
|
|
left join
|
|
|
- lift l
|
|
|
+ lift l
|
|
|
on
|
|
|
- er.lift_id = l.id
|
|
|
- <include refid="liftInfoJoinSql"/>
|
|
|
+ er.lift_id = l.id
|
|
|
+ <include refid="liftInfoJoinSql"/>
|
|
|
where
|
|
|
- er.mt_company_id = #{mtCompanyId}
|
|
|
+ er.mt_company_id = #{mtCompanyId}
|
|
|
and
|
|
|
- er.caller_date <![CDATA[ >= ]]> #{monthBeginStr}
|
|
|
+ er.caller_date <![CDATA[ >= ]]> #{monthBeginStr}
|
|
|
and
|
|
|
- er.caller_date <![CDATA[ <= ]]> #{monthEndStr}
|
|
|
+ er.caller_date <![CDATA[ <= ]]> #{monthEndStr}
|
|
|
|
|
|
</select>
|
|
|
|
|
@@ -219,22 +219,109 @@
|
|
|
parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.PlatformCalendarRequest"
|
|
|
resultType="cn.com.ty.lift.system.homepage.dao.model.AnnualInspectionDataModel">
|
|
|
select
|
|
|
- <include refid="liftInfoSql"/>
|
|
|
- ai.finish_time as finishTime,
|
|
|
- ai.status as status
|
|
|
+ <include refid="liftInfoSql"/>
|
|
|
+ ai.finish_time as finishTime,
|
|
|
+ ai.status as status
|
|
|
from
|
|
|
- annual_inspection ai
|
|
|
+ annual_inspection ai
|
|
|
left join
|
|
|
- lift l
|
|
|
+ lift l
|
|
|
on
|
|
|
- ai.lift_id = l.id
|
|
|
- <include refid="liftInfoJoinSql"/>
|
|
|
+ ai.lift_id = l.id
|
|
|
+ <include refid="liftInfoJoinSql"/>
|
|
|
+ where
|
|
|
+ ai.mt_company_id = #{mtCompanyId}
|
|
|
+ and
|
|
|
+ ai.finish_time <![CDATA[ >= ]]> #{monthBeginStr}
|
|
|
+ and
|
|
|
+ ai.finish_time <![CDATA[ <= ]]> #{monthEndStr}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 获取 年份-项目总数 -->
|
|
|
+ <select id="getEveryYearProjectCount"
|
|
|
+ parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.DataStatisticsRequest"
|
|
|
+ resultType="cn.com.ty.lift.system.homepage.dao.model.CountDataModel">
|
|
|
+ select
|
|
|
+ SUBSTR(create_date, 1, 4) as year,
|
|
|
+ count(create_date) as dataCount
|
|
|
+ from project
|
|
|
+ group by
|
|
|
+ SUBSTR(create_date, 1, 4)
|
|
|
+ where
|
|
|
+ mt_company_id = #{companyId}
|
|
|
+ and
|
|
|
+ create_date <![CDATA[ >= ]]> #{beforeDateStr}
|
|
|
+ and
|
|
|
+ create_date <![CDATA[ <= ]]> #{nowDateStr}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--获取 年份-维保次数 -->
|
|
|
+ <select id="getEveryYearMaintenanceCount"
|
|
|
+ parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.DataStatisticsRequest"
|
|
|
+ resultType="cn.com.ty.lift.system.homepage.dao.model.CountDataModel">
|
|
|
+ select
|
|
|
+ SUBSTR(create_date, 1, 4) as year,
|
|
|
+ count(create_date) as dataCount
|
|
|
+ from maintenance_record
|
|
|
+ group by
|
|
|
+ SUBSTR(create_date, 1, 4)
|
|
|
+ where
|
|
|
+ mt_company_id = #{companyId}
|
|
|
+ and
|
|
|
+ create_date <![CDATA[ >= ]]> #{beforeDateStr}
|
|
|
+ and
|
|
|
+ create_date <![CDATA[ <= ]]> #{nowDateStr}
|
|
|
+ </select>
|
|
|
+ <!--获取 年份-急修次数 -->
|
|
|
+ <select id="getEveryYearEmergencyCount"
|
|
|
+ parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.DataStatisticsRequest"
|
|
|
+ resultType="cn.com.ty.lift.system.homepage.dao.model.CountDataModel">
|
|
|
+ select
|
|
|
+ SUBSTR(create_date, 1, 4) as year,
|
|
|
+ count(create_date) as dataCount
|
|
|
+ from emergency_repair
|
|
|
+ group by
|
|
|
+ SUBSTR(create_date, 1, 4)
|
|
|
+ where
|
|
|
+ mt_company_id = #{companyId}
|
|
|
+ and
|
|
|
+ create_date <![CDATA[ >= ]]> #{beforeDateStr}
|
|
|
+ and
|
|
|
+ create_date <![CDATA[ <= ]]> #{nowDateStr}
|
|
|
+ </select>
|
|
|
+ <!--获取 年份-年检次数 -->
|
|
|
+ <select id="getEveryYearAnnualCount"
|
|
|
+ parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.DataStatisticsRequest"
|
|
|
+ resultType="cn.com.ty.lift.system.homepage.dao.model.CountDataModel">
|
|
|
+ select
|
|
|
+ SUBSTR(create_date, 1, 4) as year,
|
|
|
+ count(create_date) as dataCount
|
|
|
+ from annual_inspection
|
|
|
+ group by
|
|
|
+ SUBSTR(create_date, 1, 4)
|
|
|
+ where
|
|
|
+ mt_company_id = #{companyId}
|
|
|
+ and
|
|
|
+ create_date <![CDATA[ >= ]]> #{beforeDateStr}
|
|
|
+ and
|
|
|
+ create_date <![CDATA[ <= ]]> #{nowDateStr}
|
|
|
+ </select>
|
|
|
+ <!--获取 年份-大修次数 -->
|
|
|
+ <select id="getEveryYearCapitalCount"
|
|
|
+ parameterType="cn.com.ty.lift.system.homepage.dao.dto.request.DataStatisticsRequest"
|
|
|
+ resultType="cn.com.ty.lift.system.homepage.dao.model.CountDataModel">
|
|
|
+ select
|
|
|
+ SUBSTR(create_date, 1, 4) as year,
|
|
|
+ count(create_date) as dataCount
|
|
|
+ from capital_repair
|
|
|
+ group by
|
|
|
+ SUBSTR(create_date, 1, 4)
|
|
|
where
|
|
|
- ai.mt_company_id = #{mtCompanyId}
|
|
|
+ mt_company_id = #{companyId}
|
|
|
and
|
|
|
- ai.finish_time <![CDATA[ >= ]]> #{monthBeginStr}
|
|
|
+ create_date <![CDATA[ >= ]]> #{beforeDateStr}
|
|
|
and
|
|
|
- ai.finish_time <![CDATA[ <= ]]> #{monthEndStr}
|
|
|
+ create_date <![CDATA[ <= ]]> #{nowDateStr}
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|