MaintenanceTestControlMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.phm.manage.mapper.MaintenanceTestControlMapper">
  6. <resultMap type="MaintenanceTestControl" id="MaintenanceTestControlResult">
  7. <result property="id" column="id" />
  8. <result property="maintenanceControl" column="maintenance_control" />
  9. <result property="object" column="object" />
  10. <result property="name" column="name" />
  11. <result property="applicationDoc" column="application_doc" />
  12. <result property="faultData" column="fault_data" />
  13. <result property="version" column="version" />
  14. <result property="isDelete" column="is_delete" />
  15. <result property="createBy" column="create_by" />
  16. <result property="createTime" column="create_time" />
  17. <result property="updateBy" column="update_by" />
  18. <result property="updateTime" column="update_time" />
  19. </resultMap>
  20. <sql id="selectMaintenanceTestControlVo">
  21. select id, maintenance_control, object, name, application_doc, fault_data, version, is_delete, create_by, create_time, update_by, update_time from phm_maintenance_test_control
  22. </sql>
  23. <select id="selectMaintenanceTestControlList" parameterType="MaintenanceTestControl" resultMap="MaintenanceTestControlResult">
  24. <include refid="selectMaintenanceTestControlVo"/>
  25. <where>
  26. <if test="maintenanceControl != null and maintenanceControl != ''"> and maintenance_control = #{maintenanceControl}</if>
  27. <if test="object != null and object != ''"> and object = #{object}</if>
  28. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  29. <if test="applicationDoc != null and applicationDoc != ''"> and application_doc = #{applicationDoc}</if>
  30. <if test="faultData != null and faultData != ''"> and fault_data = #{faultData}</if>
  31. <if test="version != null and version != ''"> and version = #{version}</if>
  32. <if test="isDelete != null "> and is_delete = #{isDelete}</if>
  33. <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
  34. <if test="createTime != null "> and create_time = #{createTime}</if>
  35. <if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
  36. <if test="updateTime != null "> and update_time = #{updateTime}</if>
  37. </where>
  38. </select>
  39. <select id="selectMaintenanceTestControlById" parameterType="Long" resultMap="MaintenanceTestControlResult">
  40. <include refid="selectMaintenanceTestControlVo"/>
  41. where id = #{id}
  42. </select>
  43. <insert id="insertMaintenanceTestControl" parameterType="MaintenanceTestControl">
  44. insert into phm_maintenance_test_control
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="id != null">id,</if>
  47. <if test="maintenanceControl != null">maintenance_control,</if>
  48. <if test="object != null">object,</if>
  49. <if test="name != null">name,</if>
  50. <if test="applicationDoc != null">application_doc,</if>
  51. <if test="faultData != null">fault_data,</if>
  52. <if test="version != null">version,</if>
  53. <if test="isDelete != null">is_delete,</if>
  54. <if test="createBy != null">create_by,</if>
  55. <if test="createTime != null">create_time,</if>
  56. <if test="updateBy != null">update_by,</if>
  57. <if test="updateTime != null">update_time,</if>
  58. </trim>
  59. <trim prefix="values (" suffix=")" suffixOverrides=",">
  60. <if test="id != null">#{id},</if>
  61. <if test="maintenanceControl != null">#{maintenanceControl},</if>
  62. <if test="object != null">#{object},</if>
  63. <if test="name != null">#{name},</if>
  64. <if test="applicationDoc != null">#{applicationDoc},</if>
  65. <if test="faultData != null">#{faultData},</if>
  66. <if test="version != null">#{version},</if>
  67. <if test="isDelete != null">#{isDelete},</if>
  68. <if test="createBy != null">#{createBy},</if>
  69. <if test="createTime != null">#{createTime},</if>
  70. <if test="updateBy != null">#{updateBy},</if>
  71. <if test="updateTime != null">#{updateTime},</if>
  72. </trim>
  73. </insert>
  74. <update id="updateMaintenanceTestControl" parameterType="MaintenanceTestControl">
  75. update phm_maintenance_test_control
  76. <trim prefix="SET" suffixOverrides=",">
  77. <if test="maintenanceControl != null">maintenance_control = #{maintenanceControl},</if>
  78. <if test="object != null">object = #{object},</if>
  79. <if test="name != null">name = #{name},</if>
  80. <if test="applicationDoc != null">application_doc = #{applicationDoc},</if>
  81. <if test="faultData != null">fault_data = #{faultData},</if>
  82. <if test="version != null">version = #{version},</if>
  83. <if test="isDelete != null">is_delete = #{isDelete},</if>
  84. <if test="createBy != null">create_by = #{createBy},</if>
  85. <if test="createTime != null">create_time = #{createTime},</if>
  86. <if test="updateBy != null">update_by = #{updateBy},</if>
  87. <if test="updateTime != null">update_time = #{updateTime},</if>
  88. </trim>
  89. where id = #{id}
  90. </update>
  91. <delete id="deleteMaintenanceTestControlById" parameterType="Long">
  92. delete from phm_maintenance_test_control where id = #{id}
  93. </delete>
  94. <delete id="deleteMaintenanceTestControlByIds" parameterType="String">
  95. delete from phm_maintenance_test_control where id in
  96. <foreach item="id" collection="array" open="(" separator="," close=")">
  97. #{id}
  98. </foreach>
  99. </delete>
  100. </mapper>