BisInspRsvrSdFcltyDao.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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="cn.com.goldenwater.dcproj.dao.BisInspRsvrSdFcltyDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspRsvrSdFclty" id="bisInspRsvrSdFcltyResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="rgstrId" column="RGSTR_ID"/>
  7. <result property="isGaetRisk" column="IS_GAET_RISK"/>
  8. <result property="isGateCrv" column="IS_GATE_CRV"/>
  9. <result property="isGateLeak" column="IS_GATE_LEAK"/>
  10. <result property="isGateBrk" column="IS_GATE_BRK"/>
  11. <result property="isGatePow" column="IS_GATE_POW"/>
  12. <result property="isGateInsu" column="IS_GATE_INSU"/>
  13. <result property="isSetSaf" column="IS_SET_SAF"/>
  14. <result property="isSafRun" column="IS_SAF_RUN"/>
  15. <result property="isPub" column="IS_PUB"/>
  16. <result property="isPubRel" column="IS_PUB_REL"/>
  17. <result property="isPubClr" column="IS_PUB_CLR"/>
  18. <result property="isPubMiss" column="IS_PUB_MISS"/>
  19. <result property="isRepRisk" column="IS_REP_RISK"/>
  20. <result property="dataStat" column="DATA_STAT"/>
  21. <result property="persId" column="PERS_ID"/>
  22. <result property="intm" column="INTM"/>
  23. <result property="uptm" column="UPTM"/>
  24. <result property="note" column="NOTE"/>
  25. </resultMap>
  26. <sql id="table_columns">
  27. ID,
  28. RGSTR_ID,
  29. IS_GAET_RISK,
  30. IS_GATE_CRV,
  31. IS_GATE_LEAK,
  32. IS_GATE_BRK,
  33. IS_GATE_POW,
  34. IS_GATE_INSU,
  35. IS_SET_SAF,
  36. IS_SAF_RUN,
  37. IS_PUB,
  38. IS_PUB_REL,
  39. IS_PUB_CLR,
  40. IS_PUB_MISS,
  41. IS_REP_RISK,
  42. DATA_STAT,
  43. PERS_ID,
  44. INTM,
  45. UPTM,
  46. NOTE
  47. </sql>
  48. <sql id="entity_properties">
  49. #{id},
  50. #{rgstrId},
  51. #{isGaetRisk},
  52. #{isGateCrv},
  53. #{isGateLeak},
  54. #{isGateBrk},
  55. #{isGatePow},
  56. #{isGateInsu},
  57. #{isSetSaf},
  58. #{isSafRun},
  59. #{isPub},
  60. #{isPubRel},
  61. #{isPubClr},
  62. #{isPubMiss},
  63. #{isRepRisk},
  64. #{dataStat},
  65. #{persId},
  66. #{intm},
  67. #{uptm},
  68. #{note}
  69. </sql>
  70. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  71. <sql id="page_where">
  72. <trim prefix="where" prefixOverrides="and | or ">
  73. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  74. <if test="isGaetRisk != null and isGaetRisk != ''">and IS_GAET_RISK = #{isGaetRisk}</if>
  75. <if test="isGateCrv != null and isGateCrv != ''">and IS_GATE_CRV = #{isGateCrv}</if>
  76. <if test="isGateLeak != null and isGateLeak != ''">and IS_GATE_LEAK = #{isGateLeak}</if>
  77. <if test="isGateBrk != null and isGateBrk != ''">and IS_GATE_BRK = #{isGateBrk}</if>
  78. <if test="isGatePow != null and isGatePow != ''">and IS_GATE_POW = #{isGatePow}</if>
  79. <if test="isGateInsu != null and isGateInsu != ''">and IS_GATE_INSU = #{isGateInsu}</if>
  80. <if test="isSetSaf != null and isSetSaf != ''">and IS_SET_SAF = #{isSetSaf}</if>
  81. <if test="isSafRun != null and isSafRun != ''">and IS_SAF_RUN = #{isSafRun}</if>
  82. <if test="isPub != null and isPub != ''">and IS_PUB = #{isPub}</if>
  83. <if test="isPubRel != null and isPubRel != ''">and IS_PUB_REL = #{isPubRel}</if>
  84. <if test="isPubClr != null and isPubClr != ''">and IS_PUB_CLR = #{isPubClr}</if>
  85. <if test="isPubMiss != null and isPubMiss != ''">and IS_PUB_MISS = #{isPubMiss}</if>
  86. <if test="isRepRisk != null and isRepRisk != ''">and IS_REP_RISK = #{isRepRisk}</if>
  87. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  88. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  89. <if test="intm != null">and INTM = #{intm}</if>
  90. <if test="uptm != null">and UPTM = #{uptm}</if>
  91. <if test="note != null and note != ''">and NOTE = #{note}</if>
  92. </trim>
  93. </sql>
  94. <select id="get" resultMap="bisInspRsvrSdFcltyResultMap" parameterType="String" >
  95. select <include refid="table_columns" /> from BIS_INSP_RSVR_SD_FCLTY where RGSTR_ID = #{id}
  96. </select>
  97. <select id="getBy" resultMap="bisInspRsvrSdFcltyResultMap">
  98. select <include refid="table_columns" /> from BIS_INSP_RSVR_SD_FCLTY <include refid="page_where" />
  99. </select>
  100. <select id="findAll" resultMap="bisInspRsvrSdFcltyResultMap">
  101. select <include refid="table_columns" /> from BIS_INSP_RSVR_SD_FCLTY
  102. </select>
  103. <select id="findList" resultMap="bisInspRsvrSdFcltyResultMap">
  104. select <include refid="table_columns" /> from BIS_INSP_RSVR_SD_FCLTY <include refid="page_where" />
  105. </select>
  106. <select id="selectCount" resultType="int" >
  107. select count(ID) from BIS_INSP_RSVR_SD_FCLTY <include refid="page_where" />
  108. </select>
  109. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrSdFclty">
  110. insert into BIS_INSP_RSVR_SD_FCLTY( <include refid="table_columns" /> )
  111. values ( <include refid="entity_properties" /> )
  112. </insert>
  113. <delete id="delete" parameterType="java.lang.String">
  114. update BIS_INSP_RSVR_SD_FCLTY set DATA_STAT='9' where ID = #{id}
  115. </delete>
  116. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrSdFclty">
  117. delete from BIS_INSP_RSVR_SD_FCLTY <include refid="page_where" />
  118. </delete>
  119. <update id="deleteInFlag" parameterType="java.lang.String">
  120. update BIS_INSP_RSVR_SD_FCLTY set flag_valid = 0 where ID = #{id}
  121. </update>
  122. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrSdFclty">
  123. update BIS_INSP_RSVR_SD_FCLTY
  124. <trim prefix="set" suffixOverrides=",">
  125. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  126. <if test="isGaetRisk != null and isGaetRisk != ''">IS_GAET_RISK = #{isGaetRisk},</if>
  127. <if test="isGateCrv != null and isGateCrv != ''">IS_GATE_CRV = #{isGateCrv},</if>
  128. <if test="isGateLeak != null and isGateLeak != ''">IS_GATE_LEAK = #{isGateLeak},</if>
  129. <if test="isGateBrk != null and isGateBrk != ''">IS_GATE_BRK = #{isGateBrk},</if>
  130. <if test="isGatePow != null and isGatePow != ''">IS_GATE_POW = #{isGatePow},</if>
  131. <if test="isGateInsu != null and isGateInsu != ''">IS_GATE_INSU = #{isGateInsu},</if>
  132. <if test="isSetSaf != null and isSetSaf != ''">IS_SET_SAF = #{isSetSaf},</if>
  133. <if test="isSafRun != null and isSafRun != ''">IS_SAF_RUN = #{isSafRun},</if>
  134. <if test="isPub != null and isPub != ''">IS_PUB = #{isPub},</if>
  135. <if test="isPubRel != null and isPubRel != ''">IS_PUB_REL = #{isPubRel},</if>
  136. <if test="isPubClr != null and isPubClr != ''">IS_PUB_CLR = #{isPubClr},</if>
  137. <if test="isPubMiss != null and isPubMiss != ''">IS_PUB_MISS = #{isPubMiss},</if>
  138. <if test="isRepRisk != null and isRepRisk != ''">IS_REP_RISK = #{isRepRisk},</if>
  139. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  140. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  141. <if test="intm != null">INTM = #{intm},</if>
  142. <if test="uptm != null">UPTM = #{uptm},</if>
  143. <if test="note != null and note != ''">NOTE = #{note},</if>
  144. </trim>
  145. <where>ID = #{id}</where>
  146. </update>
  147. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRsvrSdFclty">
  148. update BIS_INSP_RSVR_SD_FCLTY
  149. <trim prefix="set" suffixOverrides=",">
  150. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  151. <if test="isGaetRisk != null and isGaetRisk != ''">IS_GAET_RISK = #{isGaetRisk},</if>
  152. <if test="isGateCrv != null and isGateCrv != ''">IS_GATE_CRV = #{isGateCrv},</if>
  153. <if test="isGateLeak != null and isGateLeak != ''">IS_GATE_LEAK = #{isGateLeak},</if>
  154. <if test="isGateBrk != null and isGateBrk != ''">IS_GATE_BRK = #{isGateBrk},</if>
  155. <if test="isGatePow != null and isGatePow != ''">IS_GATE_POW = #{isGatePow},</if>
  156. <if test="isGateInsu != null and isGateInsu != ''">IS_GATE_INSU = #{isGateInsu},</if>
  157. <if test="isSetSaf != null and isSetSaf != ''">IS_SET_SAF = #{isSetSaf},</if>
  158. <if test="isSafRun != null and isSafRun != ''">IS_SAF_RUN = #{isSafRun},</if>
  159. <if test="isPub != null and isPub != ''">IS_PUB = #{isPub},</if>
  160. <if test="isPubRel != null and isPubRel != ''">IS_PUB_REL = #{isPubRel},</if>
  161. <if test="isPubClr != null and isPubClr != ''">IS_PUB_CLR = #{isPubClr},</if>
  162. <if test="isPubMiss != null and isPubMiss != ''">IS_PUB_MISS = #{isPubMiss},</if>
  163. <if test="isRepRisk != null and isRepRisk != ''">IS_REP_RISK = #{isRepRisk},</if>
  164. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  165. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  166. <if test="intm != null">INTM = #{intm},</if>
  167. <if test="uptm != null">UPTM = #{uptm},</if>
  168. <if test="note != null and note != ''">NOTE = #{note},</if>
  169. </trim>
  170. <include refid="page_where" />
  171. </update>
  172. <!-- 其他自定义SQL -->
  173. </mapper>