InspectionIndexMapper.xml 9.0 KB

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