AttSwhsBaseDao.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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.AttSwhsBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttSwhsBase" id="attSwhsBaseResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="swhsCode" column="SWHS_CODE"/>
  7. <result property="swhsName" column="SWHS_NAME"/>
  8. <result property="swhsLong" column="SWHS_LONG"/>
  9. <result property="swhsLat" column="SWHS_LAT"/>
  10. <result property="adCode" column="AD_CODE"/>
  11. <result property="swhsLoc" column="SWHS_LOC"/>
  12. <result property="wainWasoType" column="WAIN_WASO_TYPE"/>
  13. <result property="watArea" column="WAT_AREA"/>
  14. <result property="wainNum" column="WAIN_NUM"/>
  15. <result property="wainUse" column="WAIN_USE"/>
  16. <result property="wasuObjType" column="WASU_OBJ_TYPE"/>
  17. <result property="wasuTownName" column="WASU_TOWN_NAME"/>
  18. <result property="wasuTownName2" column="WASU_TOWN_NAME_2"/>
  19. <result property="wasuTownName3" column="WASU_TOWN_NAME_3"/>
  20. <result property="desAnnWain" column="DES_ANN_WAIN"/>
  21. <result property="desAnnWasuPop" column="DES_ANN_WASU_POP"/>
  22. <result property="runYear" column="RUN_YEAR"/>
  23. <result property="wintRvName" column="WINT_RV_NAME"/>
  24. <result property="wintLakeName" column="WINT_LAKE_NAME"/>
  25. <result property="wintRsName" column="WINT_RS_NAME"/>
  26. <result property="waquGoal" column="WAQU_GOAL"/>
  27. <result property="ifMonWqua" column="IF_MON_WQUA"/>
  28. <result property="wquaCat" column="WQUA_CAT"/>
  29. <result property="ifWquaUptoSta" column="IF_WQUA_UPTO_STA"/>
  30. <result property="ifWsProt" column="IF_WS_PROT"/>
  31. <result property="watArea1stProt" column="WAT_AREA_1ST_PROT"/>
  32. <result property="landArea1stProt" column="LAND_AREA_1ST_PROT"/>
  33. <result property="watArea2ndProt" column="WAT_AREA_2ND_PROT"/>
  34. <result property="landArea2ndProt" column="LAND_AREA_2ND_PROT"/>
  35. <result property="qusProt" column="QUS_PROT"/>
  36. <result property="insName" column="INS_NAME"/>
  37. <result property="tra" column="TRA"/>
  38. <result property="persId" column="PERS_ID"/>
  39. <result property="note" column="NOTE"/>
  40. <result property="effDate" column="EFF_DATE"/>
  41. <result property="exprDate" column="EXPR_DATE"/>
  42. <result property="swhsLongGd" column="SWHS_LONG_GD"/>
  43. <result property="swhsLatGd" column="SWHS_LAT_GD"/>
  44. <result property="displayLevel" column="DISPLAY_LEVEL"/>
  45. </resultMap>
  46. <sql id="table_columns">
  47. ID,
  48. SWHS_CODE,
  49. SWHS_NAME,
  50. SWHS_LONG,
  51. SWHS_LAT,
  52. AD_CODE,
  53. SWHS_LOC,
  54. WAIN_WASO_TYPE,
  55. WAT_AREA,
  56. WAIN_NUM,
  57. WAIN_USE,
  58. WASU_OBJ_TYPE,
  59. WASU_TOWN_NAME,
  60. WASU_TOWN_NAME_2,
  61. WASU_TOWN_NAME_3,
  62. DES_ANN_WAIN,
  63. DES_ANN_WASU_POP,
  64. RUN_YEAR,
  65. WINT_RV_NAME,
  66. WINT_LAKE_NAME,
  67. WINT_RS_NAME,
  68. WAQU_GOAL,
  69. IF_MON_WQUA,
  70. WQUA_CAT,
  71. IF_WQUA_UPTO_STA,
  72. IF_WS_PROT,
  73. WAT_AREA_1ST_PROT,
  74. LAND_AREA_1ST_PROT,
  75. WAT_AREA_2ND_PROT,
  76. LAND_AREA_2ND_PROT,
  77. QUS_PROT,
  78. INS_NAME,
  79. TRA,
  80. PERS_ID,
  81. NOTE,
  82. EFF_DATE,
  83. EXPR_DATE,
  84. SWHS_LONG_GD,
  85. SWHS_LAT_GD,
  86. DISPLAY_LEVEL
  87. </sql>
  88. <sql id="entity_properties">
  89. #{id},
  90. #{swhsCode},
  91. #{swhsName},
  92. #{swhsLong},
  93. #{swhsLat},
  94. #{adCode},
  95. #{swhsLoc},
  96. #{wainWasoType},
  97. #{watArea},
  98. #{wainNum},
  99. #{wainUse},
  100. #{wasuObjType},
  101. #{wasuTownName},
  102. #{wasuTownName2},
  103. #{wasuTownName3},
  104. #{desAnnWain},
  105. #{desAnnWasuPop},
  106. #{runYear},
  107. #{wintRvName},
  108. #{wintLakeName},
  109. #{wintRsName},
  110. #{waquGoal},
  111. #{ifMonWqua},
  112. #{wquaCat},
  113. #{ifWquaUptoSta},
  114. #{ifWsProt},
  115. #{watArea1stProt},
  116. #{landArea1stProt},
  117. #{watArea2ndProt},
  118. #{landArea2ndProt},
  119. #{qusProt},
  120. #{insName},
  121. #{tra},
  122. #{persId},
  123. #{note},
  124. #{effDate},
  125. #{exprDate},
  126. #{swhsLongGd},
  127. #{swhsLatGd},
  128. #{displayLevel}
  129. </sql>
  130. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  131. <sql id="page_where">
  132. <trim prefix="where" prefixOverrides="and | or ">
  133. <if test="swhsCode != null and swhsCode != ''">and SWHS_CODE = #{swhsCode}</if>
  134. <if test="swhsName != null and swhsName != ''">and SWHS_NAME like '${swhsName}%'</if>
  135. <if test="swhsLong != null and swhsLong != ''">and SWHS_LONG = #{swhsLong}</if>
  136. <if test="swhsLat != null and swhsLat != ''">and SWHS_LAT = #{swhsLat}</if>
  137. <if test="adCode != null and adCode != ''">and ad_Code like '${adCode}%'</if>
  138. <if test="swhsLoc != null and swhsLoc != ''">and SWHS_LOC = #{swhsLoc}</if>
  139. <if test="wainWasoType != null and wainWasoType != ''">and WAIN_WASO_TYPE = #{wainWasoType}</if>
  140. <if test="watArea != null and watArea != ''">and WAT_AREA = #{watArea}</if>
  141. <if test="wainNum != null and wainNum != ''">and WAIN_NUM = #{wainNum}</if>
  142. <if test="wainUse != null and wainUse != ''">and WAIN_USE = #{wainUse}</if>
  143. <if test="wasuObjType != null and wasuObjType != ''">and WASU_OBJ_TYPE = #{wasuObjType}</if>
  144. <if test="wasuTownName != null and wasuTownName != ''">and WASU_TOWN_NAME = #{wasuTownName}</if>
  145. <if test="wasuTownName2 != null and wasuTownName2 != ''">and WASU_TOWN_NAME_2 = #{wasuTownName2}</if>
  146. <if test="wasuTownName3 != null and wasuTownName3 != ''">and WASU_TOWN_NAME_3 = #{wasuTownName3}</if>
  147. <if test="desAnnWain != null and desAnnWain != ''">and DES_ANN_WAIN = #{desAnnWain}</if>
  148. <if test="desAnnWasuPop != null and desAnnWasuPop != ''">and DES_ANN_WASU_POP = #{desAnnWasuPop}</if>
  149. <if test="runYear != null and runYear != ''">and RUN_YEAR = #{runYear}</if>
  150. <if test="wintRvName != null and wintRvName != ''">and WINT_RV_NAME = #{wintRvName}</if>
  151. <if test="wintLakeName != null and wintLakeName != ''">and WINT_LAKE_NAME = #{wintLakeName}</if>
  152. <if test="wintRsName != null and wintRsName != ''">and WINT_RS_NAME = #{wintRsName}</if>
  153. <if test="waquGoal != null and waquGoal != ''">and WAQU_GOAL = #{waquGoal}</if>
  154. <if test="ifMonWqua != null and ifMonWqua != ''">and IF_MON_WQUA = #{ifMonWqua}</if>
  155. <if test="wquaCat != null and wquaCat != ''">and WQUA_CAT = #{wquaCat}</if>
  156. <if test="ifWquaUptoSta != null and ifWquaUptoSta != ''">and IF_WQUA_UPTO_STA = #{ifWquaUptoSta}</if>
  157. <if test="ifWsProt != null and ifWsProt != ''">and IF_WS_PROT = #{ifWsProt}</if>
  158. <if test="watArea1stProt != null and watArea1stProt != ''">and WAT_AREA_1ST_PROT = #{watArea1stProt}</if>
  159. <if test="landArea1stProt != null and landArea1stProt != ''">and LAND_AREA_1ST_PROT = #{landArea1stProt}
  160. </if>
  161. <if test="watArea2ndProt != null and watArea2ndProt != ''">and WAT_AREA_2ND_PROT = #{watArea2ndProt}</if>
  162. <if test="landArea2ndProt != null and landArea2ndProt != ''">and LAND_AREA_2ND_PROT = #{landArea2ndProt}
  163. </if>
  164. <if test="qusProt != null and qusProt != ''">and QUS_PROT = #{qusProt}</if>
  165. <if test="insName != null and insName != ''">and INS_NAME = #{insName}</if>
  166. <if test="tra != null and tra != ''">and TRA = #{tra}</if>
  167. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  168. <if test="note != null and note != ''">and NOTE = #{note}</if>
  169. <if test="effDate != null">and EFF_DATE = #{effDate}</if>
  170. <if test="exprDate != null">and EXPR_DATE = #{exprDate}</if>
  171. <if test="swhsLongGd != null and swhsLongGd != ''">and SWHS_LONG_GD = #{swhsLongGd}</if>
  172. <if test="swhsLatGd != null and swhsLatGd != ''">and SWHS_LAT_GD = #{swhsLatGd}</if>
  173. <if test="displayLevel != null and displayLevel != ''">and DISPLAY_LEVEL = #{displayLevel}</if>
  174. </trim>
  175. </sql>
  176. <select id="get" resultMap="attSwhsBaseResultMap" parameterType="String">
  177. select
  178. <include refid="table_columns"/>
  179. from ATT_SWHS_BASE where ID = #{id}
  180. </select>
  181. <select id="getBy" resultMap="attSwhsBaseResultMap">
  182. select
  183. <include refid="table_columns"/>
  184. from ATT_SWHS_BASE
  185. <include refid="page_where"/>
  186. </select>
  187. <select id="findAll" resultMap="attSwhsBaseResultMap">
  188. select
  189. <include refid="table_columns"/>
  190. from ATT_SWHS_BASE
  191. </select>
  192. <select id="findList" resultMap="attSwhsBaseResultMap">
  193. select
  194. <include refid="table_columns"/>
  195. from ATT_SWHS_BASE
  196. <include refid="page_where"/>
  197. </select>
  198. <select id="selectCount" resultType="int">
  199. select count(ID) from ATT_SWHS_BASE
  200. <include refid="page_where"/>
  201. </select>
  202. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttSwhsBase">
  203. insert into ATT_SWHS_BASE(
  204. <include refid="table_columns"/>
  205. )
  206. values (
  207. <include refid="entity_properties"/>
  208. )
  209. </insert>
  210. <delete id="delete" parameterType="java.lang.String">
  211. delete from ATT_SWHS_BASE where ID = #{id}
  212. </delete>
  213. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttSwhsBase">
  214. delete from ATT_SWHS_BASE
  215. <include refid="page_where"/>
  216. </delete>
  217. <update id="deleteInFlag" parameterType="java.lang.String">
  218. update ATT_SWHS_BASE set flag_valid = 0 where ID = #{id}
  219. </update>
  220. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttSwhsBase">
  221. update ATT_SWHS_BASE
  222. <trim prefix="set" suffixOverrides=",">
  223. <if test="swhsCode != null and swhsCode != ''">SWHS_CODE = #{swhsCode},</if>
  224. <if test="swhsName != null and swhsName != ''">SWHS_NAME = #{swhsName},</if>
  225. <if test="swhsLong != null and swhsLong != ''">SWHS_LONG = #{swhsLong},</if>
  226. <if test="swhsLat != null and swhsLat != ''">SWHS_LAT = #{swhsLat},</if>
  227. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  228. <if test="swhsLoc != null and swhsLoc != ''">SWHS_LOC = #{swhsLoc},</if>
  229. <if test="wainWasoType != null and wainWasoType != ''">WAIN_WASO_TYPE = #{wainWasoType},</if>
  230. <if test="watArea != null and watArea != ''">WAT_AREA = #{watArea},</if>
  231. <if test="wainNum != null and wainNum != ''">WAIN_NUM = #{wainNum},</if>
  232. <if test="wainUse != null and wainUse != ''">WAIN_USE = #{wainUse},</if>
  233. <if test="wasuObjType != null and wasuObjType != ''">WASU_OBJ_TYPE = #{wasuObjType},</if>
  234. <if test="wasuTownName != null and wasuTownName != ''">WASU_TOWN_NAME = #{wasuTownName},</if>
  235. <if test="wasuTownName2 != null and wasuTownName2 != ''">WASU_TOWN_NAME_2 = #{wasuTownName2},</if>
  236. <if test="wasuTownName3 != null and wasuTownName3 != ''">WASU_TOWN_NAME_3 = #{wasuTownName3},</if>
  237. <if test="desAnnWain != null and desAnnWain != ''">DES_ANN_WAIN = #{desAnnWain},</if>
  238. <if test="desAnnWasuPop != null and desAnnWasuPop != ''">DES_ANN_WASU_POP = #{desAnnWasuPop},</if>
  239. <if test="runYear != null and runYear != ''">RUN_YEAR = #{runYear},</if>
  240. <if test="wintRvName != null and wintRvName != ''">WINT_RV_NAME = #{wintRvName},</if>
  241. <if test="wintLakeName != null and wintLakeName != ''">WINT_LAKE_NAME = #{wintLakeName},</if>
  242. <if test="wintRsName != null and wintRsName != ''">WINT_RS_NAME = #{wintRsName},</if>
  243. <if test="waquGoal != null and waquGoal != ''">WAQU_GOAL = #{waquGoal},</if>
  244. <if test="ifMonWqua != null and ifMonWqua != ''">IF_MON_WQUA = #{ifMonWqua},</if>
  245. <if test="wquaCat != null and wquaCat != ''">WQUA_CAT = #{wquaCat},</if>
  246. <if test="ifWquaUptoSta != null and ifWquaUptoSta != ''">IF_WQUA_UPTO_STA = #{ifWquaUptoSta},</if>
  247. <if test="ifWsProt != null and ifWsProt != ''">IF_WS_PROT = #{ifWsProt},</if>
  248. <if test="watArea1stProt != null and watArea1stProt != ''">WAT_AREA_1ST_PROT = #{watArea1stProt},</if>
  249. <if test="landArea1stProt != null and landArea1stProt != ''">LAND_AREA_1ST_PROT = #{landArea1stProt},</if>
  250. <if test="watArea2ndProt != null and watArea2ndProt != ''">WAT_AREA_2ND_PROT = #{watArea2ndProt},</if>
  251. <if test="landArea2ndProt != null and landArea2ndProt != ''">LAND_AREA_2ND_PROT = #{landArea2ndProt},</if>
  252. <if test="qusProt != null and qusProt != ''">QUS_PROT = #{qusProt},</if>
  253. <if test="insName != null and insName != ''">INS_NAME = #{insName},</if>
  254. <if test="tra != null and tra != ''">TRA = #{tra},</if>
  255. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  256. <if test="note != null and note != ''">NOTE = #{note},</if>
  257. <if test="effDate != null">EFF_DATE = #{effDate},</if>
  258. <if test="exprDate != null">EXPR_DATE = #{exprDate},</if>
  259. <if test="swhsLongGd != null and swhsLongGd != ''">SWHS_LONG_GD = #{swhsLongGd},</if>
  260. <if test="swhsLatGd != null and swhsLatGd != ''">SWHS_LAT_GD = #{swhsLatGd},</if>
  261. <if test="displayLevel != null and displayLevel != ''">DISPLAY_LEVEL = #{displayLevel},</if>
  262. </trim>
  263. <where>ID = #{id}</where>
  264. </update>
  265. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttSwhsBase">
  266. update ATT_SWHS_BASE
  267. <trim prefix="set" suffixOverrides=",">
  268. <if test="swhsCode != null and swhsCode != ''">SWHS_CODE = #{swhsCode},</if>
  269. <if test="swhsName != null and swhsName != ''">SWHS_NAME = #{swhsName},</if>
  270. <if test="swhsLong != null and swhsLong != ''">SWHS_LONG = #{swhsLong},</if>
  271. <if test="swhsLat != null and swhsLat != ''">SWHS_LAT = #{swhsLat},</if>
  272. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  273. <if test="swhsLoc != null and swhsLoc != ''">SWHS_LOC = #{swhsLoc},</if>
  274. <if test="wainWasoType != null and wainWasoType != ''">WAIN_WASO_TYPE = #{wainWasoType},</if>
  275. <if test="watArea != null and watArea != ''">WAT_AREA = #{watArea},</if>
  276. <if test="wainNum != null and wainNum != ''">WAIN_NUM = #{wainNum},</if>
  277. <if test="wainUse != null and wainUse != ''">WAIN_USE = #{wainUse},</if>
  278. <if test="wasuObjType != null and wasuObjType != ''">WASU_OBJ_TYPE = #{wasuObjType},</if>
  279. <if test="wasuTownName != null and wasuTownName != ''">WASU_TOWN_NAME = #{wasuTownName},</if>
  280. <if test="wasuTownName2 != null and wasuTownName2 != ''">WASU_TOWN_NAME_2 = #{wasuTownName2},</if>
  281. <if test="wasuTownName3 != null and wasuTownName3 != ''">WASU_TOWN_NAME_3 = #{wasuTownName3},</if>
  282. <if test="desAnnWain != null and desAnnWain != ''">DES_ANN_WAIN = #{desAnnWain},</if>
  283. <if test="desAnnWasuPop != null and desAnnWasuPop != ''">DES_ANN_WASU_POP = #{desAnnWasuPop},</if>
  284. <if test="runYear != null and runYear != ''">RUN_YEAR = #{runYear},</if>
  285. <if test="wintRvName != null and wintRvName != ''">WINT_RV_NAME = #{wintRvName},</if>
  286. <if test="wintLakeName != null and wintLakeName != ''">WINT_LAKE_NAME = #{wintLakeName},</if>
  287. <if test="wintRsName != null and wintRsName != ''">WINT_RS_NAME = #{wintRsName},</if>
  288. <if test="waquGoal != null and waquGoal != ''">WAQU_GOAL = #{waquGoal},</if>
  289. <if test="ifMonWqua != null and ifMonWqua != ''">IF_MON_WQUA = #{ifMonWqua},</if>
  290. <if test="wquaCat != null and wquaCat != ''">WQUA_CAT = #{wquaCat},</if>
  291. <if test="ifWquaUptoSta != null and ifWquaUptoSta != ''">IF_WQUA_UPTO_STA = #{ifWquaUptoSta},</if>
  292. <if test="ifWsProt != null and ifWsProt != ''">IF_WS_PROT = #{ifWsProt},</if>
  293. <if test="watArea1stProt != null and watArea1stProt != ''">WAT_AREA_1ST_PROT = #{watArea1stProt},</if>
  294. <if test="landArea1stProt != null and landArea1stProt != ''">LAND_AREA_1ST_PROT = #{landArea1stProt},</if>
  295. <if test="watArea2ndProt != null and watArea2ndProt != ''">WAT_AREA_2ND_PROT = #{watArea2ndProt},</if>
  296. <if test="landArea2ndProt != null and landArea2ndProt != ''">LAND_AREA_2ND_PROT = #{landArea2ndProt},</if>
  297. <if test="qusProt != null and qusProt != ''">QUS_PROT = #{qusProt},</if>
  298. <if test="insName != null and insName != ''">INS_NAME = #{insName},</if>
  299. <if test="tra != null and tra != ''">TRA = #{tra},</if>
  300. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  301. <if test="note != null and note != ''">NOTE = #{note},</if>
  302. <if test="effDate != null">EFF_DATE = #{effDate},</if>
  303. <if test="exprDate != null">EXPR_DATE = #{exprDate},</if>
  304. <if test="swhsLongGd != null and swhsLongGd != ''">SWHS_LONG_GD = #{swhsLongGd},</if>
  305. <if test="swhsLatGd != null and swhsLatGd != ''">SWHS_LAT_GD = #{swhsLatGd},</if>
  306. <if test="displayLevel != null and displayLevel != ''">DISPLAY_LEVEL = #{displayLevel},</if>
  307. </trim>
  308. <include refid="page_where"/>
  309. </update>
  310. <!-- 其他自定义SQL -->
  311. <select id="getMaxCwsCode" resultType="string" parameterType="string">
  312. select MAX(swhs_Code) as swhsCode from ATT_SWHS_BASE e where e.ad_code LIKE concat(#{adCode},'%')
  313. </select>
  314. <select id="findListBy" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  315. resultType="cn.com.goldenwater.dcproj.model.AttSwhsBase">
  316. SELECT ID,
  317. SWHS_CODE,
  318. SWHS_NAME,
  319. SWHS_LONG,
  320. SWHS_LAT,
  321. AD_CODE,
  322. SWHS_LOC,
  323. WAIN_WASO_TYPE,
  324. WAT_AREA,
  325. WAIN_NUM,
  326. WAIN_USE,
  327. WASU_OBJ_TYPE,
  328. WASU_TOWN_NAME,
  329. WASU_TOWN_NAME_2,
  330. WASU_TOWN_NAME_3,
  331. DES_ANN_WAIN,
  332. DES_ANN_WASU_POP,
  333. RUN_YEAR,
  334. WINT_RV_NAME,
  335. WINT_LAKE_NAME,
  336. WINT_RS_NAME,
  337. WAQU_GOAL,
  338. IF_MON_WQUA,
  339. WQUA_CAT,
  340. IF_WQUA_UPTO_STA,
  341. IF_WS_PROT,
  342. WAT_AREA_1ST_PROT,
  343. LAND_AREA_1ST_PROT,
  344. WAT_AREA_2ND_PROT,
  345. LAND_AREA_2ND_PROT,
  346. QUS_PROT,
  347. INS_NAME,
  348. TRA,
  349. PERS_ID,
  350. NOTE,
  351. EFF_DATE,
  352. EXPR_DATE,
  353. SWHS_LONG_GD,
  354. SWHS_LAT_GD,
  355. DISPLAY_LEVEL FROM ATT_SWHS_BASE WHERE 1 = 1
  356. <if test="adCode != null and adCode != ''">and AD_CODE LIKE '${adCode}%'</if>
  357. <if test="stnm != null and stnm != ''">and SWHS_NAME LIKE '%${stnm}%'</if>
  358. <if test="desAnnWasuPop != null and desAnnWasuPop != ''">and DES_ANN_WASU_POP &gt;= #{desAnnWasuPop}</if>
  359. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and SWHS_LONG BETWEEN
  360. #{minLgtd} AND #{maxLgtd}
  361. </if>
  362. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and SWHS_LAT BETWEEN
  363. #{minLttd} AND #{maxLttd}
  364. </if>
  365. <if test="displayLevel != null and displayLevel != ''">and cast(DISPLAY_LEVEL as signed) &lt;=
  366. cast(#{displayLevel} as signed)
  367. </if>
  368. </select>
  369. <sql id="orgIdSql">
  370. <choose>
  371. <when test="orgId !=null and orgId !=''">
  372. and ORG_ID=#{orgId}
  373. </when>
  374. <otherwise>
  375. and ORG_ID is null
  376. </otherwise>
  377. </choose>
  378. </sql>
  379. <select id="getObjByPersId" resultType="cn.com.goldenwater.dcproj.model.AttSwhsBase" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam">
  380. SELECT A.* ,B.OBJ_ID,B.ID groupId,C.ID rgstrId FROM ATT_SWHS_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.id = B.CODE
  381. LEFT JOIN BIS_INSP_SWHS_RGSTR C ON B.OBJ_ID = C.OBJ_ID
  382. WHERE B.PTYPE = #{objType} AND
  383. B.id in (${inIdsSql})
  384. <if test="adName != null and adName != ''">and A.SWHS_NAME LIKE '%${adName}%'</if>
  385. <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
  386. </select>
  387. <update id="updateLevelByCode" parameterType="cn.com.goldenwater.dcproj.model.AttSwhsBase">
  388. update ATT_SWHS_BASE set DISPLAY_LEVEL = #{displayLevel} where SWHS_CODE = #{swhsCode}
  389. </update>
  390. <select id="getObjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttSwhsBase" parameterType="String">
  391. select t.*
  392. from ATT_SWHS_BASE t
  393. where t.id not in (
  394. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%') and B.obj_type=#{objType}
  395. <choose>
  396. <when test="province !=null and province !=''">
  397. and B.AD_CODE =#{province}
  398. </when>
  399. <otherwise>
  400. and B.AD_CODE is null
  401. </otherwise>
  402. </choose>
  403. )
  404. <if test="adName != null and adName != ''">and t.nm LIKE '%${adName}%'</if>
  405. <if test="adCode != null and adCode != ''">and t.AD_CODE LIKE '${adCode}%'</if>
  406. </select>
  407. </mapper>