InspectionResultMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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.bz.smart_city.dao.InspectionResultMapper">
  4. <!--auto generated Code-->
  5. <resultMap id="BaseResultMap" type="com.bz.smart_city.entity.InspectionResult">
  6. <result column="id" property="id" jdbcType="INTEGER"/>
  7. <result column="site_id" property="siteId" jdbcType="INTEGER"/>
  8. <result column="instance_id" property="instanceId" jdbcType="INTEGER"/>
  9. <result column="plan_id" property="planId" jdbcType="INTEGER"/>
  10. <result column="object_id" property="objectId" jdbcType="INTEGER"/>
  11. <result column="index_id" property="indexId" jdbcType="INTEGER"/>
  12. <result column="index_value" property="indexValue" jdbcType="VARCHAR"/>
  13. <result column="status" property="status" jdbcType="INTEGER"/>
  14. <result column="date_create" property="dateCreate" jdbcType="TIMESTAMP"/>
  15. <result column="date_update" property="dateUpdate" jdbcType="TIMESTAMP"/>
  16. <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
  17. <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
  18. <result column="object_result_id" property="objectResultId" jdbcType="INTEGER"/>
  19. <result column="index_name" property="indexName" jdbcType="VARCHAR"/>
  20. <result column="index_type" property="indexType" jdbcType="INTEGER"/>
  21. <result column="index_definition_value" property="indexDefinitionValue" jdbcType="VARCHAR"/>
  22. </resultMap>
  23. <!--auto generated Code-->
  24. <sql id="Base_Column_List">
  25. id,
  26. site_id,
  27. instance_id,
  28. plan_id,
  29. object_id,
  30. index_id,
  31. index_value,
  32. status,
  33. date_create,
  34. date_update,
  35. create_by,
  36. update_by,
  37. object_result_id,
  38. index_name,
  39. index_type,
  40. index_definition_value
  41. </sql>
  42. <!--auto generated Code-->
  43. <insert id="insert" useGeneratedKeys="true" keyProperty="inspectionResult.id">
  44. INSERT INTO sc_inspection_result (
  45. id,
  46. site_id,
  47. instance_id,
  48. plan_id,
  49. object_id,
  50. index_id,
  51. index_value,
  52. status,
  53. date_create,
  54. date_update,
  55. create_by,
  56. update_by,
  57. object_result_id,
  58. index_name,
  59. index_type,
  60. index_definition_value
  61. ) VALUES (
  62. #{inspectionResult.id,jdbcType=INTEGER},
  63. #{inspectionResult.siteId,jdbcType=INTEGER},
  64. #{inspectionResult.instanceId,jdbcType=INTEGER},
  65. #{inspectionResult.planId,jdbcType=INTEGER},
  66. #{inspectionResult.objectId,jdbcType=INTEGER},
  67. #{inspectionResult.indexId,jdbcType=INTEGER},
  68. #{inspectionResult.indexValue,jdbcType=VARCHAR},
  69. #{inspectionResult.status,jdbcType=INTEGER},
  70. #{inspectionResult.dateCreate,jdbcType=TIMESTAMP},
  71. #{inspectionResult.dateUpdate,jdbcType=TIMESTAMP},
  72. #{inspectionResult.createBy,jdbcType=VARCHAR},
  73. #{inspectionResult.updateBy,jdbcType=VARCHAR},
  74. #{inspectionResult.objectResultId,jdbcType=INTEGER},
  75. #{inspectionResult.indexName,jdbcType=VARCHAR},
  76. #{inspectionResult.indexType,jdbcType=INTEGER},
  77. #{inspectionResult.indexDefinitionValue,jdbcType=VARCHAR}
  78. )
  79. </insert>
  80. <!--auto generated Code-->
  81. <insert id="insertSelective" useGeneratedKeys="true" keyProperty="inspectionResult.id">
  82. INSERT INTO sc_inspection_result
  83. <trim prefix="(" suffix=")" suffixOverrides=",">
  84. <if test="inspectionResult.id!=null"> id,</if>
  85. <if test="inspectionResult.siteId!=null"> site_id,</if>
  86. <if test="inspectionResult.instanceId!=null"> instance_id,</if>
  87. <if test="inspectionResult.planId!=null"> plan_id,</if>
  88. <if test="inspectionResult.objectId!=null"> object_id,</if>
  89. <if test="inspectionResult.indexId!=null"> index_id,</if>
  90. <if test="inspectionResult.indexValue!=null"> index_value,</if>
  91. <if test="inspectionResult.status!=null"> status,</if>
  92. <if test="inspectionResult.dateCreate!=null"> date_create,</if>
  93. <if test="inspectionResult.dateUpdate!=null"> date_update,</if>
  94. <if test="inspectionResult.createBy!=null"> create_by,</if>
  95. <if test="inspectionResult.updateBy!=null"> update_by,</if>
  96. <if test="inspectionResult.objectResultId!=null"> object_result_id,</if>
  97. <if test="inspectionResult.indexName!=null"> index_name,</if>
  98. <if test="inspectionResult.indexType!=null"> index_type,</if>
  99. <if test="inspectionResult.indexDefinitionValue!=null"> index_definition_value</if>
  100. </trim>
  101. VALUES
  102. <trim prefix="(" suffix=")" suffixOverrides=",">
  103. <if test="inspectionResult.id!=null"> #{inspectionResult.id,jdbcType=INTEGER},</if>
  104. <if test="inspectionResult.siteId!=null"> #{inspectionResult.siteId,jdbcType=INTEGER},</if>
  105. <if test="inspectionResult.instanceId!=null"> #{inspectionResult.instanceId,jdbcType=INTEGER},</if>
  106. <if test="inspectionResult.planId!=null"> #{inspectionResult.planId,jdbcType=INTEGER},</if>
  107. <if test="inspectionResult.objectId!=null"> #{inspectionResult.objectId,jdbcType=INTEGER},</if>
  108. <if test="inspectionResult.indexId!=null"> #{inspectionResult.indexId,jdbcType=INTEGER},</if>
  109. <if test="inspectionResult.indexValue!=null"> #{inspectionResult.indexValue,jdbcType=VARCHAR},</if>
  110. <if test="inspectionResult.status!=null"> #{inspectionResult.status,jdbcType=INTEGER},</if>
  111. <if test="inspectionResult.dateCreate!=null"> #{inspectionResult.dateCreate,jdbcType=TIMESTAMP},</if>
  112. <if test="inspectionResult.dateUpdate!=null"> #{inspectionResult.dateUpdate,jdbcType=TIMESTAMP},</if>
  113. <if test="inspectionResult.createBy!=null"> #{inspectionResult.createBy,jdbcType=VARCHAR},</if>
  114. <if test="inspectionResult.updateBy!=null"> #{inspectionResult.updateBy,jdbcType=VARCHAR},</if>
  115. <if test="inspectionResult.objectResultId!=null"> #{inspectionResult.objectResultId,jdbcType=INTEGER},</if>
  116. <if test="inspectionResult.indexName!=null"> #{inspectionResult.indexName,jdbcType=VARCHAR},</if>
  117. <if test="inspectionResult.indexType!=null"> #{inspectionResult.indexType,jdbcType=INTEGER},</if>
  118. <if test="inspectionResult.indexDefinitionValue!=null"> #{inspectionResult.indexDefinitionValue,jdbcType=VARCHAR}</if>
  119. </trim>
  120. </insert>
  121. <!--auto generated Code-->
  122. <insert id="insertList">
  123. INSERT INTO sc_inspection_result(
  124. id,
  125. site_id,
  126. instance_id,
  127. plan_id,
  128. object_id,
  129. index_id,
  130. index_value,
  131. status,
  132. date_create,
  133. date_update,
  134. create_by,
  135. update_by,
  136. object_result_id,
  137. index_name,
  138. index_type,
  139. index_definition_value
  140. )VALUES
  141. <foreach collection="inspectionResults" item="inspectionResult" index="index" separator=",">
  142. (
  143. #{inspectionResult.id,jdbcType=INTEGER},
  144. #{inspectionResult.siteId,jdbcType=INTEGER},
  145. #{inspectionResult.instanceId,jdbcType=INTEGER},
  146. #{inspectionResult.planId,jdbcType=INTEGER},
  147. #{inspectionResult.objectId,jdbcType=INTEGER},
  148. #{inspectionResult.indexId,jdbcType=INTEGER},
  149. #{inspectionResult.indexValue,jdbcType=VARCHAR},
  150. #{inspectionResult.status,jdbcType=INTEGER},
  151. #{inspectionResult.dateCreate,jdbcType=TIMESTAMP},
  152. #{inspectionResult.dateUpdate,jdbcType=TIMESTAMP},
  153. #{inspectionResult.createBy,jdbcType=VARCHAR},
  154. #{inspectionResult.updateBy,jdbcType=VARCHAR},
  155. #{inspectionResult.objectResultId,jdbcType=INTEGER},
  156. #{inspectionResult.indexName,jdbcType=VARCHAR},
  157. #{inspectionResult.indexType,jdbcType=INTEGER},
  158. #{inspectionResult.indexDefinitionValue,jdbcType=VARCHAR}
  159. )
  160. </foreach>
  161. </insert>
  162. <!--auto generated Code-->
  163. <update id="updateByPrimaryKeySelective">
  164. UPDATE sc_inspection_result
  165. <set>
  166. <if test="inspectionResult.id != null"> id = #{inspectionResult.id,jdbcType=INTEGER},</if>
  167. <if test="inspectionResult.siteId != null"> site_id = #{inspectionResult.siteId,jdbcType=INTEGER},</if>
  168. <if test="inspectionResult.instanceId != null"> instance_id = #{inspectionResult.instanceId,jdbcType=INTEGER},</if>
  169. <if test="inspectionResult.planId != null"> plan_id = #{inspectionResult.planId,jdbcType=INTEGER},</if>
  170. <if test="inspectionResult.objectId != null"> object_id = #{inspectionResult.objectId,jdbcType=INTEGER},</if>
  171. <if test="inspectionResult.indexId != null"> index_id = #{inspectionResult.indexId,jdbcType=INTEGER},</if>
  172. <if test="inspectionResult.indexValue != null"> index_value = #{inspectionResult.indexValue,jdbcType=VARCHAR},</if>
  173. <if test="inspectionResult.status != null"> status = #{inspectionResult.status,jdbcType=INTEGER},</if>
  174. <if test="inspectionResult.dateCreate != null"> date_create = #{inspectionResult.dateCreate,jdbcType=TIMESTAMP},</if>
  175. <if test="inspectionResult.dateUpdate != null"> date_update = #{inspectionResult.dateUpdate,jdbcType=TIMESTAMP},</if>
  176. <if test="inspectionResult.createBy != null"> create_by = #{inspectionResult.createBy,jdbcType=VARCHAR},</if>
  177. <if test="inspectionResult.updateBy != null"> update_by = #{inspectionResult.updateBy,jdbcType=VARCHAR},</if>
  178. <if test="inspectionResult.objectResultId != null"> object_result_id = #{inspectionResult.objectResultId,jdbcType=INTEGER},</if>
  179. <if test="inspectionResult.indexName != null"> index_name = #{inspectionResult.indexName,jdbcType=VARCHAR},</if>
  180. <if test="inspectionResult.indexType != null"> index_type = #{inspectionResult.indexType,jdbcType=INTEGER},</if>
  181. <if test="inspectionResult.indexDefinitionValue != null"> index_definition_value = #{inspectionResult.indexDefinitionValue,jdbcType=VARCHAR}</if>
  182. </set>
  183. WHERE id = #{inspectionResult.id,jdbcType=INTEGER}
  184. </update>
  185. <select id="getInspectionResultList" resultType="com.bz.smart_city.dto.InspectionResultDto">
  186. select sir.* from sc_inspection_result sir
  187. where sir.status = 1 and sir.object_result_id = #{objectResultId}
  188. </select>
  189. </mapper>