AttAdXBaseDao.xml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  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.AttAdXBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttAdXBase" id="attAdXBaseResultMap">
  5. <result property="isPoveryt" column="IS_POVERYT"/>
  6. <result property="src" column="SRC"/>
  7. <result property="remark" column="REMARK"/>
  8. <result property="guid" column="GUID"/>
  9. <result property="adCode" column="AD_CODE"/>
  10. <result property="adName" column="AD_NAME"/>
  11. <result property="lowLeftLong" column="LOW_LEFT_LONG"/>
  12. <result property="lowLeftLat" column="LOW_LEFT_LAT"/>
  13. <result property="upRightLong" column="UP_RIGHT_LONG"/>
  14. <result property="upRightLat" column="UP_RIGHT_LAT"/>
  15. <result property="upAdName" column="UP_AD_NAME"/>
  16. <result property="adGrad" column="AD_GRAD"/>
  17. <result property="adAbbrName" column="AD_ABBR_NAME"/>
  18. <result property="adStat" column="AD_STAT"/>
  19. <result property="adArea" column="AD_AREA"/>
  20. <result property="adFullName" column="AD_FULL_NAME"/>
  21. <result property="note" column="NOTE"/>
  22. <result property="effDate" column="EFF_DATE"/>
  23. <result property="exprDate" column="EXPR_DATE"/>
  24. <result property="adStatLong" column="AD_STAT_LONG"/>
  25. <result property="adStatLat" column="AD_STAT_LAT"/>
  26. <result property="domainCode" column="DOMAIN_CODE"/>
  27. <result property="adSign" column="AD_SIGN"/>
  28. <result property="modifierPeople" column="MODIFIER_PEOPLE"/>
  29. <result property="updDate" column="UPD_DATE"/>
  30. <result property="isReport" column="IS_REPORT"/>
  31. <result property="adFcode" column="AD_FCODE"/>
  32. <result property="lgtd" column="LGTD"/>
  33. <result property="lttd" column="LTTD"/>
  34. <result property="lgtdpc" column="LGTDPC"/>
  35. <result property="lttdpc" column="LTTDPC"/>
  36. </resultMap>
  37. <sql id="table_columns">
  38. IS_POVERYT ,
  39. SRC ,
  40. REMARK ,
  41. LGTD ,
  42. LTTD ,
  43. LGTDPC ,
  44. LTTDPC ,
  45. GUID ,
  46. AD_CODE ,
  47. AD_NAME ,
  48. LOW_LEFT_LONG ,
  49. LOW_LEFT_LAT ,
  50. UP_RIGHT_LONG ,
  51. UP_RIGHT_LAT ,
  52. UP_AD_NAME ,
  53. AD_GRAD ,
  54. AD_ABBR_NAME ,
  55. AD_STAT ,
  56. AD_AREA ,
  57. AD_FULL_NAME ,
  58. NOTE ,
  59. TO_CHAR(EFF_DATE,'YYYY-MM-DD HH24:MI:SS') EFF_DATE,
  60. TO_CHAR(EXPR_DATE,'YYYY-MM-DD HH24:MI:SS') EXPR_DATE,
  61. AD_STAT_LONG ,
  62. AD_STAT_LAT ,
  63. DOMAIN_CODE ,
  64. AD_SIGN ,
  65. MODIFIER_PEOPLE ,
  66. TO_CHAR(UPD_DATE,'YYYY-MM-DD HH24:MI:SS') UPD_DATE,
  67. IS_REPORT ,
  68. AD_FCODE
  69. </sql>
  70. <sql id="table_columns2">
  71. IS_POVERYT ,
  72. SRC ,
  73. REMARK ,
  74. LGTD ,
  75. LTTD ,
  76. LGTDPC ,
  77. LTTDPC ,
  78. GUID ,
  79. AD_CODE ,
  80. AD_NAME ,
  81. LOW_LEFT_LONG ,
  82. LOW_LEFT_LAT ,
  83. UP_RIGHT_LONG ,
  84. UP_RIGHT_LAT ,
  85. UP_AD_NAME ,
  86. AD_GRAD ,
  87. AD_ABBR_NAME ,
  88. AD_STAT ,
  89. AD_AREA ,
  90. AD_FULL_NAME ,
  91. NOTE ,
  92. EFF_DATE ,
  93. EXPR_DATE ,
  94. AD_STAT_LONG ,
  95. AD_STAT_LAT ,
  96. DOMAIN_CODE ,
  97. AD_SIGN ,
  98. MODIFIER_PEOPLE ,
  99. UPD_DATE ,
  100. IS_REPORT ,
  101. AD_FCODE
  102. </sql>
  103. <sql id="entity_properties">
  104. #{isPoveryt},
  105. #{src},
  106. #{remark},
  107. #{lgtd},
  108. #{lttd},
  109. #{lgtdpc},
  110. #{lttdpc},
  111. #{guid},
  112. #{adCode},
  113. #{adName},
  114. #{lowLeftLong},
  115. #{lowLeftLat},
  116. #{upRightLong},
  117. #{upRightLat},
  118. #{upAdName},
  119. #{adGrad},
  120. #{adAbbrName},
  121. #{adStat},
  122. #{adArea},
  123. #{adFullName},
  124. #{note},
  125. TO_DATE(#{effDate},'YYYY-MM-DD HH24:MI:SS') ,
  126. TO_DATE(#{exprDate},'YYYY-MM-DD HH24:MI:SS') ,
  127. #{adStatLong},
  128. #{adStatLat},
  129. #{domainCode},
  130. #{adSign},
  131. #{modifierPeople},
  132. TO_DATE(#{updDate},'YYYY-MM-DD HH24:MI:SS') ,
  133. #{isReport},
  134. #{adFcode}
  135. </sql>
  136. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  137. <sql id="page_where">
  138. <trim prefix="where" prefixOverrides="and | or ">
  139. <if test="isPoveryt == '1'.toString() or isPoveryt == '0'.toString()">and IS_POVERYT = #{isPoveryt}</if>
  140. <if test="isPoveryt == '2'.toString()">and IS_POVERYT IS NULL</if>
  141. <if test="src != null and src != ''">and SRC = #{src}</if>
  142. <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
  143. <if test="lgtd != null and lgtd != ''">and LGTD = #{lgtd}</if>
  144. <if test="lttd != null and lttd != ''">and LTTD = #{lttd}</if>
  145. <if test="lgtdpc != null and lgtdpc != ''">and LGTDPC = #{lgtdpc}</if>
  146. <if test="lttdpc != null and lttdpc != ''">and LTTDPC = #{lttdpc}</if>
  147. <if test="guid != null and guid != ''">and GUID = #{guid}</if>
  148. <if test="adCode != null and adCode != ''">and AD_CODE like '${adCode}%'</if>
  149. <if test="adName != null and adName != ''">and AD_NAME LIKE '%'||#{adName}||'%'</if>
  150. <if test="lowLeftLong != null and lowLeftLong != ''">and LOW_LEFT_LONG = #{lowLeftLong}</if>
  151. <if test="lowLeftLat != null and lowLeftLat != ''">and LOW_LEFT_LAT = #{lowLeftLat}</if>
  152. <if test="upRightLong != null and upRightLong != ''">and UP_RIGHT_LONG = #{upRightLong}</if>
  153. <if test="upRightLat != null and upRightLat != ''">and UP_RIGHT_LAT = #{upRightLat}</if>
  154. <if test="upAdName != null and upAdName != ''">and UP_AD_NAME LIKE '%'||#{upAdName}||'%'</if>
  155. <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
  156. <if test="adAbbrName != null and adAbbrName != ''">and AD_ABBR_NAME LIKE '%'||#{adAbbrName}||'%'</if>
  157. <if test="adStat != null and adStat != ''">and AD_STAT = #{adStat}</if>
  158. <if test="adArea != null and adArea != ''">and AD_AREA = #{adArea}</if>
  159. <if test="adFullName != null and adFullName != ''">and AD_FULL_NAME LIKE '%'||#{adFullName}||'%'</if>
  160. <if test="note != null and note != ''">and NOTE = #{note}</if>
  161. <if test="effDate != null and effDate != ''">and EFF_DATE = TO_DATE(#{effDate},'YYYY-MM-DD HH24:MI:SS')</if>
  162. <if test="exprDate != null and exprDate != ''">and EXPR_DATE = TO_DATE(#{exprDate},'YYYY-MM-DD
  163. HH24:MI:SS')
  164. </if>
  165. <if test="adStatLong != null and adStatLong != ''">and AD_STAT_LONG = #{adStatLong}</if>
  166. <if test="adStatLat != null and adStatLat != ''">and AD_STAT_LAT = #{adStatLat}</if>
  167. <if test="domainCode != null and domainCode != ''">and DOMAIN_CODE = #{domainCode}</if>
  168. <if test="adSign != null and adSign != ''">and AD_SIGN = #{adSign}</if>
  169. <if test="modifierPeople != null and modifierPeople != ''">and MODIFIER_PEOPLE = #{modifierPeople}</if>
  170. <if test="updDate != null and updDate != ''">and UPD_DATE = TO_DATE(#{updDate},'YYYY-MM-DD HH24:MI:SS')</if>
  171. <if test="isReport != null and isReport != ''">and IS_REPORT = #{isReport}</if>
  172. <if test="adFcode != null and adFcode != ''">and AD_FCODE = #{adFcode}</if>
  173. <if test="province != null and province != ''">and AD_CODE like '${province}%'</if>
  174. AND EXPR_DATE IS NULL
  175. </trim>
  176. </sql>
  177. <select id="get" resultMap="attAdXBaseResultMap" parameterType="String">
  178. select
  179. <include refid="table_columns"/>
  180. from ATT_AD_X_BASE where AD_CODE = #{id}
  181. </select>
  182. <select id="getBy" resultMap="attAdXBaseResultMap">
  183. select
  184. <include refid="table_columns"/>
  185. from ATT_AD_X_BASE
  186. <include refid="page_where"/>
  187. </select>
  188. <select id="findAll" resultMap="attAdXBaseResultMap">
  189. select
  190. <include refid="table_columns"/>
  191. from ATT_AD_X_BASE
  192. </select>
  193. <select id="findList" resultMap="attAdXBaseResultMap">
  194. select
  195. <include refid="table_columns"/>
  196. from ATT_AD_X_BASE
  197. <include refid="page_where"/>
  198. order by UPD_DATE DESC,AD_CODE
  199. </select>
  200. <select id="selectCount" resultType="int">
  201. select count(GUID) from ATT_AD_X_BASE
  202. <include refid="page_where"/>
  203. </select>
  204. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  205. insert into ATT_AD_X_BASE(
  206. <include refid="table_columns2"/>
  207. )
  208. values (
  209. <include refid="entity_properties"/>
  210. )
  211. </insert>
  212. <delete id="delete" parameterType="java.lang.String">
  213. delete from ATT_AD_X_BASE where GUID = #{id}
  214. </delete>
  215. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  216. delete from ATT_AD_X_BASE
  217. <include refid="page_where"/>
  218. </delete>
  219. <update id="deleteInFlag" parameterType="java.lang.String">
  220. update ATT_AD_X_BASE set flag_valid = 0 where GUID = #{id}
  221. </update>
  222. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  223. update ATT_AD_X_BASE
  224. <trim prefix="set" suffixOverrides=",">
  225. <if test="isPoveryt != null and isPoveryt != ''">IS_POVERYT = #{isPoveryt},</if>
  226. <if test="src != null and src != ''">SRC = #{src},</if>
  227. <if test="remark != null and remark != ''">REMARK = #{remark},</if>
  228. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  229. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  230. <if test="lgtdpc != null and lgtdpc != ''">LGTDPC = #{lgtdpc},</if>
  231. <if test="lttdpc != null and lttdpc != ''">LTTDPC = #{lttdpc},</if>
  232. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  233. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  234. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  235. <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
  236. <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
  237. <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
  238. <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
  239. <if test="upAdName != null and upAdName != ''">UP_AD_NAME = #{upAdName},</if>
  240. <if test="adGrad != null and adGrad != ''">AD_GRAD = #{adGrad},</if>
  241. <if test="adAbbrName != null and adAbbrName != ''">AD_ABBR_NAME = #{adAbbrName},</if>
  242. <if test="adStat != null and adStat != ''">AD_STAT = #{adStat},</if>
  243. <if test="adArea != null and adArea != ''">AD_AREA = #{adArea},</if>
  244. <if test="adFullName != null and adFullName != ''">AD_FULL_NAME = #{adFullName},</if>
  245. <if test="note != null and note != ''">NOTE = #{note},</if>
  246. <if test="effDate != null and effDate != ''">EFF_DATE = TO_DATE(#{effDate},'YYYY-MM-DD HH24:MI:SS'),</if>
  247. <if test="exprDate != null and exprDate != ''">EXPR_DATE = TO_DATE(#{exprDate},'YYYY-MM-DD HH24:MI:SS'),
  248. </if>
  249. <if test="adStatLong != null and adStatLong != ''">AD_STAT_LONG = #{adStatLong},</if>
  250. <if test="adStatLat != null and adStatLat != ''">AD_STAT_LAT = #{adStatLat},</if>
  251. <if test="domainCode != null and domainCode != ''">DOMAIN_CODE = #{domainCode},</if>
  252. <if test="adSign != null and adSign != ''">AD_SIGN = #{adSign},</if>
  253. <if test="modifierPeople != null and modifierPeople != ''">MODIFIER_PEOPLE = #{modifierPeople},</if>
  254. <if test="updDate != null and updDate != ''">UPD_DATE = TO_DATE(#{updDate},'YYYY-MM-DD HH24:MI:SS'),</if>
  255. <if test="isReport != null and isReport != ''">IS_REPORT = #{isReport},</if>
  256. <if test="adFcode != null and adFcode != ''">AD_FCODE = #{adFcode},</if>
  257. </trim>
  258. <where>GUID = #{guid}</where>
  259. </update>
  260. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  261. update ATT_AD_X_BASE
  262. <trim prefix="set" suffixOverrides=",">
  263. <if test="isPoveryt != null and isPoveryt != ''">IS_POVERYT = #{isPoveryt},</if>
  264. <if test="src != null and src != ''">SRC = #{src},</if>
  265. <if test="remark != null and remark != ''">REMARK = #{remark},</if>
  266. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  267. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  268. <if test="lgtdpc != null and lgtdpc != ''">LGTDPC = #{lgtdpc},</if>
  269. <if test="lttdpc != null and lttdpc != ''">LTTDPC = #{lttdpc},</if>
  270. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  271. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  272. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  273. <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
  274. <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
  275. <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
  276. <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
  277. <if test="upAdName != null and upAdName != ''">UP_AD_NAME = #{upAdName},</if>
  278. <if test="adGrad != null and adGrad != ''">AD_GRAD = #{adGrad},</if>
  279. <if test="adAbbrName != null and adAbbrName != ''">AD_ABBR_NAME = #{adAbbrName},</if>
  280. <if test="adStat != null and adStat != ''">AD_STAT = #{adStat},</if>
  281. <if test="adArea != null and adArea != ''">AD_AREA = #{adArea},</if>
  282. <if test="adFullName != null and adFullName != ''">AD_FULL_NAME = #{adFullName},</if>
  283. <if test="note != null and note != ''">NOTE = #{note},</if>
  284. <if test="effDate != null and effDate != ''">EFF_DATE = TO_DATE(#{effDate},'YYYY-MM-DD HH24:MI:SS'),</if>
  285. <if test="exprDate != null and exprDate != ''">EXPR_DATE = TO_DATE(#{exprDate},'YYYY-MM-DD HH24:MI:SS'),
  286. </if>
  287. <if test="adStatLong != null and adStatLong != ''">AD_STAT_LONG = #{adStatLong},</if>
  288. <if test="adStatLat != null and adStatLat != ''">AD_STAT_LAT = #{adStatLat},</if>
  289. <if test="domainCode != null and domainCode != ''">DOMAIN_CODE = #{domainCode},</if>
  290. <if test="adSign != null and adSign != ''">AD_SIGN = #{adSign},</if>
  291. <if test="modifierPeople != null and modifierPeople != ''">MODIFIER_PEOPLE = #{modifierPeople},</if>
  292. <if test="updDate != null and updDate != ''">UPD_DATE = TO_DATE(#{updDate},'YYYY-MM-DD HH24:MI:SS'),</if>
  293. <if test="isReport != null and isReport != ''">IS_REPORT = #{isReport},</if>
  294. <if test="adFcode != null and adFcode != ''">AD_FCODE = #{adFcode},</if>
  295. </trim>
  296. <include refid="page_where"/>
  297. </update>
  298. <!-- 使用like用法:columnName like '%'||#{columnName}||'%' -->
  299. <sql id="page_where_extend">
  300. <trim prefix="where" prefixOverrides="and | or ">
  301. <if test="isPoveryt != null and isPoveryt != ''">
  302. <choose>
  303. <when test="isPoveryt == 1">
  304. and IS_POVERYT = '1'
  305. </when>
  306. <otherwise>
  307. and IS_POVERYT is null or is_poveryt != '1'
  308. </otherwise>
  309. </choose>
  310. </if>
  311. <if test="src != null and src != ''">and SRC like '%'||#{src}||'%'</if>
  312. <if test="remark != null and remark != ''">and REMARK like '%'||#{remark}||'%'</if>
  313. <if test="lgtd != null and lgtd != ''">and LGTD like '%'||#{lgtd}||'%'</if>
  314. <if test="lttd != null and lttd != ''">and LTTD like '%'||#{lttd}||'%'</if>
  315. <if test="lgtdpc != null and lgtdpc != ''">and LGTDPC like '%'||#{lgtdpc}||'%'</if>
  316. <if test="lttdpc != null and lttdpc != ''">and LTTDPC like '%'||#{lttdpc}||'%'</if>
  317. <if test="guid != null and guid != ''">and GUID like '%'||#{guid}||'%'</if>
  318. <if test="adCode != null and adCode != ''">and AD_CODE like #{adCode}||'%'</if>
  319. <if test="adName != null and adName != ''">
  320. and (AD_NAME LIKE '%'||#{adName}||'%' OR AD_CODE LIKE #{adName}||'%')
  321. </if>
  322. <if test="lowLeftLong != null and lowLeftLong != ''">and LOW_LEFT_LONG like '%'||#{lowLeftLong}||'%'</if>
  323. <if test="lowLeftLat != null and lowLeftLat != ''">and LOW_LEFT_LAT like '%'||#{lowLeftLat}||'%'</if>
  324. <if test="upRightLong != null and upRightLong != ''">and UP_RIGHT_LONG like '%'||#{upRightLong}||'%'</if>
  325. <if test="upRightLat != null and upRightLat != ''">and UP_RIGHT_LAT like '%'||#{upRightLat}||'%'</if>
  326. <if test="upAdName != null and upAdName != ''">and UP_AD_NAME LIKE '%'||#{upAdName}||'%'||'%'</if>
  327. <if test="adGrad != null and adGrad != ''">
  328. and instr(#{adGrad},AD_GRAD) > 0
  329. </if>
  330. <if test="adAbbrName != null and adAbbrName != ''">and AD_ABBR_NAME LIKE '%'||#{adAbbrName}||'%'||'%'</if>
  331. <if test="adStat != null and adStat != ''">and AD_STAT like '%'||#{adStat}||'%'</if>
  332. <if test="adArea != null and adArea != ''">and AD_AREA like '%'||#{adArea}||'%'</if>
  333. <if test="adFullName != null and adFullName != ''">and AD_FULL_NAMELIKE '%'||#{adFullName}||'%'||'%'</if>
  334. <if test="note != null and note != ''">and NOTE like '%'||#{note}||'%'</if>
  335. <if test="effDate != null and effDate != ''">and EFF_DATE = TO_DATE(#{effDate}||'%','YYYY-MM-DD
  336. HH24:MI:SS')
  337. </if>
  338. <if test="exprDate != null and exprDate != ''">and EXPR_DATE = TO_DATE(#{exprDate}||'%','YYYY-MM-DD
  339. HH24:MI:SS')
  340. </if>
  341. <if test="adStatLong != null and adStatLong != ''">and AD_STAT_LONG like '%'||#{adStatLong}||'%'</if>
  342. <if test="adStatLat != null and adStatLat != ''">and AD_STAT_LAT like '%'||#{adStatLat}||'%'</if>
  343. <if test="domainCode != null and domainCode != ''">and DOMAIN_CODE like '%'||#{domainCode}||'%'</if>
  344. <if test="adSign != null and adSign != ''">and AD_SIGN like '%'||#{adSign}||'%'</if>
  345. <if test="modifierPeople != null and modifierPeople != ''">and MODIFIER_PEOPLE like
  346. '%'||#{modifierPeople}||'%'
  347. </if>
  348. <if test="updDate != null and updDate != ''">and UPD_DATE = TO_DATE(#{updDate}||'%','YYYY-MM-DD
  349. HH24:MI:SS')
  350. </if>
  351. <if test="isReport != null and isReport != ''">and IS_REPORT like '%'||#{isReport}||'%'</if>
  352. <if test="adFcode != null and adFcode != ''">and AD_FCODE like '%'||#{adFcode}||'%'</if>
  353. <if test="province != null and province != ''">and AD_CODE LIKE '${province}%'</if>
  354. AND EXPR_DATE IS NULL
  355. </trim>
  356. </sql>
  357. <!--获取行政区划列表-->
  358. <select id="getTableList" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  359. select * from ATT_AD_X_BASE
  360. <include refid="page_where_extend"></include>
  361. order by AD_GRAD asc,AD_CODE asc
  362. </select>
  363. <select id="getByCode" resultMap="attAdXBaseResultMap">
  364. select
  365. <include refid="table_columns"/>
  366. from ATT_AD_X_BASE where ad_code=#{adCode}
  367. </select>
  368. <select id="getMaxVillageCode" resultType="string" parameterType="string">
  369. SELECT MAX(AD_CODE) FROM ATT_AD_X_BASE WHERE AD_FCODE=#{adCode}
  370. </select>
  371. <select id="getDcVillNum" resultType="int" parameterType="string">
  372. SELECT SUM(NUM) FROM(
  373. select count(vill_id) NUM from BIS_INSP_SECSURVEY_VLG where eng_id=#{engId} and village_code=#{adCode}
  374. union all
  375. select count(RUNSTSE_ID) NUM from BIS_INSP_VLGDRINK_FAC_OPER where eng_id=#{engId} and ad_code=#{adCode}
  376. UNION ALL
  377. select count(PRSN_WATER_ID) NUM from BIS_INSP_WATERUSER_INFO where eng_id=#{engId} and village_code=#{adCode}
  378. )
  379. </select>
  380. <select id="queryTCListLast" parameterType="cn.com.goldenwater.dcproj.param.QueryTCListParam"
  381. resultType="cn.com.goldenwater.dcproj.model.TCListBean">
  382. SELECT TOWN_CODE,
  383. TOWN_NAME,
  384. VILL_CODE,
  385. VILL_NAME,
  386. VILL_ID,
  387. TOWN_ID,
  388. LGTD,
  389. LTTD,
  390. LGTDPC,
  391. LTTDPC,
  392. STATUS,
  393. CASE WHEN IS_POVERYT IS NULL THEN '2' ELSE IS_POVERYT END IS_POVERYT
  394. FROM (SELECT B.AD_CODE TOWN_CODE,
  395. B.AD_NAME TOWN_NAME,
  396. A.AD_CODE VILL_CODE,
  397. A.AD_NAME VILL_NAME,
  398. A.guid VILL_ID,
  399. B.GUID TOWN_ID,
  400. A.LGTD,
  401. A.LTTD,
  402. A.LGTDPC,
  403. A.LTTDPC,
  404. CASE WHEN NUM IS NULL THEN 0 ELSE 1 END STATUS,
  405. CASE WHEN D.IS_POVERTY IS NULL THEN A.IS_POVERYT ELSE D.IS_POVERTY END IS_POVERYT
  406. FROM att_ad_x_base A
  407. LEFT JOIN att_ad_x_base B
  408. ON A.AD_FCODE = B.AD_CODE
  409. LEFT JOIN ( SELECT SUM(NUM) NUM,AD_CODE FROM(
  410. select count(vill_id) NUM,village_code AD_CODE from BIS_INSP_SECSURVEY_VLG where eng_id=#{engId} GROUP BY
  411. village_code
  412. union all
  413. select count(RUNSTSE_ID) NUM,AD_CODE from BIS_INSP_VLGDRINK_FAC_OPER where eng_id=#{engId} GROUP BY AD_CODE
  414. UNION ALL
  415. select count(PRSN_WATER_ID) NUM,village_code AD_CODE from BIS_INSP_WATERUSER_INFO where eng_id=#{engId} GROUP BY
  416. village_code
  417. ) GROUP BY AD_CODE) C ON A.AD_CODE=C.AD_CODE
  418. LEFT JOIN BIS_INSP_SECSURVEY_VLG D ON A.AD_CODE=D.VILLAGE_CODE AND D.ENG_ID=#{engId}
  419. WHERE B.AD_FCODE = #{adCode}
  420. <if test="name != null and name != ''">
  421. AND( A.AD_NAME LIKE '%'||#{name}||'%' OR B.AD_NAME LIKE '%'||#{name}||'%' )
  422. </if>
  423. ORDER BY B.AD_CODE ,STATUS DESC,A.AD_CODE
  424. ) WHERE 1=1
  425. <if test="isPoveryt == '0'.toString() or isPoveryt == '1'.toString()">and IS_POVERYT =#{isPoveryt}</if>
  426. <if test="isPoveryt == '2'.toString() ">and IS_POVERYT IS NULL</if>
  427. </select>
  428. <!--示例参数 001,002-->
  429. <select id="getTargetAdByNodeId" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  430. select DISTINCT t.*
  431. from ATT_AD_X_BASE t
  432. left join ATT_RS_BASE b
  433. on t.ad_code = b.adm_div
  434. left join BIS_INSP_ALL_OBJ o
  435. on b.rs_code = o.code
  436. WHERE 1 = 1
  437. and o.ptype = 1
  438. AND
  439. REGEXP_LIKE(
  440. o.Id,'^('||
  441. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid})>0 then
  442. (SELECT LISTAGG(id, '|') as
  443. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid} GROUP BY PERSID)
  444. else (select 'non' from dual) end)
  445. ||')')
  446. <if test="nodes != null and nodes != ''">
  447. AND
  448. <foreach collection="nodes" index="index" item="item" separator="or">
  449. o.id like CONCAT(#{item},'%')
  450. </foreach>
  451. </if>
  452. ORDER BY t.AD_CODE ASC
  453. </select>
  454. <select id="getAllNodeByPid" resultType="cn.com.goldenwater.dcproj.model.AttAdXBaseNode">
  455. SELECT AD_CODE AS ID,AD_NAME AS NM,AD_FCODE AS PID, AD_GRAD AS "LEVEL" FROM ATT_AD_X_BASE where 1=1
  456. <if test="lev != null and lev != ''">
  457. AND to_number(ad_grad)&lt;=#{lev}
  458. </if>
  459. START WITH AD_FCODE = #{pid}
  460. CONNECT BY PRIOR AD_CODE = AD_FCODE
  461. </select>
  462. <select id="getAllNodeByPids" resultType="cn.com.goldenwater.dcproj.model.AttAdXBaseNode">
  463. SELECT AD_CODE AS ID,AD_NAME AS NM,AD_FCODE AS PID, AD_GRAD AS "LEVEL" FROM ATT_AD_X_BASE where 1=1
  464. <if test="adCdS != null and adCdS != ''">
  465. AND AD_CODE in
  466. <foreach collection="adCdS.split(',')" index="index" item="item" separator="," open="(" close=")">
  467. #{item}
  468. </foreach>
  469. </if>
  470. <if test="level != null and level != ''">
  471. AND AD_GRAD = #{level}
  472. </if>
  473. </select>
  474. <select id="getAllNodeByIds" resultType="cn.com.goldenwater.dcproj.model.AttAdXBaseNode">
  475. SELECT AD_CODE AS ID,AD_NAME AS NM,AD_FCODE AS PID, AD_GRAD AS "LEVEL" FROM ATT_AD_X_BASE where AD_FCODE = #{id}
  476. </select>
  477. <select id="getByName" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase"
  478. parameterType="cn.com.goldenwater.dcproj.param.AttAdXBaseParam">
  479. select * from Att_ad_x_base t where t.ad_name = #{adName}
  480. </select>
  481. <select id="getObjByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  482. resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  483. SELECT A.* ,B.OBJ_ID,B.ID groupId,C.ID rgstrId FROM ATT_AD_X_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.ad_code =
  484. B.CODE
  485. <if test="objType=='14'.toString()">
  486. LEFT JOIN BIS_INSP_WINT_RGSTR C ON B.OBJ_ID = C.OBJ_ID
  487. </if>
  488. <if test="objType=='15'.toString()">
  489. LEFT JOIN BIS_INSP_SVWT_AREA_RGSTR C ON B.OBJ_ID = C.OBJ_ID
  490. </if>
  491. WHERE B.PTYPE = #{objType} AND
  492. REGEXP_LIKE(
  493. B.Id,'^('||
  494. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid})>0 then
  495. (SELECT LISTAGG(id, '|') as
  496. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid} GROUP BY PERSID)
  497. else (select 'non' from dual) end)
  498. ||')')
  499. <choose>
  500. <when test="province !=null and province !=''">
  501. and B.AD_CODE =#{province}
  502. </when>
  503. <otherwise>
  504. and B.AD_CODE is null
  505. </otherwise>
  506. </choose>
  507. <if test="adName != null and adName != ''">and A.SWHS_NAME LIKE '%${adName}%'</if>
  508. <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
  509. </select>
  510. <select id="getObjListNotInspGroupId" parameterType="String"
  511. resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  512. select t.*
  513. from ATT_AD_X_BASE t
  514. where t.guid not in (
  515. select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%') and B.obj_type=#{objType}
  516. <choose>
  517. <when test="province !=null and province !=''">
  518. and B.AD_CODE =#{province}
  519. </when>
  520. <otherwise>
  521. and B.AD_CODE is null
  522. </otherwise>
  523. </choose>
  524. )
  525. <if test="adName != null and adName != ''">and t.nm LIKE '%${adName}%'</if>
  526. <if test="adCode != null and adCode != ''">and t.AD_CODE LIKE '${adCode}%'</if>
  527. </select>
  528. <select id="findXZCZhenList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
  529. SELECT E.AD_CODE,E.AD_NAME FROM ATT_AD_X_BASE E
  530. WHERE E.AD_CODE LIKE '${adCode}___000%'
  531. and substr(e.ad_code,7)!='000000'
  532. </select>
  533. <select id="findXZCCunList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
  534. SELECT
  535. E.AD_CODE,E.AD_NAME,(CASE WHEN E.IS_POVERYT IS NULL THEN '0' ELSE E.IS_POVERYT END) IS_POVERYT
  536. FROM ATT_AD_X_BASE E
  537. WHERE
  538. E.AD_CODE LIKE '${adCode}%'
  539. and substr(e.ad_code,10)!='000'
  540. and e.ad_code not in (
  541. <choose>
  542. <when test="type=='25'.toString()">
  543. select ad_code from BIS_NEW_DCUSER_REL_VILL l where l.regstr_id=#{rgstrId}
  544. </when>
  545. <when test="type=='71'.toString()">
  546. SELECT VILL_CODE FROM BIS_INSP_VILLQH_RGSTR_REL_VILL L WHERE L.REGSTR_ID = #{rgstrId} AND L.DATA_STAT = '0'
  547. </when>
  548. <when test="type=='97'.toString()">
  549. SELECT AD_CODE FROM BIS_INSP_VILL2021_VILL L WHERE L.RGSTR_ID = #{rgstrId} AND L.DATA_STAT = '0'
  550. </when>
  551. <otherwise>
  552. select ad_code from BIS_ZHEJIANG_DCUSER_REL_VILL l where l.rgstr_id=#{rgstrId}
  553. </otherwise>
  554. </choose>
  555. )
  556. order by e.ad_code asc
  557. </select>
  558. <select id="findCunList" resultType="cn.com.goldenwater.dcproj.model.BisZhejiangDcuserRelVill"
  559. parameterType="String">
  560. select * from
  561. <choose>
  562. <when test="type=='41'.toString()">
  563. BIS_ZHEJIANG_DCUSER_REL_VILL
  564. where ad_code like '${adCode}%'
  565. and rgstr_id=#{rgstrId}
  566. order by ad_code
  567. </when>
  568. <when test="type=='71'.toString()">
  569. BIS_INSP_VILLQH_RGSTR_REL_VILL
  570. where DATA_STAT = '0'
  571. AND ad_code like '${adCode}%'
  572. and REGSTR_ID =#{rgstrId}
  573. order by ad_code
  574. </when>
  575. <when test="type=='97'.toString()">
  576. (
  577. SELECT
  578. V.*, A.AD_NAME AS TOWN_NAME
  579. FROM BIS_INSP_VILL2021_VILL V
  580. LEFT JOIN ATT_AD_X_BASE A ON A.AD_CODE = (SUBSTR(V.AD_CODE, 0, 9) || '000')
  581. )
  582. where DATA_STAT = '0'
  583. AND ad_code like '${adCode}%'
  584. and RGSTR_ID =#{rgstrId}
  585. order by ad_code
  586. </when>
  587. <otherwise>
  588. BIS_NEW_DCUSER_REL_VILL
  589. where ad_code like '${adCode}%'
  590. and regstr_id=#{rgstrId}
  591. order by ad_code
  592. </otherwise>
  593. </choose>
  594. </select>
  595. <select id="getAdData" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  596. select guid,
  597. ad_code,
  598. ad_name,
  599. low_left_long,
  600. low_left_lat,
  601. up_right_long,
  602. up_right_lat,
  603. up_ad_name,
  604. ad_grad,
  605. ad_abbr_name,
  606. ad_stat,
  607. ad_area,
  608. ad_full_name,
  609. note,
  610. eff_date,
  611. expr_date,
  612. ad_stat_long,
  613. ad_stat_lat,
  614. domain_code,
  615. ad_sign,
  616. modifier_people,
  617. upd_date,
  618. is_report,
  619. ad_fcode,lgtd,lttd from att_ad_x_base WHERE AD_FCODE = #{adCode} ORDER BY AD_CODE
  620. </select>
  621. <select id="getAdDataByAdCode" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  622. select guid,
  623. ad_code,
  624. ad_name,
  625. low_left_long,
  626. low_left_lat,
  627. up_right_long,
  628. up_right_lat,
  629. up_ad_name,
  630. ad_grad,
  631. ad_abbr_name,
  632. ad_stat,
  633. ad_area,
  634. ad_full_name,
  635. note,
  636. eff_date,
  637. expr_date,
  638. ad_stat_long,
  639. ad_stat_lat,
  640. domain_code,
  641. ad_sign,
  642. modifier_people,
  643. upd_date,
  644. is_report,
  645. ad_fcode,lgtd,lttd from att_ad_x_base WHERE AD_CODE IN
  646. <foreach collection="adCodes.split(',')" item="item" index="index" open="(" separator="," close=")">
  647. #{item}
  648. </foreach>
  649. ORDER BY AD_CODE
  650. </select>
  651. <select id="findXZCZhenMfdpList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
  652. select e.ad_code,e.ad_name from att_ad_x_base e where e.ad_code like '${adCode}___000%' and substr(e.ad_code,7)!='000000'
  653. and e.ad_code not in (
  654. select ad_code from BIS_INSP_MFDP_RGSTR_OBJ l where l.rgstr_id=#{regstrId} and l.INSP_OBJ_TYPE = '3'
  655. )
  656. </select>
  657. <select id="findXZCCunMfdpList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
  658. select e.ad_code,e.ad_name,(case when e.is_poveryt is null then '0' else e.is_poveryt end) is_poveryt
  659. from att_ad_x_base e where
  660. e.ad_code like '${adCode}%' and substr(e.ad_code,10)!='000' and e.ad_code not in (
  661. select ad_code from BIS_INSP_MFDP_RGSTR_OBJ l where l.rgstr_id=#{regstrId} and l.INSP_OBJ_TYPE = '4'
  662. )
  663. order by e.ad_code asc
  664. </select>
  665. <select id="findXZCCunIrrList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
  666. select e.ad_code,e.ad_name,(case when e.is_poveryt is null then '0' else e.is_poveryt end) is_poveryt
  667. from att_ad_x_base e where
  668. e.ad_code like '${adCode}%' and substr(e.ad_code,10)!='000' and e.ad_code not in (
  669. select ad_code from BIS_INSP_IRR_TOWNS_DSU l where l.data_stat = '0' and l.rgstr_id=#{rgstrId}
  670. and l.ad_code is not null
  671. )
  672. order by e.ad_code asc
  673. </select>
  674. <select id="findXZCCunListByType" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
  675. select e.ad_code,e.ad_name,(case when e.is_poveryt is null then '0' else e.is_poveryt end) is_poveryt
  676. from att_ad_x_base e where
  677. e.ad_code like '${adCode}%' and substr(e.ad_code,10)!='000' and e.ad_code not in (
  678. select ad_code from
  679. <if test='type == "37"'>
  680. BIS_RDWSP_RGSTR_REL_VILL
  681. </if>
  682. l where l.regstr_id=#{regstrId}
  683. )
  684. order by e.ad_code asc
  685. </select>
  686. <select id="getAdDataXj" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  687. select guid,
  688. ad_code,
  689. ad_name,
  690. low_left_long,
  691. low_left_lat,
  692. up_right_long,
  693. up_right_lat,
  694. up_ad_name,
  695. ad_grad,
  696. ad_abbr_name,
  697. ad_stat,
  698. ad_area,
  699. ad_full_name,
  700. note,
  701. eff_date,
  702. expr_date,
  703. ad_stat_long,
  704. ad_stat_lat,
  705. domain_code,
  706. ad_sign,
  707. modifier_people,
  708. upd_date,
  709. is_report,
  710. ad_fcode,lgtd,lttd from att_ad_x_base
  711. where 1=1 and ad_name not like '兵团%'
  712. START WITH AD_FCODE = #{adCode}
  713. CONNECT BY PRIOR AD_CODE = AD_FCODE
  714. <if test='adCode == "660000000000"'>
  715. and level=1
  716. </if>
  717. <if test='adCode != "660000000000"'>
  718. and level=2
  719. </if>
  720. </select>
  721. <select id="getAdChild" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
  722. select * from att_ad_x_base where ad_code like concat(#{adCode},'%')
  723. </select>
  724. </mapper>