AttWagaSapBaseCrrctDao.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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.AttWagaSapBaseCrrctDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttWagaSapBaseCrrct" id="attWagaSapBaseCrrctResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="sapName" column="SAP_NAME"/>
  7. <result property="basCode" column="BAS_CODE"/>
  8. <result property="diskName" column="DISK_NAME"/>
  9. <result property="adCode" column="AD_CODE"/>
  10. <result property="adName" column="AD_NAME"/>
  11. <result property="startLoc" column="START_LOC"/>
  12. <result property="endLoc" column="END_LOC"/>
  13. <result property="centerX" column="CENTER_X"/>
  14. <result property="centerY" column="CENTER_Y"/>
  15. <result property="gdX" column="GD_X"/>
  16. <result property="gdY" column="GD_Y"/>
  17. <result property="riverBank" column="RIVER_BANK"/>
  18. <result property="lake" column="LAKE"/>
  19. <result property="coast" column="COAST"/>
  20. <result property="dikeGrad" column="DIKE_GRAD"/>
  21. <result property="sapLen" column="SAP_LEN"/>
  22. <result property="sapType" column="SAP_TYPE"/>
  23. <result property="chkState" column="CHK_STATE"/>
  24. <result property="mampu" column="MAMPU"/>
  25. <result property="mampuAttn" column="MAMPU_ATTN"/>
  26. <result property="mampuAttnTel" column="MAMPU_ATTN_TEL"/>
  27. <result property="compUnitAttn" column="COMP_UNIT_ATTN"/>
  28. <result property="compUnitAttnTel" column="COMP_UNIT_ATTN_TEL"/>
  29. <result property="gvmtFldWho" column="GVMT_FLD_WHO"/>
  30. <result property="gvmtFldWhoTel" column="GVMT_FLD_WHO_TEL"/>
  31. <result property="persId" column="PERS_ID"/>
  32. <result property="intm" column="INTM"/>
  33. <result property="uptm" column="UPTM"/>
  34. </resultMap>
  35. <sql id="table_columns">
  36. ID,
  37. SAP_NAME,
  38. BAS_CODE,
  39. DISK_NAME,
  40. AD_CODE,
  41. AD_NAME,
  42. START_LOC,
  43. END_LOC,
  44. CENTER_X,
  45. CENTER_Y,
  46. GD_X,
  47. GD_Y,
  48. RIVER_BANK,
  49. LAKE,
  50. COAST,
  51. DIKE_GRAD,
  52. SAP_LEN,
  53. SAP_TYPE,
  54. CHK_STATE,
  55. MAMPU,
  56. MAMPU_ATTN,
  57. MAMPU_ATTN_TEL,
  58. COMP_UNIT_ATTN,
  59. COMP_UNIT_ATTN_TEL,
  60. GVMT_FLD_WHO,
  61. GVMT_FLD_WHO_TEL,
  62. PERS_ID,
  63. INTM,
  64. UPTM
  65. </sql>
  66. <sql id="entity_properties">
  67. #{id},
  68. #{sapName},
  69. #{basCode},
  70. #{diskName},
  71. #{adCode},
  72. #{adName},
  73. #{startLoc},
  74. #{endLoc},
  75. #{centerX},
  76. #{centerY},
  77. #{gdX},
  78. #{gdY},
  79. #{riverBank},
  80. #{lake},
  81. #{coast},
  82. #{dikeGrad},
  83. #{sapLen},
  84. #{sapType},
  85. #{chkState},
  86. #{mampu},
  87. #{mampuAttn},
  88. #{mampuAttnTel},
  89. #{compUnitAttn},
  90. #{compUnitAttnTel},
  91. #{gvmtFldWho},
  92. #{gvmtFldWhoTel},
  93. #{persId},
  94. #{intm},
  95. #{uptm}
  96. </sql>
  97. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  98. <sql id="page_where">
  99. <trim prefix="where" prefixOverrides="and | or ">
  100. <if test="sapName != null and sapName != ''">and SAP_NAME = #{sapName}</if>
  101. <if test="basCode != null and basCode != ''">and BAS_CODE = #{basCode}</if>
  102. <if test="diskName != null and diskName != ''">and DISK_NAME = #{diskName}</if>
  103. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  104. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  105. <if test="startLoc != null and startLoc != ''">and START_LOC = #{startLoc}</if>
  106. <if test="endLoc != null and endLoc != ''">and END_LOC = #{endLoc}</if>
  107. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  108. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  109. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  110. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  111. <if test="riverBank != null and riverBank != ''">and RIVER_BANK = #{riverBank}</if>
  112. <if test="lake != null and lake != ''">and LAKE = #{lake}</if>
  113. <if test="coast != null and coast != ''">and COAST = #{coast}</if>
  114. <if test="dikeGrad != null and dikeGrad != ''">and DIKE_GRAD = #{dikeGrad}</if>
  115. <if test="sapLen != null and sapLen != ''">and SAP_LEN = #{sapLen}</if>
  116. <if test="sapType != null and sapType != ''">and SAP_TYPE = #{sapType}</if>
  117. <if test="chkState != null and chkState != ''">and CHK_STATE = #{chkState}</if>
  118. <if test="mampu != null and mampu != ''">and MAMPU = #{mampu}</if>
  119. <if test="mampuAttn != null and mampuAttn != ''">and MAMPU_ATTN = #{mampuAttn}</if>
  120. <if test="mampuAttnTel != null and mampuAttnTel != ''">and MAMPU_ATTN_TEL = #{mampuAttnTel}</if>
  121. <if test="compUnitAttn != null and compUnitAttn != ''">and COMP_UNIT_ATTN = #{compUnitAttn}</if>
  122. <if test="compUnitAttnTel != null and compUnitAttnTel != ''">and COMP_UNIT_ATTN_TEL = #{compUnitAttnTel}</if>
  123. <if test="gvmtFldWho != null and gvmtFldWho != ''">and GVMT_FLD_WHO = #{gvmtFldWho}</if>
  124. <if test="gvmtFldWhoTel != null and gvmtFldWhoTel != ''">and GVMT_FLD_WHO_TEL = #{gvmtFldWhoTel}</if>
  125. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  126. <if test="intm != null">and INTM = #{intm}</if>
  127. <if test="uptm != null">and UPTM = #{uptm}</if>
  128. and DATA_STAT='0'
  129. </trim>
  130. </sql>
  131. <select id="get" resultMap="attWagaSapBaseCrrctResultMap" parameterType="String" >
  132. select <include refid="table_columns" /> from ATT_WAGA_SAP_BASE_CRRCT where ID = #{id}
  133. </select>
  134. <select id="getBy" resultMap="attWagaSapBaseCrrctResultMap">
  135. select <include refid="table_columns" /> from ATT_WAGA_SAP_BASE_CRRCT <include refid="page_where" />
  136. </select>
  137. <select id="findAll" resultMap="attWagaSapBaseCrrctResultMap">
  138. select <include refid="table_columns" /> from ATT_WAGA_SAP_BASE_CRRCT
  139. </select>
  140. <select id="findList" resultMap="attWagaSapBaseCrrctResultMap">
  141. select <include refid="table_columns" /> from ATT_WAGA_SAP_BASE_CRRCT <include refid="page_where" />
  142. </select>
  143. <select id="selectCount" resultType="int" >
  144. select count(ID) from ATT_WAGA_SAP_BASE_CRRCT <include refid="page_where" />
  145. </select>
  146. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttWagaSapBaseCrrct">
  147. insert into ATT_WAGA_SAP_BASE_CRRCT( <include refid="table_columns" /> )
  148. values ( <include refid="entity_properties" /> )
  149. </insert>
  150. <delete id="delete" parameterType="java.lang.String">
  151. update ATT_WAGA_SAP_BASE_CRRCT set DATA_STAT='9' where ID = #{id}
  152. </delete>
  153. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttWagaSapBaseCrrct">
  154. update ATT_WAGA_SAP_BASE_CRRCT set DATA_STAT='9' <include refid="page_where" />
  155. </delete>
  156. <update id="deleteInFlag" parameterType="java.lang.String">
  157. update ATT_WAGA_SAP_BASE_CRRCT set DATA_STAT = '9' where ID = #{id}
  158. </update>
  159. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttWagaSapBaseCrrct">
  160. update ATT_WAGA_SAP_BASE_CRRCT
  161. <trim prefix="set" suffixOverrides=",">
  162. <if test="sapName != null and sapName != ''">SAP_NAME = #{sapName},</if>
  163. <if test="basCode != null and basCode != ''">BAS_CODE = #{basCode},</if>
  164. <if test="diskName != null and diskName != ''">DISK_NAME = #{diskName},</if>
  165. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  166. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  167. <if test="startLoc != null and startLoc != ''">START_LOC = #{startLoc},</if>
  168. <if test="endLoc != null and endLoc != ''">END_LOC = #{endLoc},</if>
  169. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  170. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  171. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  172. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  173. <if test="riverBank != null and riverBank != ''">RIVER_BANK = #{riverBank},</if>
  174. <if test="lake != null and lake != ''">LAKE = #{lake},</if>
  175. <if test="coast != null and coast != ''">COAST = #{coast},</if>
  176. <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
  177. <if test="sapLen != null and sapLen != ''">SAP_LEN = #{sapLen},</if>
  178. <if test="sapType != null and sapType != ''">SAP_TYPE = #{sapType},</if>
  179. <if test="chkState != null and chkState != ''">CHK_STATE = #{chkState},</if>
  180. <if test="mampu != null and mampu != ''">MAMPU = #{mampu},</if>
  181. <if test="mampuAttn != null and mampuAttn != ''">MAMPU_ATTN = #{mampuAttn},</if>
  182. <if test="mampuAttnTel != null and mampuAttnTel != ''">MAMPU_ATTN_TEL = #{mampuAttnTel},</if>
  183. <if test="compUnitAttn != null and compUnitAttn != ''">COMP_UNIT_ATTN = #{compUnitAttn},</if>
  184. <if test="compUnitAttnTel != null and compUnitAttnTel != ''">COMP_UNIT_ATTN_TEL = #{compUnitAttnTel},</if>
  185. <if test="gvmtFldWho != null and gvmtFldWho != ''">GVMT_FLD_WHO = #{gvmtFldWho},</if>
  186. <if test="gvmtFldWhoTel != null and gvmtFldWhoTel != ''">GVMT_FLD_WHO_TEL = #{gvmtFldWhoTel},</if>
  187. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  188. <if test="intm != null">INTM = #{intm},</if>
  189. <if test="uptm != null">UPTM = #{uptm},</if>
  190. </trim>
  191. <where>ID = #{id}</where>
  192. </update>
  193. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttWagaSapBaseCrrct">
  194. update ATT_WAGA_SAP_BASE_CRRCT
  195. <trim prefix="set" suffixOverrides=",">
  196. <if test="sapName != null and sapName != ''">SAP_NAME = #{sapName},</if>
  197. <if test="basCode != null and basCode != ''">BAS_CODE = #{basCode},</if>
  198. <if test="diskName != null and diskName != ''">DISK_NAME = #{diskName},</if>
  199. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  200. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  201. <if test="startLoc != null and startLoc != ''">START_LOC = #{startLoc},</if>
  202. <if test="endLoc != null and endLoc != ''">END_LOC = #{endLoc},</if>
  203. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  204. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  205. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  206. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  207. <if test="riverBank != null and riverBank != ''">RIVER_BANK = #{riverBank},</if>
  208. <if test="lake != null and lake != ''">LAKE = #{lake},</if>
  209. <if test="coast != null and coast != ''">COAST = #{coast},</if>
  210. <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
  211. <if test="sapLen != null and sapLen != ''">SAP_LEN = #{sapLen},</if>
  212. <if test="sapType != null and sapType != ''">SAP_TYPE = #{sapType},</if>
  213. <if test="chkState != null and chkState != ''">CHK_STATE = #{chkState},</if>
  214. <if test="mampu != null and mampu != ''">MAMPU = #{mampu},</if>
  215. <if test="mampuAttn != null and mampuAttn != ''">MAMPU_ATTN = #{mampuAttn},</if>
  216. <if test="mampuAttnTel != null and mampuAttnTel != ''">MAMPU_ATTN_TEL = #{mampuAttnTel},</if>
  217. <if test="compUnitAttn != null and compUnitAttn != ''">COMP_UNIT_ATTN = #{compUnitAttn},</if>
  218. <if test="compUnitAttnTel != null and compUnitAttnTel != ''">COMP_UNIT_ATTN_TEL = #{compUnitAttnTel},</if>
  219. <if test="gvmtFldWho != null and gvmtFldWho != ''">GVMT_FLD_WHO = #{gvmtFldWho},</if>
  220. <if test="gvmtFldWhoTel != null and gvmtFldWhoTel != ''">GVMT_FLD_WHO_TEL = #{gvmtFldWhoTel},</if>
  221. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  222. <if test="intm != null">INTM = #{intm},</if>
  223. <if test="uptm != null">UPTM = #{uptm},</if>
  224. </trim>
  225. <include refid="page_where" />
  226. </update>
  227. <!-- 其他自定义SQL -->
  228. </mapper>