TDashboarddayeleceightMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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.TDashboarddayeleceightMapper">
  6. <resultMap type="TDashboarddayeleceight" id="TDashboarddayeleceightResult">
  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="evconsume" column="evconsume" />
  14. <result property="elecp" column="elecp" />
  15. <result property="hechengqi" column="hechengqi" />
  16. <result property="u2" column="u2" />
  17. <result property="dataDate" column="data_date" />
  18. <result property="dateDay" column="date_day" />
  19. <result property="deptName" column="dept_name" />
  20. </resultMap>
  21. <sql id="selectTDashboarddayeleceightVo">
  22. select d.id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.evconsume, d.elecp, d.hechengqi, d.u2, d.data_date, d.date_day ,s.dept_name from t_dashboarddayeleceight d
  23. left join sys_dept s on s.dept_id = d.dept_id
  24. </sql>
  25. <select id="selectTDashboarddayeleceightList" parameterType="TDashboarddayeleceight" resultMap="TDashboarddayeleceightResult">
  26. <include refid="selectTDashboarddayeleceightVo"/>
  27. <where>
  28. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  29. <if test="createdate != null "> and createdate = #{createdate}</if>
  30. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  31. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  32. <if test="evconsume != null and evconsume != ''"> and evconsume = #{evconsume}</if>
  33. <if test="elecp != null and elecp != ''"> and elecp = #{elecp}</if>
  34. <if test="hechengqi != null and hechengqi != ''"> and hechengqi = #{hechengqi}</if>
  35. <if test="u2 != null and u2 != ''"> and u2 = #{u2}</if>
  36. <if test="dataDate != null "> and data_date = #{dataDate}</if>
  37. <if test="dateDay != null and dateDay != ''"> and date_day = #{dateDay}</if>
  38. and d.del_flag = 0
  39. </where>
  40. <!-- 数据范围过滤 -->
  41. ${params.dataScope}
  42. </select>
  43. <select id="selectTDashboarddayeleceightById" parameterType="Long" resultMap="TDashboarddayeleceightResult">
  44. <include refid="selectTDashboarddayeleceightVo"/>
  45. where id = #{id}
  46. </select>
  47. <insert id="insertTDashboarddayeleceight" parameterType="TDashboarddayeleceight">
  48. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  49. SELECT seq_t_dashboarddayeleceight.NEXTVAL as id FROM DUAL
  50. </selectKey>
  51. insert into t_dashboarddayeleceight
  52. <trim prefix="(" suffix=")" suffixOverrides=",">
  53. <if test="id != null">id,</if>
  54. <if test="delFlag != null">del_flag,</if>
  55. <if test="createrCode != null">creater_code,</if>
  56. <if test="createdate != null">createdate,</if>
  57. <if test="updaterCode != null">updater_code,</if>
  58. <if test="updatedate != null">updatedate,</if>
  59. <if test="evconsume != null">evconsume,</if>
  60. <if test="elecp != null">elecp,</if>
  61. <if test="hechengqi != null">hechengqi,</if>
  62. <if test="u2 != null">u2,</if>
  63. <if test="dataDate != null">data_date,</if>
  64. <if test="dateDay != null">date_day,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="id != null">#{id},</if>
  68. <if test="delFlag != null">#{delFlag},</if>
  69. <if test="createrCode != null">#{createrCode},</if>
  70. <if test="createdate != null">#{createdate},</if>
  71. <if test="updaterCode != null">#{updaterCode},</if>
  72. <if test="updatedate != null">#{updatedate},</if>
  73. <if test="evconsume != null">#{evconsume},</if>
  74. <if test="elecp != null">#{elecp},</if>
  75. <if test="hechengqi != null">#{hechengqi},</if>
  76. <if test="u2 != null">#{u2},</if>
  77. <if test="dataDate != null">#{dataDate},</if>
  78. <if test="dateDay != null">#{dateDay},</if>
  79. </trim>
  80. </insert>
  81. <update id="updateTDashboarddayeleceight" parameterType="TDashboarddayeleceight">
  82. update t_dashboarddayeleceight
  83. <trim prefix="SET" suffixOverrides=",">
  84. <if test="delFlag != null">del_flag = #{delFlag},</if>
  85. <if test="createrCode != null">creater_code = #{createrCode},</if>
  86. <if test="createdate != null">createdate = #{createdate},</if>
  87. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  88. <if test="updatedate != null">updatedate = #{updatedate},</if>
  89. <if test="evconsume != null">evconsume = #{evconsume},</if>
  90. <if test="elecp != null">elecp = #{elecp},</if>
  91. <if test="hechengqi != null">hechengqi = #{hechengqi},</if>
  92. <if test="u2 != null">u2 = #{u2},</if>
  93. <if test="dataDate != null">data_date = #{dataDate},</if>
  94. <if test="dateDay != null">date_day = #{dateDay},</if>
  95. </trim>
  96. where id = #{id}
  97. </update>
  98. <update id="deleteTDashboarddayeleceightById" parameterType="Long">
  99. update t_dashboarddayeleceight set del_flag = 2 where id = #{id}
  100. </update>
  101. <update id="deleteTDashboarddayeleceightByIds" parameterType="String">
  102. update t_dashboarddayeleceight set del_flag = 2 where id in
  103. <foreach item="id" collection="array" open="(" separator="," close=")">
  104. #{id}
  105. </foreach>
  106. </update>
  107. <select id="selectWeek" parameterType="TDashboarddayeleceight" resultMap="TDashboarddayeleceightResult">
  108. select * from ( select * from t_dashboarddayeleceight where del_flag = 0 order by id asc ) WHERE 8 > ROWNUM
  109. </select>
  110. </mapper>