123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?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.ProjectplanMapper">
- <resultMap type="Projectplan" id="ProjectplanResult">
- <result property="id" column="id" />
- <result property="projectid" column="projectid" />
- <result property="generatingcapacity" column="generatingcapacity" />
- <result property="year" column="year" />
- <result property="month" column="month" />
- <result property="windpower" column="windpower" />
- </resultMap>
- <sql id="selectProjectplanVo">
- select id, projectid, generatingcapacity, year, month, windpower from projectplan
- </sql>
- <select id="selectProjectplanList" parameterType="Projectplan" resultMap="ProjectplanResult">
- select
- p.*,
- w.name as "windplantName",
- pps.name as "pvStationName"
- from
- projectplan p
- left join windplant w on w.windplant_no = p.windpower
- left join pv_power_station pps on pps.pv_station_no = p.windpower
- <where>
- <if test="id != null and id != ''"> and p.id = #{id}</if>
- <if test="projectid != null and projectid != ''"> and p.projectid = #{projectid}</if>
- <if test="generatingcapacity != null and generatingcapacity != ''"> and p.generatingcapacity = #{generatingcapacity}</if>
- <if test="year != null and year != ''"> and p.year = #{year}</if>
- <if test="month != null and month != ''"> and p.month = #{month}</if>
- <if test="windpower != null and windpower != ''"> and p.windpower = #{windpower}</if>
- </where>
- order by w.windplant_no asc
- </select>
- <select id="selectProjectplanById" parameterType="String" resultMap="ProjectplanResult">
- <include refid="selectProjectplanVo"/>
- where id = #{id}
- </select>
- <select id="selectNewData" resultType="Long">
- SELECT * FROM ( SELECT id FROM projectplan ORDER BY id DESC ) WHERE ROWNUM = 1
- </select>
- <select id="checkProjectplanUnique" resultType="int">
- select count(1) from projectplan where windpower = #{windpower} and projectid = #{projectid} and year = #{year} and month = #{month} and rownum <![CDATA[ <= ]]> 1
- </select>
- <select id="selectProjectplan" parameterType="Projectplan" resultMap="ProjectplanResult">
- <include refid="selectProjectplanVo"/>
- where windpower = #{windplantNo} and year = #{year} and month = #{month}
- </select>
- <select id="selectProjectplanByYear" parameterType="Projectplan" resultMap="ProjectplanResult">
- <include refid="selectProjectplanVo"/>
- where windpower = #{windplantNo} and year = #{year}
- </select>
- <select id="selectProjectplanByProjectNo" parameterType="Projectplan" resultMap="ProjectplanResult">
- <include refid="selectProjectplanVo"/>
- where windpower = #{windplantNo} and projectid = #{projectid} and year = #{year} and month = #{month}
- </select>
- <insert id="insertProjectplan" parameterType="Projectplan">
- insert into projectplan
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="projectid != null">projectid,</if>
- <if test="generatingcapacity != null">generatingcapacity,</if>
- <if test="year != null">year,</if>
- <if test="month != null">month,</if>
- <if test="windpower != null">windpower,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="projectid != null">#{projectid},</if>
- <if test="generatingcapacity != null">#{generatingcapacity},</if>
- <if test="year != null">#{year},</if>
- <if test="month != null">#{month},</if>
- <if test="windpower != null">#{windpower},</if>
- </trim>
- </insert>
- <update id="updateProjectplan" parameterType="Projectplan">
- update projectplan
- <trim prefix="SET" suffixOverrides=",">
- <if test="projectid != null">projectid = #{projectid},</if>
- <if test="generatingcapacity != null">generatingcapacity = #{generatingcapacity},</if>
- <if test="year != null">year = #{year},</if>
- <if test="month != null">month = #{month},</if>
- <if test="windpower != null">windpower = #{windpower},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteProjectplanById" parameterType="String">
- delete from projectplan where id = #{id}
- </delete>
- <delete id="deleteProjectplanByIds" parameterType="String">
- delete from projectplan where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|