123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.powerdistribution.mapper.PdmMaintenanceProcessMapper">
- <resultMap type="PdmMaintenanceProcess" id="PdmMaintenanceProcessResult">
- <result property="id" column="id" />
- <result property="planCode" column="plan_code" />
- <result property="planCodeW" column="plan_code_w" />
- <result property="powerOutageDevices" column="power_outage_devices" />
- <result property="perHourHouseholdsM" column="per_hour_households_m" />
- <result property="perHourHouseholdsW" column="per_hour_households_w" />
- <result property="city" column="city" />
- <result property="county" column="county" />
- <result property="station" column="station" />
- <result property="lineCode" column="line_code" />
- <result property="lineName" column="line_name" />
- <result property="perHourHouseholdsArtif" column="per_hour_households_artif" />
- <result property="declarAgency" column="declar_agency" />
- <result property="isMaintenance" column="is_maintenance" />
- <result property="isApprove" column="is_approve" />
- <result property="maintenanceFilePath" column="maintenance_file_path" />
- <result property="approveFilePath" column="approve_file_path" />
- <result property="maintenanceFileName" column="maintenance_file_name" />
- <result property="approveFileName" column="approve_file_name" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="hourNum" column="hour_num" />
- <result property="examiAmount" column="exami_Amount" typeHandler="com.ruoyi.common.handler.ListTypeHandler" javaType="java.util.List" />
- <!--result property="manageAssistantAmt" column="manage_assistant_amt" />
- <result property="deptDirectorAmt" column="dept_director_amt" />
- <result property="deptDirectorAssistantAmt" column="dept_director_assistant_amt" />
- <result property="deptManageAmt" column="dept_manage_amt" />
- <result property="principAmt" column="princip_amt" />
- <result property="workPrincipAmt" column="work_princip_amt" />
- <result property="ownerAmt" column="owner_amt" /-->
- </resultMap>
- <sql id="selectPdmMaintenanceProcessVo">
- select id, plan_code,plan_code_w, power_outage_devices, per_hour_households_m, per_hour_households_w, SUBSTRING_INDEX(city, '国网湖南省电力有限公司', -1)city, SUBSTRING_INDEX(SUBSTRING_INDEX(county, '国网湖南省电力有限公司', -1),'国网衡阳供电公司',-1)county, SUBSTRING_INDEX(station, '国网湖南省电力有限公司', -1)station, line_code, line_name, per_hour_households_artif,SUBSTRING_INDEX(declar_agency, '国网衡阳供电公司', -1) declar_agency, is_maintenance, is_approve, maintenance_file_path,maintenance_file_name, approve_file_path,approve_file_name, create_by, create_time, update_by, update_time,std_org_no,week_start_dt,week_end_dt from pdm_maintenance_process
- </sql>
- <select id="selectPdmMaintenanceProcessList" parameterType="PdmMaintenanceProcess" resultMap="PdmMaintenanceProcessResult">
- select a.*,getExamiAmountFun((select ROUND(sum(hour_num)) from pdm_stop_records where std_org_no=a.std_org_no
- and poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241')
- and DATE_FORMAT(poweroff_start_tm, '%Y-%m-%d') >= a.week_start_dt
- and DATE_FORMAT(poweroff_term_tm, '%Y-%m-%d') <= a.week_end_dt),per_hour_households_w) exami_Amount from ( <include refid="selectPdmMaintenanceProcessVo"/>
- <where>
- <if test="planCode != null and planCode != ''"> and plan_code like concat('%', #{planCode}, '%')</if>
- <if test="planCodeW != null and planCodeW != ''"> and plan_code_w like concat('%', #{planCodeW}, '%')</if>
- <if test="powerOutageDevices != null "> and power_outage_devices = #{powerOutageDevices}</if>
- <if test="perHourHouseholdsM != null "> and per_hour_households_m = #{perHourHouseholdsM}</if>
- <if test="perHourHouseholdsW != null "> and per_hour_households_w = #{perHourHouseholdsW}</if>
- <if test="city != null and city != ''"> and city = #{city}</if>
- <if test="county != null and county != ''"> and county like concat('%', #{county}, '%')</if>
- <if test="station != null and station != ''"> and station like concat('%', #{station}, '%')</if>
- <if test="lineCode != null and lineCode != ''"> and line_code = #{lineCode}</if>
- <if test="lineName != null and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if>
- <if test="perHourHouseholdsArtif != null "> and per_hour_households_artif = #{perHourHouseholdsArtif}</if>
- <if test="declarAgency != null and declarAgency != ''"> and declar_agency = #{declarAgency}</if>
- <if test="isMaintenance != null and isMaintenance != ''"> and is_maintenance = #{isMaintenance}</if>
- <if test="isApprove != null and isApprove != ''"> and is_approve = #{isApprove}</if>
- <if test="maintenanceFilePath != null and maintenanceFilePath != ''"> and maintenance_file_path = #{maintenanceFilePath}</if>
- <if test="approveFilePath != null and approveFilePath != ''"> and approve_file_path = #{approveFilePath}</if>
- </where>
- )a order by plan_code,plan_code_w,station,line_name
- </select>
- <select id="selectPdmMaintenanceProcessById" parameterType="Long" resultMap="PdmMaintenanceProcessResult">
- <include refid="selectPdmMaintenanceProcessVo"/>
- where id = #{id}
- </select>
- <insert id="insertPdmMaintenanceProcess" parameterType="PdmMaintenanceProcess" useGeneratedKeys="true" keyProperty="id">
- insert into pdm_maintenance_process
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="planCode != null">plan_code,</if>
- <if test="powerOutageDevices != null">power_outage_devices,</if>
- <if test="perHourHouseholdsM != null">per_hour_households_m,</if>
- <if test="perHourHouseholdsW != null">per_hour_households_w,</if>
- <if test="city != null">city,</if>
- <if test="county != null">county,</if>
- <if test="station != null">station,</if>
- <if test="lineCode != null">line_code,</if>
- <if test="lineName != null">line_name,</if>
- <if test="perHourHouseholdsArtif != null">per_hour_households_artif,</if>
- <if test="declarAgency != null">declar_agency,</if>
- <if test="isMaintenance != null">is_maintenance,</if>
- <if test="isApprove != null">is_approve,</if>
- <if test="maintenanceFilePath != null">maintenance_file_path,</if>
- <if test="approveFilePath != null">approve_file_path,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="planCode != null">#{planCode},</if>
- <if test="powerOutageDevices != null">#{powerOutageDevices},</if>
- <if test="perHourHouseholdsM != null">#{perHourHouseholdsM},</if>
- <if test="perHourHouseholdsW != null">#{perHourHouseholdsW},</if>
- <if test="city != null">#{city},</if>
- <if test="county != null">#{county},</if>
- <if test="station != null">#{station},</if>
- <if test="lineCode != null">#{lineCode},</if>
- <if test="lineName != null">#{lineName},</if>
- <if test="perHourHouseholdsArtif != null">#{perHourHouseholdsArtif},</if>
- <if test="declarAgency != null">#{declarAgency},</if>
- <if test="isMaintenance != null">#{isMaintenance},</if>
- <if test="isApprove != null">#{isApprove},</if>
- <if test="maintenanceFilePath != null">#{maintenanceFilePath},</if>
- <if test="approveFilePath != null">#{approveFilePath},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <update id="updatePdmMaintenanceProcess" parameterType="PdmMaintenanceProcess">
- update pdm_maintenance_process
- <trim prefix="SET" suffixOverrides=",">
- <if test="planCode != null">plan_code = #{planCode},</if>
- <if test="powerOutageDevices != null">power_outage_devices = #{powerOutageDevices},</if>
- <if test="perHourHouseholdsM != null">per_hour_households_m = #{perHourHouseholdsM},</if>
- <if test="perHourHouseholdsW != null">per_hour_households_w = #{perHourHouseholdsW},</if>
- <if test="city != null">city = #{city},</if>
- <if test="county != null">county = #{county},</if>
- <if test="station != null">station = #{station},</if>
- <if test="lineCode != null">line_code = #{lineCode},</if>
- <if test="lineName != null">line_name = #{lineName},</if>
- <if test="perHourHouseholdsArtif != null">per_hour_households_artif = #{perHourHouseholdsArtif},</if>
- <if test="declarAgency != null">declar_agency = #{declarAgency},</if>
- <if test="isMaintenance != null">is_maintenance = #{isMaintenance},</if>
- <if test="isApprove != null">is_approve = #{isApprove},</if>
- <if test="maintenanceFilePath != null">maintenance_file_path = #{maintenanceFilePath},</if>
- <if test="approveFilePath != null">approve_file_path = #{approveFilePath},</if>
- <if test="maintenanceFileName != null">maintenance_file_name = #{maintenanceFileName},</if>
- <if test="approveFileName != null">approve_file_name = #{approveFileName},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deletePdmMaintenanceProcessById" parameterType="Long">
- delete from pdm_maintenance_process where id = #{id}
- </delete>
- <delete id="deletePdmMaintenanceProcessByIds" parameterType="String">
- delete from pdm_maintenance_process where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|