BisInspHystpSafDao.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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.BisInspHystpSafDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspHystpSaf" id="bisInspHystpSafResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="rgstrId" column="RGSTR_ID"/>
  7. <result property="isPlanMak" column="IS_PLAN_MAK"/>
  8. <result property="isPlanApp" column="IS_PLAN_APP"/>
  9. <result property="isPlanDemo" column="IS_PLAN_DEMO"/>
  10. <result property="isSafChk" column="IS_SAF_CHK"/>
  11. <result property="isBuldBook" column="IS_BULD_BOOK"/>
  12. <result property="isDamFlv" column="IS_DAM_FLV"/>
  13. <result property="isDamTel" column="IS_DAM_TEL"/>
  14. <result property="isTwoOrdr" column="IS_TWO_ORDR"/>
  15. <result property="isThreeSys" column="IS_THREE_SYS"/>
  16. <result property="isFireStnd" column="IS_FIRE_STND"/>
  17. <result property="isGoodReq" column="IS_GOOD_REQ"/>
  18. <result property="isGasStore" column="IS_GAS_STORE"/>
  19. <result property="isSafReq" column="IS_SAF_REQ"/>
  20. <result property="isWarnReq" column="IS_WARN_REQ"/>
  21. <result property="isWarnSaf" column="IS_WARN_SAF"/>
  22. <result property="persId" column="PERS_ID"/>
  23. <result property="intm" column="INTM"/>
  24. <result property="uptm" column="UPTM"/>
  25. <result property="note" column="NOTE"/>
  26. <result property="dataStat" column="DATA_STAT"/>
  27. <result property="state" column="STATE"/>
  28. </resultMap>
  29. <sql id="table_columns">
  30. ID,
  31. RGSTR_ID,
  32. IS_PLAN_MAK,
  33. IS_PLAN_APP,
  34. IS_PLAN_DEMO,
  35. IS_SAF_CHK,
  36. IS_BULD_BOOK,
  37. IS_DAM_FLV,
  38. IS_DAM_TEL,
  39. IS_TWO_ORDR,
  40. IS_THREE_SYS,
  41. IS_FIRE_STND,
  42. IS_GOOD_REQ,
  43. IS_GAS_STORE,
  44. IS_SAF_REQ,
  45. IS_WARN_REQ,
  46. IS_WARN_SAF,
  47. PERS_ID,
  48. INTM,
  49. UPTM,
  50. NOTE,
  51. DATA_STAT,
  52. STATE
  53. </sql>
  54. <sql id="entity_properties">
  55. #{id},
  56. #{rgstrId},
  57. #{isPlanMak},
  58. #{isPlanApp},
  59. #{isPlanDemo},
  60. #{isSafChk},
  61. #{isBuldBook},
  62. #{isDamFlv},
  63. #{isDamTel},
  64. #{isTwoOrdr},
  65. #{isThreeSys},
  66. #{isFireStnd},
  67. #{isGoodReq},
  68. #{isGasStore},
  69. #{isSafReq},
  70. #{isWarnReq},
  71. #{isWarnSaf},
  72. #{persId},
  73. #{intm},
  74. #{uptm},
  75. #{note},
  76. #{dataStat},
  77. #{state}
  78. </sql>
  79. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  80. <sql id="page_where">
  81. <trim prefix="where" prefixOverrides="and | or ">
  82. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  83. <if test="isPlanMak != null and isPlanMak != ''">and IS_PLAN_MAK = #{isPlanMak}</if>
  84. <if test="isPlanApp != null and isPlanApp != ''">and IS_PLAN_APP = #{isPlanApp}</if>
  85. <if test="isPlanDemo != null and isPlanDemo != ''">and IS_PLAN_DEMO = #{isPlanDemo}</if>
  86. <if test="isSafChk != null and isSafChk != ''">and IS_SAF_CHK = #{isSafChk}</if>
  87. <if test="isBuldBook != null and isBuldBook != ''">and IS_BULD_BOOK = #{isBuldBook}</if>
  88. <if test="isDamFlv != null and isDamFlv != ''">and IS_DAM_FLV = #{isDamFlv}</if>
  89. <if test="isDamTel != null and isDamTel != ''">and IS_DAM_TEL = #{isDamTel}</if>
  90. <if test="isTwoOrdr != null and isTwoOrdr != ''">and IS_TWO_ORDR = #{isTwoOrdr}</if>
  91. <if test="isThreeSys != null and isThreeSys != ''">and IS_THREE_SYS = #{isThreeSys}</if>
  92. <if test="isFireStnd != null and isFireStnd != ''">and IS_FIRE_STND = #{isFireStnd}</if>
  93. <if test="isGoodReq != null and isGoodReq != ''">and IS_GOOD_REQ = #{isGoodReq}</if>
  94. <if test="isGasStore != null and isGasStore != ''">and IS_GAS_STORE = #{isGasStore}</if>
  95. <if test="isSafReq != null and isSafReq != ''">and IS_SAF_REQ = #{isSafReq}</if>
  96. <if test="isWarnReq != null and isWarnReq != ''">and IS_WARN_REQ = #{isWarnReq}</if>
  97. <if test="isWarnSaf != null and isWarnSaf != ''">and IS_WARN_SAF = #{isWarnSaf}</if>
  98. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  99. <if test="intm != null">and INTM = #{intm}</if>
  100. <if test="uptm != null">and UPTM = #{uptm}</if>
  101. <if test="note != null and note != ''">and NOTE = #{note}</if>
  102. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  103. <if test="state != null and state != ''">and STATE = #{state}</if>
  104. </trim>
  105. </sql>
  106. <select id="get" resultMap="bisInspHystpSafResultMap" parameterType="String" >
  107. select <include refid="table_columns" /> from BIS_INSP_HYSTP_SAF where RGSTR_ID = #{id}
  108. </select>
  109. <select id="getBy" resultMap="bisInspHystpSafResultMap">
  110. select <include refid="table_columns" /> from BIS_INSP_HYSTP_SAF <include refid="page_where" />
  111. </select>
  112. <select id="findAll" resultMap="bisInspHystpSafResultMap">
  113. select <include refid="table_columns" /> from BIS_INSP_HYSTP_SAF
  114. </select>
  115. <select id="findList" resultMap="bisInspHystpSafResultMap">
  116. select <include refid="table_columns" /> from BIS_INSP_HYSTP_SAF <include refid="page_where" />
  117. </select>
  118. <select id="selectCount" resultType="int" >
  119. select count(ID) from BIS_INSP_HYSTP_SAF <include refid="page_where" />
  120. </select>
  121. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpSaf">
  122. insert into BIS_INSP_HYSTP_SAF( <include refid="table_columns" /> )
  123. values ( <include refid="entity_properties" /> )
  124. </insert>
  125. <delete id="delete" parameterType="java.lang.String">
  126. update BIS_INSP_HYSTP_SAF set DATA_STAT='9' where ID = #{id}
  127. </delete>
  128. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpSaf">
  129. delete from BIS_INSP_HYSTP_SAF <include refid="page_where" />
  130. </delete>
  131. <update id="deleteInFlag" parameterType="java.lang.String">
  132. update BIS_INSP_HYSTP_SAF set flag_valid = 0 where ID = #{id}
  133. </update>
  134. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpSaf">
  135. update BIS_INSP_HYSTP_SAF
  136. <trim prefix="set" suffixOverrides=",">
  137. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  138. <if test="isPlanMak != null and isPlanMak != ''">IS_PLAN_MAK = #{isPlanMak},</if>
  139. <if test="isPlanApp != null and isPlanApp != ''">IS_PLAN_APP = #{isPlanApp},</if>
  140. <if test="isPlanDemo != null and isPlanDemo != ''">IS_PLAN_DEMO = #{isPlanDemo},</if>
  141. <if test="isSafChk != null and isSafChk != ''">IS_SAF_CHK = #{isSafChk},</if>
  142. <if test="isBuldBook != null and isBuldBook != ''">IS_BULD_BOOK = #{isBuldBook},</if>
  143. <if test="isDamFlv != null and isDamFlv != ''">IS_DAM_FLV = #{isDamFlv},</if>
  144. <if test="isDamTel != null and isDamTel != ''">IS_DAM_TEL = #{isDamTel},</if>
  145. <if test="isTwoOrdr != null and isTwoOrdr != ''">IS_TWO_ORDR = #{isTwoOrdr},</if>
  146. <if test="isThreeSys != null and isThreeSys != ''">IS_THREE_SYS = #{isThreeSys},</if>
  147. <if test="isFireStnd != null and isFireStnd != ''">IS_FIRE_STND = #{isFireStnd},</if>
  148. <if test="isGoodReq != null and isGoodReq != ''">IS_GOOD_REQ = #{isGoodReq},</if>
  149. <if test="isGasStore != null and isGasStore != ''">IS_GAS_STORE = #{isGasStore},</if>
  150. <if test="isSafReq != null and isSafReq != ''">IS_SAF_REQ = #{isSafReq},</if>
  151. <if test="isWarnReq != null and isWarnReq != ''">IS_WARN_REQ = #{isWarnReq},</if>
  152. <if test="isWarnSaf != null and isWarnSaf != ''">IS_WARN_SAF = #{isWarnSaf},</if>
  153. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  154. <if test="intm != null">INTM = #{intm},</if>
  155. <if test="uptm != null">UPTM = #{uptm},</if>
  156. <if test="note != null and note != ''">NOTE = #{note},</if>
  157. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  158. <if test="state != null and state != ''">STATE = #{state},</if>
  159. </trim>
  160. <where>ID = #{id}</where>
  161. </update>
  162. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspHystpSaf">
  163. update BIS_INSP_HYSTP_SAF
  164. <trim prefix="set" suffixOverrides=",">
  165. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  166. <if test="isPlanMak != null and isPlanMak != ''">IS_PLAN_MAK = #{isPlanMak},</if>
  167. <if test="isPlanApp != null and isPlanApp != ''">IS_PLAN_APP = #{isPlanApp},</if>
  168. <if test="isPlanDemo != null and isPlanDemo != ''">IS_PLAN_DEMO = #{isPlanDemo},</if>
  169. <if test="isSafChk != null and isSafChk != ''">IS_SAF_CHK = #{isSafChk},</if>
  170. <if test="isBuldBook != null and isBuldBook != ''">IS_BULD_BOOK = #{isBuldBook},</if>
  171. <if test="isDamFlv != null and isDamFlv != ''">IS_DAM_FLV = #{isDamFlv},</if>
  172. <if test="isDamTel != null and isDamTel != ''">IS_DAM_TEL = #{isDamTel},</if>
  173. <if test="isTwoOrdr != null and isTwoOrdr != ''">IS_TWO_ORDR = #{isTwoOrdr},</if>
  174. <if test="isThreeSys != null and isThreeSys != ''">IS_THREE_SYS = #{isThreeSys},</if>
  175. <if test="isFireStnd != null and isFireStnd != ''">IS_FIRE_STND = #{isFireStnd},</if>
  176. <if test="isGoodReq != null and isGoodReq != ''">IS_GOOD_REQ = #{isGoodReq},</if>
  177. <if test="isGasStore != null and isGasStore != ''">IS_GAS_STORE = #{isGasStore},</if>
  178. <if test="isSafReq != null and isSafReq != ''">IS_SAF_REQ = #{isSafReq},</if>
  179. <if test="isWarnReq != null and isWarnReq != ''">IS_WARN_REQ = #{isWarnReq},</if>
  180. <if test="isWarnSaf != null and isWarnSaf != ''">IS_WARN_SAF = #{isWarnSaf},</if>
  181. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  182. <if test="intm != null">INTM = #{intm},</if>
  183. <if test="uptm != null">UPTM = #{uptm},</if>
  184. <if test="note != null and note != ''">NOTE = #{note},</if>
  185. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  186. <if test="state != null and state != ''">STATE = #{state},</if>
  187. </trim>
  188. <include refid="page_where" />
  189. </update>
  190. <!-- 其他自定义SQL -->
  191. </mapper>