123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?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.predict.mapper.CollectorwireprojectMapper">
- <resultMap type="Collectorwireproject" id="CollectorwireprojectResult">
- <result property="wpNo" column="wp_no"/>
- <result property="projectNo" column="project_no"/>
- <result property="collectorwireNo" column="collectorwire_no"/>
- <result property="wireName" column="wire_name"/>
- <result property="wireIssue" column="wire_issue"/>
- <result property="wireCapacity" column="wire_capacity"/>
- <result property="analogNo" column="analog_no"/>
- <result property="bcrNo" column="bcr_no"/>
- <result property="statSpeedTime" column="stat_speed_time"/>
- <result property="unitsNumber" column="units_number"/>
- </resultMap>
- <sql id="selectCollectorwireprojectVo">
- select wp_no, project_no, collectorwire_no, wire_name, wire_issue, wire_capacity, analog_no, bcr_no, stat_speed_time, units_number from collectorwireproject
- </sql>
- <select id="selectCollectorwireprojectList" parameterType="Collectorwireproject"
- resultMap="CollectorwireprojectResult">
- select
- cwp.*,
- w.name as "windplantName",
- pps.name as "pvStationName",
- wp.project_name as "projectName"
- from
- collectorwireproject cwp
- left join windplant w on w.windplant_no = cwp.wp_no
- left join pv_power_station pps on pps.pv_station_no = cwp.wp_no
- left join windplantproject wp on wp.project_no = cwp.project_no
- <where>
- <if test="wpNo != null ">and cwp.wp_no = #{wpNo}</if>
- <if test="projectNo != null ">and cwp.project_no = #{projectNo}</if>
- <if test="collectorwireNo != null ">and cwp.collectorwire_no = #{collectorwireNo}</if>
- <if test="wireName != null and wireName != ''">and cwp.wire_name like concat(concat('%', #{wireName}), '%')
- </if>
- <if test="wireIssue != null and wireIssue != ''">and cwp.wire_issue like concat(concat('%', #{wireIssue}), '%')
- </if>
- <if test="wireCapacity != null ">and cwp.wire_capacity = #{wireCapacity}</if>
- <if test="analogNo != null ">and cwp.analog_no = #{analogNo}</if>
- <if test="bcrNo != null ">and cwp.bcr_no = #{bcrNo}</if>
- <if test="statSpeedTime != null ">and cwp.stat_speed_time = #{statSpeedTime}</if>
- <if test="unitsNumber != null ">and cwp.units_number = #{unitsNumber}</if>
- <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
- and cwp.stat_speed_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
- to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
- </if>
- </where>
- order by cwp.wp_no asc
- </select>
- <select id="selectCollectorwireprojectById" parameterType="Long" resultMap="CollectorwireprojectResult">
- <include refid="selectCollectorwireprojectVo"/>
- where collectorwire_no = #{collectorwireNo}
- </select>
- <select id="selectCollectorwireproject" parameterType="Long" resultMap="CollectorwireprojectResult">
- <include refid="selectCollectorwireprojectVo"/>
- where wp_no = #{windplantNo} and project_no = #{projectNo} and collectorwire_no = #{collectorwireNo}
- </select>
- <select id="selectCollectorwireprojectByProjectNo" parameterType="Long" resultMap="CollectorwireprojectResult">
- <include refid="selectCollectorwireprojectVo"/>
- where wp_no = #{windplantNo} and project_no = #{projectNo}
- </select>
- <select id="selectNewData" resultType="Long">
- SELECT * FROM ( SELECT collectorwire_no FROM collectorwireproject ORDER BY collectorwire_no DESC ) WHERE ROWNUM = 1
- </select>
- <select id="selectCollectorwireprojectByWindplantNo" parameterType="Long" resultMap="CollectorwireprojectResult">
- <include refid="selectCollectorwireprojectVo"/>
- where wp_no = #{windplantNo}
- </select>
- <insert id="insertCollectorwireproject" parameterType="Collectorwireproject">
- insert into collectorwireproject
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="wpNo != null">wp_no,</if>
- <if test="projectNo != null">project_no,</if>
- <if test="collectorwireNo != null">collectorwire_no,</if>
- <if test="wireName != null">wire_name,</if>
- <if test="wireIssue != null">wire_issue,</if>
- <if test="wireCapacity != null">wire_capacity,</if>
- <if test="analogNo != null">analog_no,</if>
- <if test="bcrNo != null">bcr_no,</if>
- <if test="statSpeedTime != null">stat_speed_time,</if>
- <if test="unitsNumber != null">units_number,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="wpNo != null">#{wpNo},</if>
- <if test="projectNo != null">#{projectNo},</if>
- <if test="collectorwireNo != null">#{collectorwireNo},</if>
- <if test="wireName != null">#{wireName},</if>
- <if test="wireIssue != null">#{wireIssue},</if>
- <if test="wireCapacity != null">#{wireCapacity},</if>
- <if test="analogNo != null">#{analogNo},</if>
- <if test="bcrNo != null">#{bcrNo},</if>
- <if test="statSpeedTime != null">#{statSpeedTime},</if>
- <if test="unitsNumber != null">#{unitsNumber},</if>
- </trim>
- </insert>
- <insert id="insertCollectorwireprojectList">
- insert into collectorwireproject(collectorwire_no, wp_no, project_no, wire_name, wire_capacity, analog_no, stat_speed_time)
- <foreach collection="list" item="item" separator="UNION ALL">
- SELECT
- #{item.collectorwireNo},
- #{item.wpNo},
- #{item.projectNo},
- #{item.wireName},
- #{item.wireCapacity},
- #{item.analogNo},
- #{item.statSpeedTime}
- FROM DUAL
- </foreach>
- </insert>
- <update id="updateCollectorwireproject" parameterType="Collectorwireproject">
- update collectorwireproject
- <trim prefix="SET" suffixOverrides=",">
- <if test="wpNo != null">wp_no = #{wpNo},</if>
- <if test="projectNo != null">project_no = #{projectNo},</if>
- <if test="wireName != null">wire_name = #{wireName},</if>
- <if test="wireIssue != null">wire_issue = #{wireIssue},</if>
- <if test="wireCapacity != null">wire_capacity = #{wireCapacity},</if>
- <if test="analogNo != null">analog_no = #{analogNo},</if>
- <if test="bcrNo != null">bcr_no = #{bcrNo},</if>
- <if test="statSpeedTime != null">stat_speed_time = #{statSpeedTime},</if>
- <if test="unitsNumber != null">units_number = #{unitsNumber},</if>
- </trim>
- where collectorwire_no = #{collectorwireNo}
- </update>
- <delete id="deleteCollectorwireprojectById" parameterType="Long">
- delete from collectorwireproject where collectorwire_no = #{collectorwireNo}
- </delete>
- <delete id="deleteCollectorwireprojectByWindplantNo" parameterType="Long">
- delete from collectorwireproject where wp_no = #{windplantNo}
- </delete>
- <delete id="deleteCollectorwireprojectByProjectNo" parameterType="Long">
- delete from collectorwireproject where project_no = #{projectNo}
- </delete>
- </mapper>
|