TDashboarddayelecMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.project.aspen.mapper.TDashboarddayelecMapper">
  6. <resultMap type="TDashboarddayelec" id="TDashboarddayelecResult">
  7. <result property="id" column="id" />
  8. <result property="delFlag" column="del_flag" />
  9. <result property="createrCode" column="creater_code" />
  10. <result property="createdate" column="createdate" />
  11. <result property="updaterCode" column="updater_code" />
  12. <result property="updatedate" column="updatedate" />
  13. <result property="gtg1Lv" column="gtg1_lv" />
  14. <result property="gtg1Wr" column="gtg1_wr" />
  15. <result property="gtg2Lv" column="gtg2_lv" />
  16. <result property="gtg2Wr" column="gtg2_wr" />
  17. <result property="gtg3Lv" column="gtg3_lv" />
  18. <result property="gtg3Wr" column="gtg3_wr" />
  19. <result property="stg1Lv" column="stg1_lv" />
  20. <result property="stg1Wr" column="stg1_wr" />
  21. <result property="mwhLv" column="mwh_lv" />
  22. <result property="mwhWr" column="mwh_wr" />
  23. <result property="hhp" column="hhp" />
  24. <result property="hp" column="hp" />
  25. <result property="lp" column="lp" />
  26. <result property="mp" column="mp" />
  27. <result property="totalConsumption" column="total_consumption" />
  28. <result property="hhpNum" column="hhp_num" />
  29. <result property="hhpTemp" column="hhp_temp" />
  30. <result property="hpNum" column="hp_num" />
  31. <result property="hpTemp" column="hp_temp" />
  32. <result property="lpNum" column="lp_num" />
  33. <result property="lpTemp" column="lp_temp" />
  34. <result property="mpNum" column="mp_num" />
  35. <result property="mpTemp" column="mp_temp" />
  36. <result property="shihua" column="shihua" />
  37. <result property="shiyou" column="shiyou" />
  38. <result property="shunshiliang" column="shunshiliang" />
  39. <result property="ypg" column="ypg" />
  40. <result property="daodianliang" column="daodianliang" />
  41. <result property="eveLec" column="eve_lec" />
  42. <result property="fenggucha" column="fenggucha" />
  43. <result property="bycElec" column="byc_elec" />
  44. <result property="bocElec" column="boc_elec" />
  45. <result property="dataDate" column="data_date" />
  46. <result property="dateDay" column="date_day" />
  47. <result property="deptName" column="dept_name" />
  48. </resultMap>
  49. <sql id="selectTDashboarddayelecVo">
  50. <!-- 王子文 2022年4月15日 修改 -->
  51. <!-- select d.id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.gtg1_lv, d.gtg1_wr, d.gtg2_lv, d.gtg2_wr, d.gtg3_lv, d.gtg3_wr, d.stg1_lv, d.stg1_wr, d.mwh_lv, d.mwh_wr, d.hhp, d.hp, d.lp, d.mp, d.total_consumption, d.hhp_num, d.hhp_temp, d.hp_num, d.hp_temp, d.lp_num, d.lp_temp, d.mp_num, d.mp_temp, d.shihua, d.shiyou, d.shunshiliang, d.ypg, d.daodianliang, d.eve_lec, d.fenggucha, d.byc_elec, d.boc_elec, d.data_date, d.date_day ,s.dept_name from t_dashboarddayelec d left join sys_dept s on s.dept_id = d.dept_id -->
  52. select
  53. id,
  54. del_flag,
  55. creater_code,
  56. createdate,
  57. updater_code,
  58. updatedate,
  59. gtg1_lv,
  60. gtg1_wr,
  61. gtg2_lv,
  62. gtg2_wr,
  63. gtg3_lv,
  64. gtg3_wr,
  65. stg1_lv,
  66. stg1_wr,
  67. mwh_lv,
  68. mwh_wr,
  69. hhp,
  70. hp,
  71. lp,
  72. mp,
  73. total_consumption,
  74. hhp_num,
  75. hhp_temp,
  76. hp_num,
  77. hp_temp,
  78. lp_num,
  79. lp_temp,
  80. mp_num,
  81. mp_temp,
  82. shihua,
  83. shiyou,
  84. shunshiliang,
  85. ypg,
  86. daodianliang,
  87. eve_lec,
  88. fenggucha,
  89. byc_elec,
  90. boc_elec,
  91. data_date,
  92. date_day
  93. from
  94. t_dashboarddayelec
  95. </sql>
  96. <select id="selectTDashboarddayelecList" parameterType="TDashboarddayelec" resultMap="TDashboarddayelecResult">
  97. <include refid="selectTDashboarddayelecVo"/>
  98. <where>
  99. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  100. <if test="createdate != null "> and createdate = #{createdate}</if>
  101. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  102. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  103. <if test="gtg1Lv != null and gtg1Lv != ''"> and gtg1_lv = #{gtg1Lv}</if>
  104. <if test="gtg1Wr != null and gtg1Wr != ''"> and gtg1_wr = #{gtg1Wr}</if>
  105. <if test="gtg2Lv != null and gtg2Lv != ''"> and gtg2_lv = #{gtg2Lv}</if>
  106. <if test="gtg2Wr != null and gtg2Wr != ''"> and gtg2_wr = #{gtg2Wr}</if>
  107. <if test="gtg3Lv != null and gtg3Lv != ''"> and gtg3_lv = #{gtg3Lv}</if>
  108. <if test="gtg3Wr != null and gtg3Wr != ''"> and gtg3_wr = #{gtg3Wr}</if>
  109. <if test="stg1Lv != null and stg1Lv != ''"> and stg1_lv = #{stg1Lv}</if>
  110. <if test="stg1Wr != null and stg1Wr != ''"> and stg1_wr = #{stg1Wr}</if>
  111. <if test="mwhLv != null and mwhLv != ''"> and mwh_lv = #{mwhLv}</if>
  112. <if test="mwhWr != null and mwhWr != ''"> and mwh_wr = #{mwhWr}</if>
  113. <if test="hhp != null and hhp != ''"> and hhp = #{hhp}</if>
  114. <if test="hp != null and hp != ''"> and hp = #{hp}</if>
  115. <if test="lp != null and lp != ''"> and lp = #{lp}</if>
  116. <if test="mp != null and mp != ''"> and mp = #{mp}</if>
  117. <if test="totalConsumption != null and totalConsumption != ''"> and total_consumption = #{totalConsumption}</if>
  118. <if test="hhpNum != null "> and hhp_num = #{hhpNum}</if>
  119. <if test="hhpTemp != null and hhpTemp != ''"> and hhp_temp = #{hhpTemp}</if>
  120. <if test="hpNum != null and hpNum != ''"> and hp_num = #{hpNum}</if>
  121. <if test="hpTemp != null and hpTemp != ''"> and hp_temp = #{hpTemp}</if>
  122. <if test="lpNum != null "> and lp_num = #{lpNum}</if>
  123. <if test="lpTemp != null and lpTemp != ''"> and lp_temp = #{lpTemp}</if>
  124. <if test="mpNum != null "> and mp_num = #{mpNum}</if>
  125. <if test="mpTemp != null and mpTemp != ''"> and mp_temp = #{mpTemp}</if>
  126. <if test="shihua != null and shihua != ''"> and shihua = #{shihua}</if>
  127. <if test="shiyou != null and shiyou != ''"> and shiyou = #{shiyou}</if>
  128. <if test="shunshiliang != null and shunshiliang != ''"> and shunshiliang = #{shunshiliang}</if>
  129. <if test="ypg != null and ypg != ''"> and ypg = #{ypg}</if>
  130. <if test="daodianliang != null and daodianliang != ''"> and daodianliang = #{daodianliang}</if>
  131. <if test="eveLec != null and eveLec != ''"> and eve_lec = #{eveLec}</if>
  132. <if test="fenggucha != null and fenggucha != ''"> and fenggucha = #{fenggucha}</if>
  133. <if test="bycElec != null and bycElec != ''"> and byc_elec = #{bycElec}</if>
  134. <if test="bocElec != null and bocElec != ''"> and boc_elec = #{bocElec}</if>
  135. <if test="dataDate != null "> and data_date = #{dataDate}</if>
  136. <if test="dateDay != null and dateDay != ''"> and date_day = #{dateDay}</if>
  137. <!-- 王子文 2022年4月15日 修改 -->
  138. <!-- and d.del_flag = 0 -->
  139. and del_flag = 0
  140. </where>
  141. <!-- 数据范围过滤 -->
  142. ${params.dataScope}
  143. </select>
  144. <select id="selectTDashboarddayelecById" parameterType="Long" resultMap="TDashboarddayelecResult">
  145. <include refid="selectTDashboarddayelecVo"/>
  146. where id = #{id}
  147. </select>
  148. <insert id="insertTDashboarddayelec" parameterType="TDashboarddayelec">
  149. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  150. SELECT seq_t_dashboarddayelec.NEXTVAL as id FROM DUAL
  151. </selectKey>
  152. insert into t_dashboarddayelec
  153. <trim prefix="(" suffix=")" suffixOverrides=",">
  154. <if test="id != null">id,</if>
  155. <if test="delFlag != null">del_flag,</if>
  156. <if test="createrCode != null">creater_code,</if>
  157. <if test="createdate != null">createdate,</if>
  158. <if test="updaterCode != null">updater_code,</if>
  159. <if test="updatedate != null">updatedate,</if>
  160. <if test="gtg1Lv != null">gtg1_lv,</if>
  161. <if test="gtg1Wr != null">gtg1_wr,</if>
  162. <if test="gtg2Lv != null">gtg2_lv,</if>
  163. <if test="gtg2Wr != null">gtg2_wr,</if>
  164. <if test="gtg3Lv != null">gtg3_lv,</if>
  165. <if test="gtg3Wr != null">gtg3_wr,</if>
  166. <if test="stg1Lv != null">stg1_lv,</if>
  167. <if test="stg1Wr != null">stg1_wr,</if>
  168. <if test="mwhLv != null">mwh_lv,</if>
  169. <if test="mwhWr != null">mwh_wr,</if>
  170. <if test="hhp != null">hhp,</if>
  171. <if test="hp != null">hp,</if>
  172. <if test="lp != null">lp,</if>
  173. <if test="mp != null">mp,</if>
  174. <if test="totalConsumption != null">total_consumption,</if>
  175. <if test="hhpNum != null">hhp_num,</if>
  176. <if test="hhpTemp != null">hhp_temp,</if>
  177. <if test="hpNum != null">hp_num,</if>
  178. <if test="hpTemp != null">hp_temp,</if>
  179. <if test="lpNum != null">lp_num,</if>
  180. <if test="lpTemp != null">lp_temp,</if>
  181. <if test="mpNum != null">mp_num,</if>
  182. <if test="mpTemp != null">mp_temp,</if>
  183. <if test="shihua != null">shihua,</if>
  184. <if test="shiyou != null">shiyou,</if>
  185. <if test="shunshiliang != null">shunshiliang,</if>
  186. <if test="ypg != null">ypg,</if>
  187. <if test="daodianliang != null">daodianliang,</if>
  188. <if test="eveLec != null">eve_lec,</if>
  189. <if test="fenggucha != null">fenggucha,</if>
  190. <if test="bycElec != null">byc_elec,</if>
  191. <if test="bocElec != null">boc_elec,</if>
  192. <if test="dataDate != null">data_date,</if>
  193. <if test="dateDay != null">date_day,</if>
  194. </trim>
  195. <trim prefix="values (" suffix=")" suffixOverrides=",">
  196. <if test="id != null">#{id},</if>
  197. <if test="delFlag != null">#{delFlag},</if>
  198. <if test="createrCode != null">#{createrCode},</if>
  199. <if test="createdate != null">#{createdate},</if>
  200. <if test="updaterCode != null">#{updaterCode},</if>
  201. <if test="updatedate != null">#{updatedate},</if>
  202. <if test="gtg1Lv != null">#{gtg1Lv},</if>
  203. <if test="gtg1Wr != null">#{gtg1Wr},</if>
  204. <if test="gtg2Lv != null">#{gtg2Lv},</if>
  205. <if test="gtg2Wr != null">#{gtg2Wr},</if>
  206. <if test="gtg3Lv != null">#{gtg3Lv},</if>
  207. <if test="gtg3Wr != null">#{gtg3Wr},</if>
  208. <if test="stg1Lv != null">#{stg1Lv},</if>
  209. <if test="stg1Wr != null">#{stg1Wr},</if>
  210. <if test="mwhLv != null">#{mwhLv},</if>
  211. <if test="mwhWr != null">#{mwhWr},</if>
  212. <if test="hhp != null">#{hhp},</if>
  213. <if test="hp != null">#{hp},</if>
  214. <if test="lp != null">#{lp},</if>
  215. <if test="mp != null">#{mp},</if>
  216. <if test="totalConsumption != null">#{totalConsumption},</if>
  217. <if test="hhpNum != null">#{hhpNum},</if>
  218. <if test="hhpTemp != null">#{hhpTemp},</if>
  219. <if test="hpNum != null">#{hpNum},</if>
  220. <if test="hpTemp != null">#{hpTemp},</if>
  221. <if test="lpNum != null">#{lpNum},</if>
  222. <if test="lpTemp != null">#{lpTemp},</if>
  223. <if test="mpNum != null">#{mpNum},</if>
  224. <if test="mpTemp != null">#{mpTemp},</if>
  225. <if test="shihua != null">#{shihua},</if>
  226. <if test="shiyou != null">#{shiyou},</if>
  227. <if test="shunshiliang != null">#{shunshiliang},</if>
  228. <if test="ypg != null">#{ypg},</if>
  229. <if test="daodianliang != null">#{daodianliang},</if>
  230. <if test="eveLec != null">#{eveLec},</if>
  231. <if test="fenggucha != null">#{fenggucha},</if>
  232. <if test="bycElec != null">#{bycElec},</if>
  233. <if test="bocElec != null">#{bocElec},</if>
  234. <if test="dataDate != null">#{dataDate},</if>
  235. <if test="dateDay != null">#{dateDay},</if>
  236. </trim>
  237. </insert>
  238. <update id="updateTDashboarddayelec" parameterType="TDashboarddayelec">
  239. update t_dashboarddayelec
  240. <trim prefix="SET" suffixOverrides=",">
  241. <if test="delFlag != null">del_flag = #{delFlag},</if>
  242. <if test="createrCode != null">creater_code = #{createrCode},</if>
  243. <if test="createdate != null">createdate = #{createdate},</if>
  244. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  245. <if test="updatedate != null">updatedate = #{updatedate},</if>
  246. <if test="gtg1Lv != null">gtg1_lv = #{gtg1Lv},</if>
  247. <if test="gtg1Wr != null">gtg1_wr = #{gtg1Wr},</if>
  248. <if test="gtg2Lv != null">gtg2_lv = #{gtg2Lv},</if>
  249. <if test="gtg2Wr != null">gtg2_wr = #{gtg2Wr},</if>
  250. <if test="gtg3Lv != null">gtg3_lv = #{gtg3Lv},</if>
  251. <if test="gtg3Wr != null">gtg3_wr = #{gtg3Wr},</if>
  252. <if test="stg1Lv != null">stg1_lv = #{stg1Lv},</if>
  253. <if test="stg1Wr != null">stg1_wr = #{stg1Wr},</if>
  254. <if test="mwhLv != null">mwh_lv = #{mwhLv},</if>
  255. <if test="mwhWr != null">mwh_wr = #{mwhWr},</if>
  256. <if test="hhp != null">hhp = #{hhp},</if>
  257. <if test="hp != null">hp = #{hp},</if>
  258. <if test="lp != null">lp = #{lp},</if>
  259. <if test="mp != null">mp = #{mp},</if>
  260. <if test="totalConsumption != null">total_consumption = #{totalConsumption},</if>
  261. <if test="hhpNum != null">hhp_num = #{hhpNum},</if>
  262. <if test="hhpTemp != null">hhp_temp = #{hhpTemp},</if>
  263. <if test="hpNum != null">hp_num = #{hpNum},</if>
  264. <if test="hpTemp != null">hp_temp = #{hpTemp},</if>
  265. <if test="lpNum != null">lp_num = #{lpNum},</if>
  266. <if test="lpTemp != null">lp_temp = #{lpTemp},</if>
  267. <if test="mpNum != null">mp_num = #{mpNum},</if>
  268. <if test="mpTemp != null">mp_temp = #{mpTemp},</if>
  269. <if test="shihua != null">shihua = #{shihua},</if>
  270. <if test="shiyou != null">shiyou = #{shiyou},</if>
  271. <if test="shunshiliang != null">shunshiliang = #{shunshiliang},</if>
  272. <if test="ypg != null">ypg = #{ypg},</if>
  273. <if test="daodianliang != null">daodianliang = #{daodianliang},</if>
  274. <if test="eveLec != null">eve_lec = #{eveLec},</if>
  275. <if test="fenggucha != null">fenggucha = #{fenggucha},</if>
  276. <if test="bycElec != null">byc_elec = #{bycElec},</if>
  277. <if test="bocElec != null">boc_elec = #{bocElec},</if>
  278. <if test="dataDate != null">data_date = #{dataDate},</if>
  279. <if test="dateDay != null">date_day = #{dateDay},</if>
  280. </trim>
  281. where id = #{id}
  282. </update>
  283. <update id="deleteTDashboarddayelecById" parameterType="Long">
  284. update t_dashboarddayelec set del_flag = 2 where id = #{id}
  285. </update>
  286. <update id="deleteTDashboarddayelecByIds" parameterType="String">
  287. update t_dashboarddayelec set del_flag = 2 where id in
  288. <foreach item="id" collection="array" open="(" separator="," close=")">
  289. #{id}
  290. </foreach>
  291. </update>
  292. <select id="selectLast" parameterType="TDashboarddayelec" resultMap="TDashboarddayelecResult">
  293. select * from ( select * from t_dashboarddayelec where del_flag = 0 order by id desc ) WHERE ROWNUM = 1
  294. </select>
  295. <select id="selectMonth" parameterType="TDashboarddayelec" resultMap="TDashboarddayelecResult">
  296. select * from ( select * from t_dashboarddayelec where del_flag = 0 order by id asc ) WHERE 32 > ROWNUM
  297. </select>
  298. <select id="selectWeek" parameterType="TDashboarddayelec" resultMap="TDashboarddayelecResult">
  299. select * from ( select * from t_dashboarddayelec where del_flag = 0 order by id asc ) WHERE 8 > ROWNUM
  300. </select>
  301. <select id="selecctfiftyday" parameterType="TDashboarddayelec" resultMap="TDashboarddayelecResult">
  302. select * from ( select * from t_dashboarddayelec where del_flag = 0 order by id asc ) WHERE 50 > ROWNUM
  303. </select>
  304. </mapper>