TDeviceExperienceMapper.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.TDeviceExperienceMapper">
  6. <resultMap type="TDeviceExperience" id="TDeviceExperienceResult">
  7. <result property="id" column="id" />
  8. <result property="remarks" column="remarks" />
  9. <result property="delFlag" column="del_flag" />
  10. <result property="event" column="event" />
  11. <result property="handleProcess" column="handle_process" />
  12. <result property="handleResult" column="handle_result" />
  13. <result property="experience" column="experience" />
  14. <result property="accidentReportLink" column="accident_report_link" />
  15. <result property="expertEvaluation" column="expert_evaluation" />
  16. </resultMap>
  17. <sql id="selectTDeviceExperienceVo">
  18. select d.id, d.remarks, d.del_flag, d.event, d.handle_process, d.handle_result, d.experience, d.accident_report_link, d.expert_evaluation from t_device_experience d
  19. </sql>
  20. <select id="selectTDeviceExperienceList" parameterType="TDeviceExperience" resultMap="TDeviceExperienceResult">
  21. <include refid="selectTDeviceExperienceVo"/>
  22. <where>
  23. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  24. <if test="event != null and event != ''"> and event = #{event}</if>
  25. <if test="handleProcess != null and handleProcess != ''"> and handle_process = #{handleProcess}</if>
  26. <if test="handleResult != null and handleResult != ''"> and handle_result = #{handleResult}</if>
  27. <if test="experience != null and experience != ''"> and experience = #{experience}</if>
  28. <if test="accidentReportLink != null and accidentReportLink != ''"> and accident_report_link = #{accidentReportLink}</if>
  29. <if test="expertEvaluation != null and expertEvaluation != ''"> and expert_evaluation = #{expertEvaluation}</if>
  30. and d.del_flag = 0
  31. </where>
  32. <!-- 数据范围过滤 -->
  33. ${params.dataScope}
  34. </select>
  35. <select id="selectTDeviceExperienceById" parameterType="Long" resultMap="TDeviceExperienceResult">
  36. <include refid="selectTDeviceExperienceVo"/>
  37. where id = #{id}
  38. </select>
  39. <insert id="insertTDeviceExperience" parameterType="TDeviceExperience">
  40. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  41. SELECT seq_t_device_experience.NEXTVAL as id FROM DUAL
  42. </selectKey>
  43. insert into t_device_experience
  44. <trim prefix="(" suffix=")" suffixOverrides=",">
  45. <if test="id != null">id,</if>
  46. <if test="remarks != null">remarks,</if>
  47. <if test="delFlag != null">del_flag,</if>
  48. <if test="event != null">event,</if>
  49. <if test="handleProcess != null">handle_process,</if>
  50. <if test="handleResult != null">handle_result,</if>
  51. <if test="experience != null">experience,</if>
  52. <if test="accidentReportLink != null">accident_report_link,</if>
  53. <if test="expertEvaluation != null">expert_evaluation,</if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides=",">
  56. <if test="id != null">#{id},</if>
  57. <if test="remarks != null">#{remarks},</if>
  58. <if test="delFlag != null">#{delFlag},</if>
  59. <if test="event != null">#{event},</if>
  60. <if test="handleProcess != null">#{handleProcess},</if>
  61. <if test="handleResult != null">#{handleResult},</if>
  62. <if test="experience != null">#{experience},</if>
  63. <if test="accidentReportLink != null">#{accidentReportLink},</if>
  64. <if test="expertEvaluation != null">#{expertEvaluation},</if>
  65. </trim>
  66. </insert>
  67. <update id="updateTDeviceExperience" parameterType="TDeviceExperience">
  68. update t_device_experience
  69. <trim prefix="SET" suffixOverrides=",">
  70. <if test="remarks != null">remarks = #{remarks},</if>
  71. <if test="delFlag != null">del_flag = #{delFlag},</if>
  72. <if test="event != null">event = #{event},</if>
  73. <if test="handleProcess != null">handle_process = #{handleProcess},</if>
  74. <if test="handleResult != null">handle_result = #{handleResult},</if>
  75. <if test="experience != null">experience = #{experience},</if>
  76. <if test="accidentReportLink != null">accident_report_link = #{accidentReportLink},</if>
  77. <if test="expertEvaluation != null">expert_evaluation = #{expertEvaluation},</if>
  78. </trim>
  79. where id = #{id}
  80. </update>
  81. <update id="deleteTDeviceExperienceById" parameterType="Long">
  82. update t_device_experience set del_flag = 2 where id = #{id}
  83. </update>
  84. <update id="deleteTDeviceExperienceByIds" parameterType="String">
  85. update t_device_experience set del_flag = 2 where id in
  86. <foreach item="id" collection="array" open="(" separator="," close=")">
  87. #{id}
  88. </foreach>
  89. </update>
  90. </mapper>