|
@@ -185,20 +185,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<select id="selectCompleteList" parameterType="com.ruoyi.powerdistribution.domain.vo.PdmLineComplete" resultType="com.ruoyi.powerdistribution.domain.vo.PdmLineComplete">
|
|
|
- select *,TIMESTAMPDIFF(DAY,poweroff_term_tm,NOW()) fault_free_duration from(
|
|
|
- SELECT
|
|
|
- t1.id, t1.rec_id, t1.line_nm, t1.line_run_no, t1.volt_lvl_cd, t1.volt_lvl_dsc,
|
|
|
- t1.subs_id, t1.subs_nm, t1.feeder_id, t1.feeder_nm, t1.op_maint_org_id, t1.op_maint_org_nm,
|
|
|
- t1.maint_team_id, t1.maint_team_nm, t1.org_no, t1.org_nm, t1.std_creator_no, t1.std_creator_nm,
|
|
|
- t1.std_updator_no, t1.std_updator_nm, t1.std_org_no, t1.std_org_nm, t1.std_city_org_no,
|
|
|
- t1.std_city_org_nm, t1.std_county_org_no, t1.std_county_org_nm, t1.data_dt, t1.etl_tm,
|
|
|
- (select max(poweroff_term_tm) poweroff_term_tm from pdm_stop_records where line_id = t1.rec_id ) poweroff_term_tm
|
|
|
+ SELECT
|
|
|
+ t1.id, t1.rec_id, t1.line_nm, t1.line_run_no, t1.volt_lvl_cd, t1.volt_lvl_dsc,
|
|
|
+ t1.subs_id, t1.subs_nm, t1.feeder_id, t1.feeder_nm, t1.op_maint_org_id, t1.op_maint_org_nm,
|
|
|
+ t1.maint_team_id, t1.maint_team_nm, t1.org_no, t1.org_nm, t1.std_creator_no, t1.std_creator_nm,
|
|
|
+ t1.std_updator_no, t1.std_updator_nm, t1.std_org_no, t1.std_org_nm, t1.std_city_org_no,
|
|
|
+ SUBSTRING_INDEX(t1.std_city_org_nm, '国网湖南省电力有限公司', -1)std_city_org_nm, t1.std_county_org_no, SUBSTRING_INDEX(t1.std_county_org_nm, '国网湖南省电力有限公司', -1) std_county_org_nm, t1.data_dt, t1.etl_tm,t1.bouns as reward_amount,t1.fault_free_duration,
|
|
|
+ (SELECT count(1) from pdm_stop_records where line_id=t1.rec_id)poweroff_num
|
|
|
from pdm_line t1
|
|
|
<where>
|
|
|
<if test="recId != null and recId != ''"> and t1.rec_id = #{recId}</if>
|
|
|
<if test="lineNm != null and lineNm != ''"> and t1.line_nm like concat('%', #{lineNm}, '%')</if>
|
|
|
+ <if test="isMaintOverdue!=null and 'true'.toString() == isMaintOverdue.toString()">
|
|
|
+ and (EXISTS(SELECT 1 from pdm_stop_records r where r.line_id=t1.rec_id and TIMESTAMPDIFF(YEAR,r.create_tm, SYSDATE())>3)
|
|
|
+ or (TIMESTAMPDIFF(YEAR,t1.ship_dt, SYSDATE())>3 and not EXISTS(SELECT 1 from pdm_stop_records r where r.line_id=t1.rec_id)))
|
|
|
+ </if>
|
|
|
+ <if test="isRepeatPoweroff!=null and 'true'.toString() == isRepeatPoweroff.toString()">
|
|
|
+ and EXISTS(SELECT 1 from pdm_stop_records r where r.line_id=t1.rec_id and TIMESTAMPDIFF(MONTH,r.create_tm, SYSDATE())=2)
|
|
|
+ and (SELECT count(1) from pdm_stop_records r where r.line_id=t1.rec_id )>=3
|
|
|
+ </if>
|
|
|
</where>
|
|
|
- ) a
|
|
|
+
|
|
|
</select>
|
|
|
<update id="calculateBounsProc" statementType="CALLABLE" parameterType="java.util.Map">
|
|
|
{call calculateBounsProc(#{calcuDate, mode=IN})}
|