WindTurbineInfoDay2Mapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.gyee.frame.mapper.auto.WindTurbineInfoDay2Mapper">
  4. <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.WindTurbineInfoDay2">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. -->
  9. <id column="ID" jdbcType="INTEGER" property="id" />
  10. <result column="WINDTURBINEID" jdbcType="VARCHAR" property="windturbineid" />
  11. <result column="RECORDDATE" jdbcType="DATE" property="recorddate" />
  12. <result column="WINDPOWERSTATIONID" jdbcType="VARCHAR" property="windpowerstationid" />
  13. <result column="PROJECTID" jdbcType="VARCHAR" property="projectid" />
  14. <result column="LINEID" jdbcType="VARCHAR" property="lineid" />
  15. <result column="DAYCOEFFICIENT" jdbcType="DECIMAL" property="daycoefficient" />
  16. <result column="MONTHCOEFFICIENT" jdbcType="DECIMAL" property="monthcoefficient" />
  17. <result column="YEARCOEFFICIENT" jdbcType="DECIMAL" property="yearcoefficient" />
  18. </resultMap>
  19. <sql id="Example_Where_Clause">
  20. <!--
  21. WARNING - @mbg.generated
  22. This element is automatically generated by MyBatis Generator, do not modify.
  23. -->
  24. <where>
  25. <foreach collection="oredCriteria" item="criteria" separator="or">
  26. <if test="criteria.valid">
  27. <trim prefix="(" prefixOverrides="and" suffix=")">
  28. <foreach collection="criteria.criteria" item="criterion">
  29. <choose>
  30. <when test="criterion.noValue">
  31. and ${criterion.condition}
  32. </when>
  33. <when test="criterion.singleValue">
  34. and ${criterion.condition} #{criterion.value}
  35. </when>
  36. <when test="criterion.betweenValue">
  37. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  38. </when>
  39. <when test="criterion.listValue">
  40. and ${criterion.condition}
  41. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  42. #{listItem}
  43. </foreach>
  44. </when>
  45. </choose>
  46. </foreach>
  47. </trim>
  48. </if>
  49. </foreach>
  50. </where>
  51. </sql>
  52. <sql id="Update_By_Example_Where_Clause">
  53. <!--
  54. WARNING - @mbg.generated
  55. This element is automatically generated by MyBatis Generator, do not modify.
  56. -->
  57. <where>
  58. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  59. <if test="criteria.valid">
  60. <trim prefix="(" prefixOverrides="and" suffix=")">
  61. <foreach collection="criteria.criteria" item="criterion">
  62. <choose>
  63. <when test="criterion.noValue">
  64. and ${criterion.condition}
  65. </when>
  66. <when test="criterion.singleValue">
  67. and ${criterion.condition} #{criterion.value}
  68. </when>
  69. <when test="criterion.betweenValue">
  70. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  71. </when>
  72. <when test="criterion.listValue">
  73. and ${criterion.condition}
  74. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  75. #{listItem}
  76. </foreach>
  77. </when>
  78. </choose>
  79. </foreach>
  80. </trim>
  81. </if>
  82. </foreach>
  83. </where>
  84. </sql>
  85. <sql id="Base_Column_List">
  86. <!--
  87. WARNING - @mbg.generated
  88. This element is automatically generated by MyBatis Generator, do not modify.
  89. -->
  90. ID, WINDTURBINEID, RECORDDATE, WINDPOWERSTATIONID, PROJECTID, LINEID, DAYCOEFFICIENT,
  91. MONTHCOEFFICIENT, YEARCOEFFICIENT
  92. </sql>
  93. <select id="selectByExample" parameterType="com.gyee.frame.model.auto.WindTurbineInfoDay2Example" resultMap="BaseResultMap">
  94. <!--
  95. WARNING - @mbg.generated
  96. This element is automatically generated by MyBatis Generator, do not modify.
  97. -->
  98. select
  99. <if test="distinct">
  100. distinct
  101. </if>
  102. <include refid="Base_Column_List" />
  103. from windturbineinfoday2
  104. <if test="_parameter != null">
  105. <include refid="Example_Where_Clause" />
  106. </if>
  107. <if test="orderByClause != null">
  108. order by ${orderByClause}
  109. </if>
  110. </select>
  111. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  112. <!--
  113. WARNING - @mbg.generated
  114. This element is automatically generated by MyBatis Generator, do not modify.
  115. -->
  116. select
  117. <include refid="Base_Column_List" />
  118. from windturbineinfoday2
  119. where ID = #{id,jdbcType=INTEGER}
  120. </select>
  121. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  122. <!--
  123. WARNING - @mbg.generated
  124. This element is automatically generated by MyBatis Generator, do not modify.
  125. -->
  126. delete from windturbineinfoday2
  127. where ID = #{id,jdbcType=INTEGER}
  128. </delete>
  129. <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.WindTurbineInfoDay2Example">
  130. <!--
  131. WARNING - @mbg.generated
  132. This element is automatically generated by MyBatis Generator, do not modify.
  133. -->
  134. delete from windturbineinfoday2
  135. <if test="_parameter != null">
  136. <include refid="Example_Where_Clause" />
  137. </if>
  138. </delete>
  139. <insert id="insert" parameterType="com.gyee.frame.model.auto.WindTurbineInfoDay2">
  140. <!--
  141. WARNING - @mbg.generated
  142. This element is automatically generated by MyBatis Generator, do not modify.
  143. -->
  144. insert into windturbineinfoday2 (ID, WINDTURBINEID, RECORDDATE,
  145. WINDPOWERSTATIONID, PROJECTID, LINEID,
  146. DAYCOEFFICIENT, MONTHCOEFFICIENT, YEARCOEFFICIENT
  147. )
  148. values (#{id,jdbcType=INTEGER}, #{windturbineid,jdbcType=VARCHAR}, #{recorddate,jdbcType=DATE},
  149. #{windpowerstationid,jdbcType=VARCHAR}, #{projectid,jdbcType=VARCHAR}, #{lineid,jdbcType=VARCHAR},
  150. #{daycoefficient,jdbcType=DECIMAL}, #{monthcoefficient,jdbcType=DECIMAL}, #{yearcoefficient,jdbcType=DECIMAL}
  151. )
  152. </insert>
  153. <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.WindTurbineInfoDay2">
  154. <!--
  155. WARNING - @mbg.generated
  156. This element is automatically generated by MyBatis Generator, do not modify.
  157. -->
  158. insert into windturbineinfoday2
  159. <trim prefix="(" suffix=")" suffixOverrides=",">
  160. <if test="id != null">
  161. ID,
  162. </if>
  163. <if test="windturbineid != null">
  164. WINDTURBINEID,
  165. </if>
  166. <if test="recorddate != null">
  167. RECORDDATE,
  168. </if>
  169. <if test="windpowerstationid != null">
  170. WINDPOWERSTATIONID,
  171. </if>
  172. <if test="projectid != null">
  173. PROJECTID,
  174. </if>
  175. <if test="lineid != null">
  176. LINEID,
  177. </if>
  178. <if test="daycoefficient != null">
  179. DAYCOEFFICIENT,
  180. </if>
  181. <if test="monthcoefficient != null">
  182. MONTHCOEFFICIENT,
  183. </if>
  184. <if test="yearcoefficient != null">
  185. YEARCOEFFICIENT,
  186. </if>
  187. </trim>
  188. <trim prefix="values (" suffix=")" suffixOverrides=",">
  189. <if test="id != null">
  190. #{id,jdbcType=INTEGER},
  191. </if>
  192. <if test="windturbineid != null">
  193. #{windturbineid,jdbcType=VARCHAR},
  194. </if>
  195. <if test="recorddate != null">
  196. #{recorddate,jdbcType=DATE},
  197. </if>
  198. <if test="windpowerstationid != null">
  199. #{windpowerstationid,jdbcType=VARCHAR},
  200. </if>
  201. <if test="projectid != null">
  202. #{projectid,jdbcType=VARCHAR},
  203. </if>
  204. <if test="lineid != null">
  205. #{lineid,jdbcType=VARCHAR},
  206. </if>
  207. <if test="daycoefficient != null">
  208. #{daycoefficient,jdbcType=DECIMAL},
  209. </if>
  210. <if test="monthcoefficient != null">
  211. #{monthcoefficient,jdbcType=DECIMAL},
  212. </if>
  213. <if test="yearcoefficient != null">
  214. #{yearcoefficient,jdbcType=DECIMAL},
  215. </if>
  216. </trim>
  217. </insert>
  218. <select id="countByExample" parameterType="com.gyee.frame.model.auto.WindTurbineInfoDay2Example" resultType="java.lang.Long">
  219. <!--
  220. WARNING - @mbg.generated
  221. This element is automatically generated by MyBatis Generator, do not modify.
  222. -->
  223. select count(*) from windturbineinfoday2
  224. <if test="_parameter != null">
  225. <include refid="Example_Where_Clause" />
  226. </if>
  227. </select>
  228. <update id="updateByExampleSelective" parameterType="map">
  229. <!--
  230. WARNING - @mbg.generated
  231. This element is automatically generated by MyBatis Generator, do not modify.
  232. -->
  233. update windturbineinfoday2
  234. <set>
  235. <if test="record.id != null">
  236. ID = #{record.id,jdbcType=INTEGER},
  237. </if>
  238. <if test="record.windturbineid != null">
  239. WINDTURBINEID = #{record.windturbineid,jdbcType=VARCHAR},
  240. </if>
  241. <if test="record.recorddate != null">
  242. RECORDDATE = #{record.recorddate,jdbcType=DATE},
  243. </if>
  244. <if test="record.windpowerstationid != null">
  245. WINDPOWERSTATIONID = #{record.windpowerstationid,jdbcType=VARCHAR},
  246. </if>
  247. <if test="record.projectid != null">
  248. PROJECTID = #{record.projectid,jdbcType=VARCHAR},
  249. </if>
  250. <if test="record.lineid != null">
  251. LINEID = #{record.lineid,jdbcType=VARCHAR},
  252. </if>
  253. <if test="record.daycoefficient != null">
  254. DAYCOEFFICIENT = #{record.daycoefficient,jdbcType=DECIMAL},
  255. </if>
  256. <if test="record.monthcoefficient != null">
  257. MONTHCOEFFICIENT = #{record.monthcoefficient,jdbcType=DECIMAL},
  258. </if>
  259. <if test="record.yearcoefficient != null">
  260. YEARCOEFFICIENT = #{record.yearcoefficient,jdbcType=DECIMAL},
  261. </if>
  262. </set>
  263. <if test="_parameter != null">
  264. <include refid="Update_By_Example_Where_Clause" />
  265. </if>
  266. </update>
  267. <update id="updateByExample" parameterType="map">
  268. <!--
  269. WARNING - @mbg.generated
  270. This element is automatically generated by MyBatis Generator, do not modify.
  271. -->
  272. update windturbineinfoday2
  273. set ID = #{record.id,jdbcType=INTEGER},
  274. WINDTURBINEID = #{record.windturbineid,jdbcType=VARCHAR},
  275. RECORDDATE = #{record.recorddate,jdbcType=DATE},
  276. WINDPOWERSTATIONID = #{record.windpowerstationid,jdbcType=VARCHAR},
  277. PROJECTID = #{record.projectid,jdbcType=VARCHAR},
  278. LINEID = #{record.lineid,jdbcType=VARCHAR},
  279. DAYCOEFFICIENT = #{record.daycoefficient,jdbcType=DECIMAL},
  280. MONTHCOEFFICIENT = #{record.monthcoefficient,jdbcType=DECIMAL},
  281. YEARCOEFFICIENT = #{record.yearcoefficient,jdbcType=DECIMAL}
  282. <if test="_parameter != null">
  283. <include refid="Update_By_Example_Where_Clause" />
  284. </if>
  285. </update>
  286. <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.WindTurbineInfoDay2">
  287. <!--
  288. WARNING - @mbg.generated
  289. This element is automatically generated by MyBatis Generator, do not modify.
  290. -->
  291. update windturbineinfoday2
  292. <set>
  293. <if test="windturbineid != null">
  294. WINDTURBINEID = #{windturbineid,jdbcType=VARCHAR},
  295. </if>
  296. <if test="recorddate != null">
  297. RECORDDATE = #{recorddate,jdbcType=DATE},
  298. </if>
  299. <if test="windpowerstationid != null">
  300. WINDPOWERSTATIONID = #{windpowerstationid,jdbcType=VARCHAR},
  301. </if>
  302. <if test="projectid != null">
  303. PROJECTID = #{projectid,jdbcType=VARCHAR},
  304. </if>
  305. <if test="lineid != null">
  306. LINEID = #{lineid,jdbcType=VARCHAR},
  307. </if>
  308. <if test="daycoefficient != null">
  309. DAYCOEFFICIENT = #{daycoefficient,jdbcType=DECIMAL},
  310. </if>
  311. <if test="monthcoefficient != null">
  312. MONTHCOEFFICIENT = #{monthcoefficient,jdbcType=DECIMAL},
  313. </if>
  314. <if test="yearcoefficient != null">
  315. YEARCOEFFICIENT = #{yearcoefficient,jdbcType=DECIMAL},
  316. </if>
  317. </set>
  318. where ID = #{id,jdbcType=INTEGER}
  319. </update>
  320. <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.WindTurbineInfoDay2">
  321. <!--
  322. WARNING - @mbg.generated
  323. This element is automatically generated by MyBatis Generator, do not modify.
  324. -->
  325. update windturbineinfoday2
  326. set WINDTURBINEID = #{windturbineid,jdbcType=VARCHAR},
  327. RECORDDATE = #{recorddate,jdbcType=DATE},
  328. WINDPOWERSTATIONID = #{windpowerstationid,jdbcType=VARCHAR},
  329. PROJECTID = #{projectid,jdbcType=VARCHAR},
  330. LINEID = #{lineid,jdbcType=VARCHAR},
  331. DAYCOEFFICIENT = #{daycoefficient,jdbcType=DECIMAL},
  332. MONTHCOEFFICIENT = #{monthcoefficient,jdbcType=DECIMAL},
  333. YEARCOEFFICIENT = #{yearcoefficient,jdbcType=DECIMAL}
  334. where ID = #{id,jdbcType=INTEGER}
  335. </update>
  336. <select id="getWindTurbineInfoDay2" resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
  337. select WINDTURBINEID,avg(Monthcoefficient) glyzxxs
  338. from WindTurbineInfoDay2
  339. where Windpowerstationid = #{wpId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
  340. group by WINDTURBINEID ORDER BY WINDTURBINEID
  341. </select>
  342. <select id="getWindTurbineInfoDay2ByWtId" resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
  343. select WINDTURBINEID,avg(Monthcoefficient) glyzxxs
  344. from WindTurbineInfoDay2
  345. where WINDTURBINEID = #{wtId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
  346. ORDER BY Recorddate
  347. </select>
  348. </mapper>