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