123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555 |
- <?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.gyee.frame.mapper.auto.ShutdowneventMapper">
- <!-- <cache type="org.mybatis.caches.ehcache.EhcacheCache">-->
- <!-- <property name="timeToIdleSeconds" value="60"></property><!–<!–当缓存闲置60秒后销毁–>–>-->
- <!-- <property name="timeToLiveSeconds" value="160"></property><!–<!–缓存存在160秒后销毁–>–>-->
- <!-- <property name="maxEntriesLocalHeap" value="1000"></property>-->
- <!-- <property name="maxEntriesLocalDisk" value="10000000"></property>-->
- <!-- <property name="memoryStoreEvictionPolicy" value="LRU"></property>-->
- <!-- </cache>-->
- <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.Shutdownevent">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="windPowerStationId" jdbcType="VARCHAR" property="windpowerstationid" />
- <result column="windTurbineId" jdbcType="VARCHAR" property="windturbineid" />
- <result column="stopTime" jdbcType="TIMESTAMP" property="stoptime" />
- <result column="startTime" jdbcType="TIMESTAMP" property="starttime" />
- <result column="stopHours" jdbcType="DECIMAL" property="stophours" />
- <result column="lossPower" jdbcType="DECIMAL" property="losspower" />
- <result column="stopTypeId" jdbcType="VARCHAR" property="stoptypeid" />
- <result column="isHandle" jdbcType="SMALLINT" property="ishandle" />
- <result column="warningId" jdbcType="VARCHAR" property="warningid" />
- <result column="projectId" jdbcType="VARCHAR" property="projectid" />
- <result column="handleWay" jdbcType="VARCHAR" property="handleway" />
- <result column="faultView" jdbcType="VARCHAR" property="faultview" />
- <result column="statusCode" jdbcType="INTEGER" property="statuscode" />
- <result column="mainId" jdbcType="VARCHAR" property="mainid" />
- <result column="resetRate" jdbcType="VARCHAR" property="resetrate" />
- <result column="stateRate" jdbcType="VARCHAR" property="staterate" />
- <result column="failRate" jdbcType="VARCHAR" property="failrate" />
- <result column="warningRecordsId" jdbcType="INTEGER" property="warningrecordsid" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.dateValue">
- and ${criterion.condition} to_date(#{criterion.value},'yyyy-MM-dd')
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- id, windPowerStationId, windTurbineId, stopTime, startTime, stopHours, lossPower,
- stopTypeId, isHandle, warningId, projectId, handleWay, faultView, statusCode, mainId,
- resetRate, stateRate, failRate, warningRecordsId
- </sql>
- <select id="selectByExample" parameterType="com.gyee.frame.model.auto.ShutdowneventExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from shutdownevent
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select
- <include refid="Base_Column_List" />
- from shutdownevent
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- delete from shutdownevent
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.ShutdowneventExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- delete from shutdownevent
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.gyee.frame.model.auto.Shutdownevent">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- insert into shutdownevent (id, windPowerStationId, windTurbineId,
- stopTime, startTime, stopHours,
- lossPower, stopTypeId, isHandle,
- warningId, projectId, handleWay,
- faultView, statusCode, mainId,
- resetRate, stateRate, failRate,
- warningRecordsId)
- values (#{id,jdbcType=VARCHAR}, #{windpowerstationid,jdbcType=VARCHAR}, #{windturbineid,jdbcType=VARCHAR},
- #{stoptime,jdbcType=TIMESTAMP}, #{starttime,jdbcType=TIMESTAMP}, #{stophours,jdbcType=DECIMAL},
- #{losspower,jdbcType=DECIMAL}, #{stoptypeid,jdbcType=VARCHAR}, #{ishandle,jdbcType=SMALLINT},
- #{warningid,jdbcType=VARCHAR}, #{projectid,jdbcType=VARCHAR}, #{handleway,jdbcType=VARCHAR},
- #{faultview,jdbcType=VARCHAR}, #{statuscode,jdbcType=INTEGER}, #{mainid,jdbcType=VARCHAR},
- #{resetrate,jdbcType=VARCHAR}, #{staterate,jdbcType=VARCHAR}, #{failrate,jdbcType=VARCHAR},
- #{warningrecordsid,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.Shutdownevent">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- insert into shutdownevent
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="windpowerstationid != null">
- windPowerStationId,
- </if>
- <if test="windturbineid != null">
- windTurbineId,
- </if>
- <if test="stoptime != null">
- stopTime,
- </if>
- <if test="starttime != null">
- startTime,
- </if>
- <if test="stophours != null">
- stopHours,
- </if>
- <if test="losspower != null">
- lossPower,
- </if>
- <if test="stoptypeid != null">
- stopTypeId,
- </if>
- <if test="ishandle != null">
- isHandle,
- </if>
- <if test="warningid != null">
- warningId,
- </if>
- <if test="projectid != null">
- projectId,
- </if>
- <if test="handleway != null">
- handleWay,
- </if>
- <if test="faultview != null">
- faultView,
- </if>
- <if test="statuscode != null">
- statusCode,
- </if>
- <if test="mainid != null">
- mainId,
- </if>
- <if test="resetrate != null">
- resetRate,
- </if>
- <if test="staterate != null">
- stateRate,
- </if>
- <if test="failrate != null">
- failRate,
- </if>
- <if test="warningrecordsid != null">
- warningRecordsId,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="windpowerstationid != null">
- #{windpowerstationid,jdbcType=VARCHAR},
- </if>
- <if test="windturbineid != null">
- #{windturbineid,jdbcType=VARCHAR},
- </if>
- <if test="stoptime != null">
- #{stoptime,jdbcType=TIMESTAMP},
- </if>
- <if test="starttime != null">
- #{starttime,jdbcType=TIMESTAMP},
- </if>
- <if test="stophours != null">
- #{stophours,jdbcType=DECIMAL},
- </if>
- <if test="losspower != null">
- #{losspower,jdbcType=DECIMAL},
- </if>
- <if test="stoptypeid != null">
- #{stoptypeid,jdbcType=VARCHAR},
- </if>
- <if test="ishandle != null">
- #{ishandle,jdbcType=SMALLINT},
- </if>
- <if test="warningid != null">
- #{warningid,jdbcType=VARCHAR},
- </if>
- <if test="projectid != null">
- #{projectid,jdbcType=VARCHAR},
- </if>
- <if test="handleway != null">
- #{handleway,jdbcType=VARCHAR},
- </if>
- <if test="faultview != null">
- #{faultview,jdbcType=VARCHAR},
- </if>
- <if test="statuscode != null">
- #{statuscode,jdbcType=INTEGER},
- </if>
- <if test="mainid != null">
- #{mainid,jdbcType=VARCHAR},
- </if>
- <if test="resetrate != null">
- #{resetrate,jdbcType=VARCHAR},
- </if>
- <if test="staterate != null">
- #{staterate,jdbcType=VARCHAR},
- </if>
- <if test="failrate != null">
- #{failrate,jdbcType=VARCHAR},
- </if>
- <if test="warningrecordsid != null">
- #{warningrecordsid,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.gyee.frame.model.auto.ShutdowneventExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select count(*) from shutdownevent
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update shutdownevent
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=VARCHAR},
- </if>
- <if test="record.windpowerstationid != null">
- windPowerStationId = #{record.windpowerstationid,jdbcType=VARCHAR},
- </if>
- <if test="record.windturbineid != null">
- windTurbineId = #{record.windturbineid,jdbcType=VARCHAR},
- </if>
- <if test="record.stoptime != null">
- stopTime = #{record.stoptime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.starttime != null">
- startTime = #{record.starttime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.stophours != null">
- stopHours = #{record.stophours,jdbcType=DECIMAL},
- </if>
- <if test="record.losspower != null">
- lossPower = #{record.losspower,jdbcType=DECIMAL},
- </if>
- <if test="record.stoptypeid != null">
- stopTypeId = #{record.stoptypeid,jdbcType=VARCHAR},
- </if>
- <if test="record.ishandle != null">
- isHandle = #{record.ishandle,jdbcType=SMALLINT},
- </if>
- <if test="record.warningid != null">
- warningId = #{record.warningid,jdbcType=VARCHAR},
- </if>
- <if test="record.projectid != null">
- projectId = #{record.projectid,jdbcType=VARCHAR},
- </if>
- <if test="record.handleway != null">
- handleWay = #{record.handleway,jdbcType=VARCHAR},
- </if>
- <if test="record.faultview != null">
- faultView = #{record.faultview,jdbcType=VARCHAR},
- </if>
- <if test="record.statuscode != null">
- statusCode = #{record.statuscode,jdbcType=INTEGER},
- </if>
- <if test="record.mainid != null">
- mainId = #{record.mainid,jdbcType=VARCHAR},
- </if>
- <if test="record.resetrate != null">
- resetRate = #{record.resetrate,jdbcType=VARCHAR},
- </if>
- <if test="record.staterate != null">
- stateRate = #{record.staterate,jdbcType=VARCHAR},
- </if>
- <if test="record.failrate != null">
- failRate = #{record.failrate,jdbcType=VARCHAR},
- </if>
- <if test="record.warningrecordsid != null">
- warningRecordsId = #{record.warningrecordsid,jdbcType=INTEGER},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update shutdownevent
- set id = #{record.id,jdbcType=VARCHAR},
- windPowerStationId = #{record.windpowerstationid,jdbcType=VARCHAR},
- windTurbineId = #{record.windturbineid,jdbcType=VARCHAR},
- stopTime = #{record.stoptime,jdbcType=TIMESTAMP},
- startTime = #{record.starttime,jdbcType=TIMESTAMP},
- stopHours = #{record.stophours,jdbcType=DECIMAL},
- lossPower = #{record.losspower,jdbcType=DECIMAL},
- stopTypeId = #{record.stoptypeid,jdbcType=VARCHAR},
- isHandle = #{record.ishandle,jdbcType=SMALLINT},
- warningId = #{record.warningid,jdbcType=VARCHAR},
- projectId = #{record.projectid,jdbcType=VARCHAR},
- handleWay = #{record.handleway,jdbcType=VARCHAR},
- faultView = #{record.faultview,jdbcType=VARCHAR},
- statusCode = #{record.statuscode,jdbcType=INTEGER},
- mainId = #{record.mainid,jdbcType=VARCHAR},
- resetRate = #{record.resetrate,jdbcType=VARCHAR},
- stateRate = #{record.staterate,jdbcType=VARCHAR},
- failRate = #{record.failrate,jdbcType=VARCHAR},
- warningRecordsId = #{record.warningrecordsid,jdbcType=INTEGER}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.Shutdownevent">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update shutdownevent
- <set>
- <if test="windpowerstationid != null">
- windPowerStationId = #{windpowerstationid,jdbcType=VARCHAR},
- </if>
- <if test="windturbineid != null">
- windTurbineId = #{windturbineid,jdbcType=VARCHAR},
- </if>
- <if test="stoptime != null">
- stopTime = #{stoptime,jdbcType=TIMESTAMP},
- </if>
- <if test="starttime != null">
- startTime = #{starttime,jdbcType=TIMESTAMP},
- </if>
- <if test="stophours != null">
- stopHours = #{stophours,jdbcType=DECIMAL},
- </if>
- <if test="losspower != null">
- lossPower = #{losspower,jdbcType=DECIMAL},
- </if>
- <if test="stoptypeid != null">
- stopTypeId = #{stoptypeid,jdbcType=VARCHAR},
- </if>
- <if test="ishandle != null">
- isHandle = #{ishandle,jdbcType=SMALLINT},
- </if>
- <if test="warningid != null">
- warningId = #{warningid,jdbcType=VARCHAR},
- </if>
- <if test="projectid != null">
- projectId = #{projectid,jdbcType=VARCHAR},
- </if>
- <if test="handleway != null">
- handleWay = #{handleway,jdbcType=VARCHAR},
- </if>
- <if test="faultview != null">
- faultView = #{faultview,jdbcType=VARCHAR},
- </if>
- <if test="statuscode != null">
- statusCode = #{statuscode,jdbcType=INTEGER},
- </if>
- <if test="mainid != null">
- mainId = #{mainid,jdbcType=VARCHAR},
- </if>
- <if test="resetrate != null">
- resetRate = #{resetrate,jdbcType=VARCHAR},
- </if>
- <if test="staterate != null">
- stateRate = #{staterate,jdbcType=VARCHAR},
- </if>
- <if test="failrate != null">
- failRate = #{failrate,jdbcType=VARCHAR},
- </if>
- <if test="warningrecordsid != null">
- warningRecordsId = #{warningrecordsid,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.Shutdownevent">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update shutdownevent
- set windPowerStationId = #{windpowerstationid,jdbcType=VARCHAR},
- windTurbineId = #{windturbineid,jdbcType=VARCHAR},
- stopTime = #{stoptime,jdbcType=TIMESTAMP},
- startTime = #{starttime,jdbcType=TIMESTAMP},
- stopHours = #{stophours,jdbcType=DECIMAL},
- lossPower = #{losspower,jdbcType=DECIMAL},
- stopTypeId = #{stoptypeid,jdbcType=VARCHAR},
- isHandle = #{ishandle,jdbcType=SMALLINT},
- warningId = #{warningid,jdbcType=VARCHAR},
- projectId = #{projectid,jdbcType=VARCHAR},
- handleWay = #{handleway,jdbcType=VARCHAR},
- faultView = #{faultview,jdbcType=VARCHAR},
- statusCode = #{statuscode,jdbcType=INTEGER},
- mainId = #{mainid,jdbcType=VARCHAR},
- resetRate = #{resetrate,jdbcType=VARCHAR},
- stateRate = #{staterate,jdbcType=VARCHAR},
- failRate = #{failrate,jdbcType=VARCHAR},
- warningRecordsId = #{warningrecordsid,jdbcType=INTEGER}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <!--
- <select id="countStopByWp" resultType="com.gyee.frame.model.custom.SimpleVo">
- select t.windpowerstationid id,count(*) value from shutdownevent t
- where instr(t.windpowerstationid,'_FDC')>0 and t.statuscode=2
- and t.stoptime >= (select max(stoptime)-7 from shutdownevent)
- and t.stoptime <= (select max(stoptime) from shutdownevent) group by t.windpowerstationid
- </select>
- <select id="countStopByPj" resultType="com.gyee.frame.model.custom.SimpleVo">
- select t1.projectid id,count(*) value from shutdownevent t,windturbine t1 where instr(t.windpowerstationid,'_FDC')>0 and t.statuscode=2
- and t.stoptime >= (select max(stoptime)-7 from shutdownevent)
- and t.stoptime <= (select max(stoptime) from shutdownevent) and t.windturbineid = t1.id group by t1.projectid order by t1.projectid
- </select>
- -->
- <select id="countStopByWp" resultType="com.gyee.frame.model.custom.SimpleVo">
- select b.windpowerstationid id, count(*) filter(where a.stoptime between (SELECT current_date - interval '7 day') and current_date) as
- value from shutdownevent a,windturbine b
- where a.windturbineid = b.id and a.statuscode=2 group by b.windpowerstationid
- </select>
- <select id="countStopByPj" resultType="com.gyee.frame.model.custom.SimpleVo">
- select b.projectid id, count(*) filter(where a.stoptime between (SELECT current_date - interval '7 day') and current_date) as
- value from shutdownevent a,windturbine b
- where a.windturbineid = b.id and a.statuscode=2 group by b.projectid
- </select>
- <select id="queryEvents" resultType="com.gyee.frame.model.custom.ShutdowneventVo">
- select t.id,t.windPowerStationId,t.windTurbineId,t.warningId,w.chinesetext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower,t.statusCode,t.stopTypeId
- from shutdownevent t ,warning2 w,windturbine b WHERE
- cast(t.warningid as integer ) =w.ednavalue and t.windturbineid=b.id and b.modelid=w.modelid
- and t.stopTime>=#{beginDate}
- and t.stopTime<=#{endDate}
- and t.statusCode=2
- <if test="type != null">
- and t.statusCode = #{type,jdbcType=VARCHAR}
- </if>
- <if test="wtId != null">
- and t.windTurbineId = #{wtId,jdbcType=VARCHAR}
- </if>
- <if test="wpId != null">
- and t.windPowerStationId = #{wpId,jdbcType=VARCHAR}
- </if>
- order by t.windturbineid,t.starttime desc
- </select>
- </mapper>
|