AttWainBaseDao.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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.AttWainBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttWainBase" id="attWainBaseResultMap">
  5. <result property="admName" column="ADM_NAME"/>
  6. <result property="centerX" column="CENTER_X"/>
  7. <result property="centerY" column="CENTER_Y"/>
  8. <result property="ditrName" column="DITR_NAME"/>
  9. <result property="exaDep" column="EXA_DEP"/>
  10. <result property="gateName" column="GATE_NAME"/>
  11. <result property="ifInt" column="IF_INT"/>
  12. <result property="ifTakeLic" column="IF_TAKE_LIC"/>
  13. <result property="ifWsSur" column="IF_WS_SUR"/>
  14. <result property="lakeName" column="LAKE_NAME"/>
  15. <result property="permAdmOrg" column="PERM_ADM_ORG"/>
  16. <result property="adName" column="AD_NAME"/>
  17. <result property="rvName" column="RV_NAME"/>
  18. <result property="takeLicCode" column="TAKE_LIC_CODE"/>
  19. <result property="tra" column="TRA"/>
  20. <result property="wintFlow" column="WINT_FLOW"/>
  21. <result property="wintMode" column="WINT_MODE"/>
  22. <result property="wintName" column="WINT_NAME"/>
  23. <result property="wintPos" column="WINT_POS"/>
  24. <result property="wintType" column="WINT_TYPE"/>
  25. <result property="wsName" column="WS_NAME"/>
  26. <result property="wsType" column="WS_TYPE"/>
  27. <result property="lgtd" column="LGTD"/>
  28. <result property="lttd" column="LTTD"/>
  29. <result property="adCode" column="AD_CODE"/>
  30. <result property="objCode" column="OBJ_CODE"/>
  31. <result property="displayLevel" column="DISPLAY_LEVEL"/>
  32. </resultMap>
  33. <sql id="table_columns">
  34. ADM_NAME,
  35. CENTER_X,
  36. CENTER_Y,
  37. DITR_NAME,
  38. EXA_DEP,
  39. GATE_NAME,
  40. IF_INT,
  41. IF_TAKE_LIC,
  42. IF_WS_SUR,
  43. LAKE_NAME,
  44. PERM_ADM_ORG,
  45. AD_NAME,
  46. RV_NAME,
  47. TAKE_LIC_CODE,
  48. TRA,
  49. WINT_FLOW,
  50. WINT_MODE,
  51. WINT_NAME,
  52. WINT_POS,
  53. WINT_TYPE,
  54. WS_NAME,
  55. WS_TYPE,
  56. LGTD,
  57. LTTD,
  58. AD_CODE,
  59. OBJ_CODE,
  60. DISPLAY_LEVEL
  61. </sql>
  62. <sql id="entity_properties">
  63. #{admName},
  64. #{centerX},
  65. #{centerY},
  66. #{ditrName},
  67. #{exaDep},
  68. #{gateName},
  69. #{ifInt},
  70. #{ifTakeLic},
  71. #{ifWsSur},
  72. #{lakeName},
  73. #{permAdmOrg},
  74. #{adName},
  75. #{rvName},
  76. #{takeLicCode},
  77. #{tra},
  78. #{wintFlow},
  79. #{wintMode},
  80. #{wintName},
  81. #{wintPos},
  82. #{wintType},
  83. #{wsName},
  84. #{wsType},
  85. #{lgtd},
  86. #{lttd},
  87. #{adCode},
  88. #{objCode},
  89. #{displayLevel}
  90. </sql>
  91. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  92. <sql id="page_where">
  93. <trim prefix="where" prefixOverrides="and | or ">
  94. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  95. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  96. <if test="ditrName != null and ditrName != ''">and DITR_NAME = #{ditrName}</if>
  97. <if test="exaDep != null and exaDep != ''">and EXA_DEP = #{exaDep}</if>
  98. <if test="gateName != null and gateName != ''">and GATE_NAME = #{gateName}</if>
  99. <if test="ifInt != null">and IF_INT = #{ifInt}</if>
  100. <if test="ifTakeLic != null">and IF_TAKE_LIC = #{ifTakeLic}</if>
  101. <if test="ifWsSur != null">and IF_WS_SUR = #{ifWsSur}</if>
  102. <if test="lakeName != null and lakeName != ''">and LAKE_NAME = #{lakeName}</if>
  103. <if test="permAdmOrg != null and permAdmOrg != ''">and PERM_ADM_ORG = #{permAdmOrg}</if>
  104. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  105. <if test="rvName != null and rvName != ''">and RV_NAME = #{rvName}</if>
  106. <if test="takeLicCode != null and takeLicCode != ''">and TAKE_LIC_CODE = #{takeLicCode}</if>
  107. <if test="tra != null and tra != ''">and TRA = #{tra}</if>
  108. <if test="wintFlow != null and wintFlow != ''">and WINT_FLOW = #{wintFlow}</if>
  109. <if test="wintMode != null and wintMode != ''">and WINT_MODE = #{wintMode}</if>
  110. <if test="wintName != null and wintName != ''">and WINT_NAME = #{wintName}</if>
  111. <if test="wintPos != null and wintPos != ''">and WINT_POS = #{wintPos}</if>
  112. <if test="wintType != null">and WINT_TYPE = #{wintType}</if>
  113. <if test="wsName != null and wsName != ''">and WS_NAME = #{wsName}</if>
  114. <if test="wsType != null">and WS_TYPE = #{wsType}</if>
  115. <if test="lgtd != null and lgtd != ''">and LGTD = #{lgtd}</if>
  116. <if test="lttd != null and lttd != ''">and LTTD = #{lttd}</if>
  117. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  118. <if test="objCode != null and objCode != ''">and OBJ_CODE = #{objCode}</if>
  119. <if test="displayLevel != null and displayLevel != ''">and DISPLAY_LEVEL = #{displayLevel}</if>
  120. </trim>
  121. </sql>
  122. <select id="get" resultMap="attWainBaseResultMap" parameterType="String">
  123. select
  124. <include refid="table_columns"/>
  125. from ATT_WAIN_BASE where OBJ_CODE = #{id}
  126. </select>
  127. <select id="getBy" resultMap="attWainBaseResultMap">
  128. select
  129. <include refid="table_columns"/>
  130. from ATT_WAIN_BASE
  131. <include refid="page_where"/>
  132. </select>
  133. <select id="findAll" resultMap="attWainBaseResultMap">
  134. select
  135. <include refid="table_columns"/>
  136. from ATT_WAIN_BASE
  137. </select>
  138. <select id="findList" resultMap="attWainBaseResultMap">
  139. select
  140. <include refid="table_columns"/>
  141. from ATT_WAIN_BASE
  142. <include refid="page_where"/>
  143. </select>
  144. <select id="selectCount" resultType="int">
  145. select count(ID) from ATT_WAIN_BASE
  146. <include refid="page_where"/>
  147. </select>
  148. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttWainBase">
  149. insert into ATT_WAIN_BASE(
  150. <include refid="table_columns"/>
  151. )
  152. values (
  153. <include refid="entity_properties"/>
  154. )
  155. </insert>
  156. <delete id="delete" parameterType="java.lang.String">
  157. delete from ATT_WAIN_BASE where OBJ_CODE = #{id}
  158. </delete>
  159. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttWainBase">
  160. delete from ATT_WAIN_BASE
  161. <include refid="page_where"/>
  162. </delete>
  163. <update id="deleteInFlag" parameterType="java.lang.String">
  164. update ATT_WAIN_BASE set flag_valid = 0 where ID = #{id}
  165. </update>
  166. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttWainBase">
  167. update ATT_WAIN_BASE
  168. <trim prefix="set" suffixOverrides=",">
  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="ditrName != null and ditrName != ''">DITR_NAME = #{ditrName},</if>
  172. <if test="exaDep != null and exaDep != ''">EXA_DEP = #{exaDep},</if>
  173. <if test="gateName != null and gateName != ''">GATE_NAME = #{gateName},</if>
  174. <if test="ifInt != null">IF_INT = #{ifInt},</if>
  175. <if test="ifTakeLic != null">IF_TAKE_LIC = #{ifTakeLic},</if>
  176. <if test="ifWsSur != null">IF_WS_SUR = #{ifWsSur},</if>
  177. <if test="lakeName != null and lakeName != ''">LAKE_NAME = #{lakeName},</if>
  178. <if test="permAdmOrg != null and permAdmOrg != ''">PERM_ADM_ORG = #{permAdmOrg},</if>
  179. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  180. <if test="rvName != null and rvName != ''">RV_NAME = #{rvName},</if>
  181. <if test="takeLicCode != null and takeLicCode != ''">TAKE_LIC_CODE = #{takeLicCode},</if>
  182. <if test="tra != null and tra != ''">TRA = #{tra},</if>
  183. <if test="wintFlow != null and wintFlow != ''">WINT_FLOW = #{wintFlow},</if>
  184. <if test="wintMode != null and wintMode != ''">WINT_MODE = #{wintMode},</if>
  185. <if test="wintName != null and wintName != ''">WINT_NAME = #{wintName},</if>
  186. <if test="wintPos != null and wintPos != ''">WINT_POS = #{wintPos},</if>
  187. <if test="wintType != null">WINT_TYPE = #{wintType},</if>
  188. <if test="wsName != null and wsName != ''">WS_NAME = #{wsName},</if>
  189. <if test="wsType != null">WS_TYPE = #{wsType},</if>
  190. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  191. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  192. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  193. <if test="displayLevel != null and displayLevel != ''">DISPLAY_LEVEL = #{displayLevel},</if>
  194. </trim>
  195. <where>OBJ_CODE = #{objCode}</where>
  196. </update>
  197. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttWainBase">
  198. update ATT_WAIN_BASE
  199. <trim prefix="set" suffixOverrides=",">
  200. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  201. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  202. <if test="ditrName != null and ditrName != ''">DITR_NAME = #{ditrName},</if>
  203. <if test="exaDep != null and exaDep != ''">EXA_DEP = #{exaDep},</if>
  204. <if test="gateName != null and gateName != ''">GATE_NAME = #{gateName},</if>
  205. <if test="ifInt != null">IF_INT = #{ifInt},</if>
  206. <if test="ifTakeLic != null">IF_TAKE_LIC = #{ifTakeLic},</if>
  207. <if test="ifWsSur != null">IF_WS_SUR = #{ifWsSur},</if>
  208. <if test="lakeName != null and lakeName != ''">LAKE_NAME = #{lakeName},</if>
  209. <if test="permAdmOrg != null and permAdmOrg != ''">PERM_ADM_ORG = #{permAdmOrg},</if>
  210. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  211. <if test="rvName != null and rvName != ''">RV_NAME = #{rvName},</if>
  212. <if test="takeLicCode != null and takeLicCode != ''">TAKE_LIC_CODE = #{takeLicCode},</if>
  213. <if test="tra != null and tra != ''">TRA = #{tra},</if>
  214. <if test="wintFlow != null and wintFlow != ''">WINT_FLOW = #{wintFlow},</if>
  215. <if test="wintMode != null and wintMode != ''">WINT_MODE = #{wintMode},</if>
  216. <if test="wintName != null and wintName != ''">WINT_NAME = #{wintName},</if>
  217. <if test="wintPos != null and wintPos != ''">WINT_POS = #{wintPos},</if>
  218. <if test="wintType != null">WINT_TYPE = #{wintType},</if>
  219. <if test="wsName != null and wsName != ''">WS_NAME = #{wsName},</if>
  220. <if test="wsType != null">WS_TYPE = #{wsType},</if>
  221. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  222. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  223. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  224. <if test="objCode != null and objCode != ''">OBJ_CODE = #{objCode},</if>
  225. <if test="displayLevel != null and displayLevel != ''">DISPLAY_LEVEL = #{displayLevel},</if>
  226. </trim>
  227. <include refid="page_where"/>
  228. </update>
  229. <!-- 其他自定义SQL -->
  230. <select id="findListByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  231. resultType="cn.com.goldenwater.dcproj.model.AttWainBase">
  232. SELECT A.OBJ_CODE,
  233. A.ADM_NAME,
  234. A.CENTER_X,
  235. A.CENTER_Y,
  236. A.DITR_NAME,
  237. A.EXA_DEP,
  238. A.GATE_NAME,
  239. A.IF_INT,
  240. A.IF_TAKE_LIC,
  241. A.IF_WS_SUR,
  242. A.LAKE_NAME,
  243. A.PERM_ADM_ORG,
  244. A.RV_NAME,
  245. A.TAKE_LIC_CODE,
  246. A.TRA,
  247. A.WINT_FLOW,
  248. A.WINT_MODE,
  249. A.WINT_NAME,
  250. A.WINT_POS,
  251. A.WINT_TYPE,
  252. A.WS_NAME,
  253. A.WS_TYPE,
  254. A.AD_CODE,
  255. A.AD_NAME,
  256. A.LGTD,
  257. A.LTTD,A.DISPLAY_LEVEL FROM att_wain_base A WHERE 1 = 1
  258. <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
  259. <if test="rsName != null and rsName != ''">and A.WINT_NAME LIKE '%${rsName}%'</if>
  260. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and A.CENTER_X BETWEEN
  261. #{minLgtd} AND #{maxLgtd}
  262. </if>
  263. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and A.CENTER_Y BETWEEN
  264. #{minLttd} AND #{maxLttd}
  265. </if>
  266. <if test="wintFlow != null and wintFlow != ''">and A.WINT_Flow &gt;= #{wintFlow}</if>
  267. <if test="displayLevel != null and displayLevel != ''">and to_number(A.DISPLAY_LEVEL) &lt;=
  268. to_number(#{displayLevel})
  269. </if>
  270. </select>
  271. </mapper>