TDeviceRiskMapper.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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.reliability.mapper.TDeviceRiskMapper">
  6. <resultMap type="TDeviceRisk" id="TDeviceRiskResult">
  7. <result property="id" column="id" />
  8. <result property="remarks" column="remarks" />
  9. <result property="delFlag" column="del_flag" />
  10. <result property="area" column="area" />
  11. <result property="diskLevel" column="disk_level" />
  12. <result property="reason" column="reason" />
  13. <result property="handleType" column="handle_type" />
  14. <result property="disk" column="disk" />
  15. <result property="discoveryDate" column="discovery_date" />
  16. <result property="planRemoveDate" column="plan_remove_date" />
  17. <result property="actualDate" column="actual_date" />
  18. <result property="handleMethods" column="handle_methods" />
  19. <result property="emergencyPlan" column="emergency_plan" />
  20. </resultMap>
  21. <sql id="selectTDeviceRiskVo">
  22. select d.id, d.remarks, d.del_flag, d.area, d.disk_level, d.reason, d.handle_type, d.disk, d.discovery_date, d.plan_remove_date, d.actual_date, d.handle_methods, d.emergency_plan from t_device_risk d
  23. </sql>
  24. <select id="selectTDeviceRiskList" parameterType="TDeviceRisk" resultMap="TDeviceRiskResult">
  25. <include refid="selectTDeviceRiskVo"/>
  26. <where>
  27. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  28. <if test="area != null and area != ''"> and area = #{area}</if>
  29. <if test="diskLevel != null "> and disk_level = #{diskLevel}</if>
  30. <if test="reason != null and reason != ''"> and reason = #{reason}</if>
  31. <if test="handleType != null "> and handle_type = #{handleType}</if>
  32. <if test="disk != null and disk != ''"> and disk = #{disk}</if>
  33. <if test="discoveryDate != null "> and discovery_date = #{discoveryDate}</if>
  34. <if test="planRemoveDate != null "> and plan_remove_date = #{planRemoveDate}</if>
  35. <if test="actualDate != null "> and actual_date = #{actualDate}</if>
  36. <if test="handleMethods != null and handleMethods != ''"> and handle_methods = #{handleMethods}</if>
  37. <if test="emergencyPlan != null and emergencyPlan != ''"> and emergency_plan = #{emergencyPlan}</if>
  38. and d.del_flag = 0
  39. </where>
  40. <!-- 数据范围过滤 -->
  41. ${params.dataScope}
  42. </select>
  43. <select id="selectTDeviceRiskById" parameterType="Long" resultMap="TDeviceRiskResult">
  44. <include refid="selectTDeviceRiskVo"/>
  45. where id = #{id}
  46. </select>
  47. <insert id="insertTDeviceRisk" parameterType="TDeviceRisk">
  48. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  49. SELECT seq_t_device_risk.NEXTVAL as id FROM DUAL
  50. </selectKey>
  51. insert into t_device_risk
  52. <trim prefix="(" suffix=")" suffixOverrides=",">
  53. <if test="id != null">id,</if>
  54. <if test="remarks != null">remarks,</if>
  55. <if test="delFlag != null">del_flag,</if>
  56. <if test="area != null">area,</if>
  57. <if test="diskLevel != null">disk_level,</if>
  58. <if test="reason != null">reason,</if>
  59. <if test="handleType != null">handle_type,</if>
  60. <if test="disk != null">disk,</if>
  61. <if test="discoveryDate != null">discovery_date,</if>
  62. <if test="planRemoveDate != null">plan_remove_date,</if>
  63. <if test="actualDate != null">actual_date,</if>
  64. <if test="handleMethods != null">handle_methods,</if>
  65. <if test="emergencyPlan != null">emergency_plan,</if>
  66. </trim>
  67. <trim prefix="values (" suffix=")" suffixOverrides=",">
  68. <if test="id != null">#{id},</if>
  69. <if test="remarks != null">#{remarks},</if>
  70. <if test="delFlag != null">#{delFlag},</if>
  71. <if test="area != null">#{area},</if>
  72. <if test="diskLevel != null">#{diskLevel},</if>
  73. <if test="reason != null">#{reason},</if>
  74. <if test="handleType != null">#{handleType},</if>
  75. <if test="disk != null">#{disk},</if>
  76. <if test="discoveryDate != null">#{discoveryDate},</if>
  77. <if test="planRemoveDate != null">#{planRemoveDate},</if>
  78. <if test="actualDate != null">#{actualDate},</if>
  79. <if test="handleMethods != null">#{handleMethods},</if>
  80. <if test="emergencyPlan != null">#{emergencyPlan},</if>
  81. </trim>
  82. </insert>
  83. <update id="updateTDeviceRisk" parameterType="TDeviceRisk">
  84. update t_device_risk
  85. <trim prefix="SET" suffixOverrides=",">
  86. <if test="remarks != null">remarks = #{remarks},</if>
  87. <if test="delFlag != null">del_flag = #{delFlag},</if>
  88. <if test="area != null">area = #{area},</if>
  89. <if test="diskLevel != null">disk_level = #{diskLevel},</if>
  90. <if test="reason != null">reason = #{reason},</if>
  91. <if test="handleType != null">handle_type = #{handleType},</if>
  92. <if test="disk != null">disk = #{disk},</if>
  93. <if test="discoveryDate != null">discovery_date = #{discoveryDate},</if>
  94. <if test="planRemoveDate != null">plan_remove_date = #{planRemoveDate},</if>
  95. <if test="actualDate != null">actual_date = #{actualDate},</if>
  96. <if test="handleMethods != null">handle_methods = #{handleMethods},</if>
  97. <if test="emergencyPlan != null">emergency_plan = #{emergencyPlan},</if>
  98. </trim>
  99. where id = #{id}
  100. </update>
  101. <update id="deleteTDeviceRiskById" parameterType="Long">
  102. update t_device_risk set del_flag = 2 where id = #{id}
  103. </update>
  104. <update id="deleteTDeviceRiskByIds" parameterType="String">
  105. update t_device_risk set del_flag = 2 where id in
  106. <foreach item="id" collection="array" open="(" separator="," close=")">
  107. #{id}
  108. </foreach>
  109. </update>
  110. </mapper>