WindExceptionCountMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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.energy.manage.service.mappers.windexceptioncount.WindExceptionCountMapper">
  4. <resultMap id="resultMap" type="com.energy.manage.common.po.windexceptioncount.WindExceptionCountPo">
  5. <id column="id" property="id" jdbcType="BIGINT"/>
  6. <result column="batch_code" property="batchCode" jdbcType="VARCHAR"/>
  7. <result column="engine_code" property="engineCode" jdbcType="VARCHAR"/>
  8. <result column="analysis_type_code" property="analysisTypeCode" jdbcType="VARCHAR"/>
  9. <result column="err_count" property="errCount" jdbcType="INTEGER"/>
  10. <result column="handle_err_count" property="handleErrCount" jdbcType="INTEGER"/>
  11. <result column="create_by" property="createBy" jdbcType="INTEGER"/>
  12. <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
  13. <result column="update_by" property="updateBy" jdbcType="INTEGER"/>
  14. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  15. </resultMap>
  16. <select id="selectByCondition" parameterType="com.energy.manage.service.domain.dto.windexceptioncount.WindExceptionCountDto" resultType="com.energy.manage.service.domain.vo.windexceptioncount.WindExceptionCountVo">
  17. SELECT
  18. count.id,
  19. count.batch_code,
  20. count.engine_code,
  21. type.type_name as analysis_type_name,
  22. count.analysis_type_code,
  23. count.err_count,
  24. count.handle_err_count,
  25. count.create_by,
  26. count.create_time,
  27. count.update_by,
  28. count.update_time
  29. FROM
  30. wind_exception_count count
  31. left join analysis_type type
  32. on count.analysis_type_code = type.type_code
  33. WHERE
  34. count.is_delete = 0
  35. and count.batch_code = #{batchCode}
  36. <if test="engineCode != null and engineCode != ''">
  37. AND count.engine_code = #{engineCode}
  38. </if>
  39. <if test="analysisTypeCode != null and analysisTypeCode != ''">
  40. AND count.analysis_type_code = #{analysisTypeCode}
  41. </if>
  42. </select>
  43. <insert id="insertPoSelective" parameterType="com.energy.manage.service.domain.dto.windexceptioncount.WindExceptionCountDto">
  44. insert into wind_exception_count
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="batchCode != null">
  47. batch_code,
  48. </if>
  49. <if test="engineCode != null">
  50. engine_code,
  51. </if>
  52. <if test="analysisTypeCode != null">
  53. analysis_type_code,
  54. </if>
  55. <if test="errCount != null">
  56. err_count,
  57. </if>
  58. <if test="handleErrCount!= null">
  59. handle_err_count,
  60. </if>
  61. <if test="createBy != null">
  62. create_by,
  63. </if>
  64. <if test="updateBy != null">
  65. update_by
  66. </if>
  67. </trim>
  68. <trim prefix="values (" suffix=")" suffixOverrides=",">
  69. <if test="batchCode != null">
  70. #{batchCode,jdbcType=VARCHAR},
  71. </if>
  72. <if test="engineCode != null">
  73. #{engineCode,jdbcType=VARCHAR},
  74. </if>
  75. <if test="analysisTypeCode != null">
  76. #{analysisTypeCode,jdbcType=VARCHAR},
  77. </if>
  78. <if test="errCount != null">
  79. #{errCount,jdbcType=INTEGER},
  80. </if>
  81. <if test="handleErrCount != null">
  82. #{handleErrCount,jdbcType=INTEGER},
  83. </if>
  84. <if test="createBy != null">
  85. #{createBy,jdbcType=INTEGER},
  86. </if>
  87. <if test="updateBy != null">
  88. #{updateBy,jdbcType=INTEGER}
  89. </if>
  90. </trim>
  91. </insert>
  92. <update id="updatePoSelecttive" parameterType="com.energy.manage.service.domain.dto.windexceptioncount.WindExceptionCountDto">
  93. update wind_exception_count
  94. <set>
  95. <if test="errCount != null">
  96. err_count = #{errCount,jdbcType=INTEGER},
  97. </if>
  98. <if test="handleErrCount != null">
  99. handle_err_count = #{handleErrCount,jdbcType=INTEGER},
  100. </if>
  101. <if test="isDelete != null">
  102. is_delete = #{isDelete,jdbcType=INTEGER},
  103. </if>
  104. <if test="updateBy != null">
  105. update_by = #{updateBy,jdbcType=INTEGER}
  106. </if>
  107. </set>
  108. where id = #{id,jdbcType=BIGINT}
  109. </update>
  110. </mapper>