d71effe631a3e844b10ec5a3dfe50c2dca901e6d.svn-base 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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.BisInspWateruserInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspWateruserInfo" id="bisInspWateruserInfoResultMap">
  5. <result property="villageCode" column="VILLAGE_CODE"/>
  6. <result property="prsnWaterId" column="PRSN_WATER_ID"/>
  7. <result property="engId" column="ENG_ID"/>
  8. <result property="villageNm" column="VILLAGE_NM"/>
  9. <result property="userNm" column="USER_NM"/>
  10. <result property="telphone" column="TELPHONE"/>
  11. <result property="cwsCode" column="CWS_CODE"/>
  12. <result property="cwsName" column="CWS_NAME"/>
  13. <result property="isQualityGood" column="IS_QUALITY_GOOD"/>
  14. <result property="isQualityProblem" column="IS_QUALITY_PROBLEM"/>
  15. <result property="qualityProblem" column="QUALITY_PROBLEM"/>
  16. <result property="isSplyHome" column="IS_SPLY_HOME"/>
  17. <result property="is24hSupply" column="IS_24H_SUPPLY"/>
  18. <result property="isWaterProblem" column="IS_WATER_PROBLEM"/>
  19. <result property="waterProblem" column="WATER_PROBLEM"/>
  20. <result property="isCalFee" column="IS_CAL_FEE"/>
  21. <result property="isFeeProblem" column="IS_FEE_PROBLEM"/>
  22. <result property="feeProblem" column="FEE_PROBLEM"/>
  23. <result property="isSplyProblem" column="IS_SPLY_PROBLEM"/>
  24. <result property="splyProblem" column="SPLY_PROBLEM"/>
  25. <result property="evaluate" column="EVALUATE"/>
  26. <result property="visitDate" column="VISIT_DATE"/>
  27. <result property="recPersId" column="REC_PERS_ID"/>
  28. <result property="recPers2" column="REC_PERS2"/>
  29. <result property="recPersTel" column="REC_PERS_TEL"/>
  30. <result property="createTime" column="CREATE_TIME"/>
  31. <result property="updateTime" column="UPDATE_TIME"/>
  32. <result property="status" column="STATUS"/>
  33. <result property="isHrSupply" column="IS_HR_SUPPLY"/>
  34. <result property="hrNote" column="HR_NOTE"/>
  35. <result property="waterFee" column="WATER_FEE"/>
  36. <result property="otherProblem" column="OTHER_PROBLEM"/>
  37. </resultMap>
  38. <sql id="table_columns">
  39. VILLAGE_CODE ,
  40. PRSN_WATER_ID ,
  41. ENG_ID ,
  42. VILLAGE_NM ,
  43. USER_NM ,
  44. TELPHONE ,
  45. CWS_CODE ,
  46. CWS_NAME,
  47. IS_QUALITY_GOOD ,
  48. IS_QUALITY_PROBLEM ,
  49. QUALITY_PROBLEM ,
  50. IS_SPLY_HOME ,
  51. IS_24H_SUPPLY ,
  52. IS_WATER_PROBLEM ,
  53. WATER_PROBLEM ,
  54. IS_CAL_FEE ,
  55. IS_FEE_PROBLEM ,
  56. FEE_PROBLEM ,
  57. IS_SPLY_PROBLEM ,
  58. SPLY_PROBLEM ,
  59. EVALUATE ,
  60. TO_CHAR(VISIT_DATE,'YYYY-MM-DD') VISIT_DATE,
  61. REC_PERS_ID ,
  62. REC_PERS2 ,
  63. REC_PERS_TEL ,
  64. TO_CHAR(CREATE_TIME,'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
  65. TO_CHAR(UPDATE_TIME,'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
  66. STATUS,
  67. IS_HR_SUPPLY,
  68. HR_NOTE,
  69. WATER_FEE,
  70. OTHER_PROBLEM
  71. </sql>
  72. <sql id="table_columns2">
  73. VILLAGE_CODE ,
  74. PRSN_WATER_ID ,
  75. ENG_ID ,
  76. VILLAGE_NM ,
  77. USER_NM ,
  78. TELPHONE ,
  79. CWS_CODE ,
  80. CWS_NAME ,
  81. IS_QUALITY_GOOD ,
  82. IS_QUALITY_PROBLEM ,
  83. QUALITY_PROBLEM ,
  84. IS_SPLY_HOME ,
  85. IS_24H_SUPPLY ,
  86. IS_WATER_PROBLEM ,
  87. WATER_PROBLEM ,
  88. IS_CAL_FEE ,
  89. IS_FEE_PROBLEM ,
  90. FEE_PROBLEM ,
  91. IS_SPLY_PROBLEM ,
  92. SPLY_PROBLEM ,
  93. EVALUATE ,
  94. VISIT_DATE ,
  95. REC_PERS_ID ,
  96. REC_PERS2 ,
  97. REC_PERS_TEL ,
  98. CREATE_TIME ,
  99. UPDATE_TIME ,
  100. STATUS,
  101. IS_HR_SUPPLY,
  102. HR_NOTE,
  103. WATER_FEE,
  104. OTHER_PROBLEM
  105. </sql>
  106. <sql id="entity_properties">
  107. #{villageCode},
  108. #{prsnWaterId},
  109. #{engId},
  110. #{villageNm},
  111. #{userNm},
  112. #{telphone},
  113. #{cwsCode},
  114. #{cwsName},
  115. #{isQualityGood},
  116. #{isQualityProblem},
  117. #{qualityProblem},
  118. #{isSplyHome},
  119. #{is24hSupply},
  120. #{isWaterProblem},
  121. #{waterProblem},
  122. #{isCalFee},
  123. #{isFeeProblem},
  124. #{feeProblem},
  125. #{isSplyProblem},
  126. #{splyProblem},
  127. #{evaluate},
  128. TO_DATE(#{visitDate},'YYYY-MM-DD'),
  129. #{recPersId},
  130. #{recPers2},
  131. #{recPersTel},
  132. TO_DATE(#{createTime},'YYYY-MM-DD HH24:MI:SS') ,
  133. TO_DATE(#{updateTime},'YYYY-MM-DD HH24:MI:SS') ,
  134. #{status},
  135. #{isHrSupply},
  136. #{hrNote},
  137. #{waterFee},
  138. #{otherProblem}
  139. </sql>
  140. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  141. <sql id="page_where">
  142. <trim prefix="where" prefixOverrides="and | or ">
  143. <if test="villageCode != null and villageCode != ''">and VILLAGE_CODE = #{villageCode}</if>
  144. <if test="prsnWaterId != null and prsnWaterId != ''">and PRSN_WATER_ID = #{prsnWaterId}</if>
  145. <if test="engId != null and engId != ''">and ENG_ID = #{engId}</if>
  146. <if test="villageNm != null and villageNm != ''">and VILLAGE_NM = #{villageNm}</if>
  147. <if test="userNm != null and userNm != ''">and USER_NM = #{userNm}</if>
  148. <if test="telphone != null and telphone != ''">and TELPHONE = #{telphone}</if>
  149. <if test="cwsCode != null and cwsCode != ''">and CWS_CODE = #{cwsCode}</if>
  150. <if test="cwsName != null and cwsName != ''">and CWS_NAME LIKE '%'||#{cwsName}||'%'</if>
  151. <if test="isQualityGood != null and isQualityGood != ''">and IS_QUALITY_GOOD = #{isQualityGood}</if>
  152. <if test="isQualityProblem != null and isQualityProblem != ''">and IS_QUALITY_PROBLEM =
  153. #{isQualityProblem}
  154. </if>
  155. <if test="qualityProblem != null and qualityProblem != ''">and QUALITY_PROBLEM = #{qualityProblem}</if>
  156. <if test="isSplyHome != null and isSplyHome != ''">and IS_SPLY_HOME = #{isSplyHome}</if>
  157. <if test="is24hSupply != null and is24hSupply != ''">and IS_24H_SUPPLY = #{is24hSupply}</if>
  158. <if test="isWaterProblem != null and isWaterProblem != ''">and IS_WATER_PROBLEM = #{isWaterProblem}</if>
  159. <if test="waterProblem != null and waterProblem != ''">and WATER_PROBLEM = #{waterProblem}</if>
  160. <if test="isCalFee != null and isCalFee != ''">and IS_CAL_FEE = #{isCalFee}</if>
  161. <if test="isFeeProblem != null and isFeeProblem != ''">and IS_FEE_PROBLEM = #{isFeeProblem}</if>
  162. <if test="feeProblem != null and feeProblem != ''">and FEE_PROBLEM = #{feeProblem}</if>
  163. <if test="isSplyProblem != null and isSplyProblem != ''">and IS_SPLY_PROBLEM = #{isSplyProblem}</if>
  164. <if test="splyProblem != null and splyProblem != ''">and SPLY_PROBLEM = #{splyProblem}</if>
  165. <if test="evaluate != null and evaluate != ''">and EVALUATE = #{evaluate}</if>
  166. <if test="visitDate != null and visitDate != ''">and VISIT_DATE = TO_DATE(#{visitDate},'YYYY-MM-DD')</if>
  167. <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
  168. <if test="recPers2 != null and recPers2 != ''">and REC_PERS2 = #{recPers2}</if>
  169. <if test="recPersTel != null and recPersTel != ''">and REC_PERS_TEL = #{recPersTel}</if>
  170. <if test="createTime != null and createTime != ''">and CREATE_TIME = TO_DATE(#{createTime},'YYYY-MM-DD
  171. HH24:MI:SS')
  172. </if>
  173. <if test="updateTime != null and updateTime != ''">and UPDATE_TIME = TO_DATE(#{updateTime},'YYYY-MM-DD
  174. HH24:MI:SS')
  175. </if>
  176. <if test="status != null and status != ''">and STATUS = #{status}</if>
  177. <if test="isHrSupply != null and isHrSupply != ''">and IS_HR_SUPPLY = #{isHrSupply}</if>
  178. <if test="hrNote != null and hrNote != ''">and HR_NOTE = #{hrNote}</if>
  179. <if test="waterFee != null">and WATER_FEE = #{waterFee}</if>
  180. </trim>
  181. </sql>
  182. <select id="get" resultMap="bisInspWateruserInfoResultMap" parameterType="String">
  183. select
  184. <include refid="table_columns"/>
  185. from BIS_INSP_WATERUSER_INFO where PRSN_WATER_ID = #{id}
  186. </select>
  187. <select id="getBy" resultMap="bisInspWateruserInfoResultMap">
  188. select
  189. <include refid="table_columns"/>
  190. from BIS_INSP_WATERUSER_INFO
  191. <include refid="page_where"/>
  192. </select>
  193. <select id="findAll" resultMap="bisInspWateruserInfoResultMap">
  194. select
  195. <include refid="table_columns"/>
  196. from BIS_INSP_WATERUSER_INFO
  197. </select>
  198. <select id="findList" resultMap="bisInspWateruserInfoResultMap">
  199. select
  200. <include refid="table_columns"/>
  201. from BIS_INSP_WATERUSER_INFO
  202. <include refid="page_where"/>
  203. ORDER BY UPDATE_TIME DESC
  204. </select>
  205. <select id="selectCount" resultType="int">
  206. select count(PRSN_WATER_ID) from BIS_INSP_WATERUSER_INFO
  207. <include refid="page_where"/>
  208. </select>
  209. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspWateruserInfo">
  210. insert into BIS_INSP_WATERUSER_INFO(
  211. <include refid="table_columns2"/>
  212. )
  213. values (
  214. <include refid="entity_properties"/>
  215. )
  216. </insert>
  217. <delete id="delete" parameterType="java.lang.String">
  218. delete from BIS_INSP_WATERUSER_INFO where PRSN_WATER_ID = #{id}
  219. </delete>
  220. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWateruserInfo">
  221. delete from BIS_INSP_WATERUSER_INFO
  222. <include refid="page_where"/>
  223. </delete>
  224. <update id="deleteInFlag" parameterType="java.lang.String">
  225. update BIS_INSP_WATERUSER_INFO set flag_valid = 0 where PRSN_WATER_ID = #{id}
  226. </update>
  227. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspWateruserInfo">
  228. update BIS_INSP_WATERUSER_INFO
  229. <trim prefix="set" suffixOverrides=",">
  230. <if test="villageCode != null and villageCode != ''">VILLAGE_CODE = #{villageCode},</if>
  231. <if test="engId != null and engId != ''">ENG_ID = #{engId},</if>
  232. <if test="villageNm != null and villageNm != ''">VILLAGE_NM = #{villageNm},</if>
  233. <if test="userNm != null and userNm != ''">USER_NM = #{userNm},</if>
  234. <if test="telphone != null and telphone != ''">TELPHONE = #{telphone},</if>
  235. <if test="cwsCode != null and cwsCode != ''">CWS_CODE = #{cwsCode},</if>
  236. <if test="cwsName != null and cwsName != ''">CWS_NAME = #{cwsName},</if>
  237. <if test="isQualityGood != null and isQualityGood != ''">IS_QUALITY_GOOD = #{isQualityGood},</if>
  238. <if test="isQualityProblem != null and isQualityProblem != ''">IS_QUALITY_PROBLEM = #{isQualityProblem},
  239. </if>
  240. <if test="qualityProblem != null and qualityProblem != ''">QUALITY_PROBLEM = #{qualityProblem},</if>
  241. <if test="isSplyHome != null and isSplyHome != ''">IS_SPLY_HOME = #{isSplyHome},</if>
  242. <if test="is24hSupply != null and is24hSupply != ''">IS_24H_SUPPLY = #{is24hSupply},</if>
  243. <if test="isWaterProblem != null and isWaterProblem != ''">IS_WATER_PROBLEM = #{isWaterProblem},</if>
  244. <if test="waterProblem != null and waterProblem != ''">WATER_PROBLEM = #{waterProblem},</if>
  245. <if test="isCalFee != null and isCalFee != ''">IS_CAL_FEE = #{isCalFee},</if>
  246. <if test="isFeeProblem != null and isFeeProblem != ''">IS_FEE_PROBLEM = #{isFeeProblem},</if>
  247. <if test="feeProblem != null and feeProblem != ''">FEE_PROBLEM = #{feeProblem},</if>
  248. <if test="isSplyProblem != null and isSplyProblem != ''">IS_SPLY_PROBLEM = #{isSplyProblem},</if>
  249. <if test="splyProblem != null and splyProblem != ''">SPLY_PROBLEM = #{splyProblem},</if>
  250. <if test="evaluate != null and evaluate != ''">EVALUATE = #{evaluate},</if>
  251. <if test="visitDate != null and visitDate != ''">VISIT_DATE = TO_DATE(#{visitDate},'YYYY-MM-DD'),</if>
  252. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  253. <if test="recPers2 != null and recPers2 != ''">REC_PERS2 = #{recPers2},</if>
  254. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  255. <if test="createTime != null and createTime != ''">CREATE_TIME = TO_DATE(#{createTime},'YYYY-MM-DD
  256. HH24:MI:SS'),
  257. </if>
  258. <if test="updateTime != null and updateTime != ''">UPDATE_TIME = TO_DATE(#{updateTime},'YYYY-MM-DD
  259. HH24:MI:SS'),
  260. </if>
  261. <if test="status != null and status != ''">STATUS = #{status},</if>
  262. <if test="isHrSupply != null and isHrSupply != ''">IS_HR_SUPPLY = #{isHrSupply},</if>
  263. <if test="hrNote != null and hrNote != ''">HR_NOTE = #{hrNote},</if>
  264. <if test="waterFee != null">WATER_FEE = #{waterFee},</if>
  265. <if test="otherProblem != null">OTHER_PROBLEM = #{otherProblem},</if>
  266. </trim>
  267. <where>PRSN_WATER_ID = #{prsnWaterId}</where>
  268. </update>
  269. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWateruserInfo">
  270. update BIS_INSP_WATERUSER_INFO
  271. <trim prefix="set" suffixOverrides=",">
  272. <if test="villageCode != null and villageCode != ''">VILLAGE_CODE = #{villageCode},</if>
  273. <if test="engId != null and engId != ''">ENG_ID = #{engId},</if>
  274. <if test="villageNm != null and villageNm != ''">VILLAGE_NM = #{villageNm},</if>
  275. <if test="userNm != null and userNm != ''">USER_NM = #{userNm},</if>
  276. <if test="telphone != null and telphone != ''">TELPHONE = #{telphone},</if>
  277. <if test="cwsCode != null and cwsCode != ''">CWS_CODE = #{cwsCode},</if>
  278. <if test="cwsName != null and cwsName != ''">CWS_NAME = #{cwsName},</if>
  279. <if test="isQualityGood != null and isQualityGood != ''">IS_QUALITY_GOOD = #{isQualityGood},</if>
  280. <if test="isQualityProblem != null and isQualityProblem != ''">IS_QUALITY_PROBLEM = #{isQualityProblem},
  281. </if>
  282. <if test="qualityProblem != null and qualityProblem != ''">QUALITY_PROBLEM = #{qualityProblem},</if>
  283. <if test="isSplyHome != null and isSplyHome != ''">IS_SPLY_HOME = #{isSplyHome},</if>
  284. <if test="is24hSupply != null and is24hSupply != ''">IS_24H_SUPPLY = #{is24hSupply},</if>
  285. <if test="isWaterProblem != null and isWaterProblem != ''">IS_WATER_PROBLEM = #{isWaterProblem},</if>
  286. <if test="waterProblem != null and waterProblem != ''">WATER_PROBLEM = #{waterProblem},</if>
  287. <if test="isCalFee != null and isCalFee != ''">IS_CAL_FEE = #{isCalFee},</if>
  288. <if test="isFeeProblem != null and isFeeProblem != ''">IS_FEE_PROBLEM = #{isFeeProblem},</if>
  289. <if test="feeProblem != null and feeProblem != ''">FEE_PROBLEM = #{feeProblem},</if>
  290. <if test="isSplyProblem != null and isSplyProblem != ''">IS_SPLY_PROBLEM = #{isSplyProblem},</if>
  291. <if test="splyProblem != null and splyProblem != ''">SPLY_PROBLEM = #{splyProblem},</if>
  292. <if test="evaluate != null and evaluate != ''">EVALUATE = #{evaluate},</if>
  293. <if test="visitDate != null and visitDate != ''">VISIT_DATE = TO_DATE(#{visitDate},'YYYY-MM-DD'),</if>
  294. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  295. <if test="recPers2 != null and recPers2 != ''">REC_PERS2 = #{recPers2},</if>
  296. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  297. <if test="createTime != null and createTime != ''">CREATE_TIME = TO_DATE(#{createTime},'YYYY-MM-DD
  298. HH24:MI:SS'),
  299. </if>
  300. <if test="updateTime != null and updateTime != ''">UPDATE_TIME = TO_DATE(#{updateTime},'YYYY-MM-DD
  301. HH24:MI:SS'),
  302. </if>
  303. <if test="status != null and status != ''">STATUS = #{status},</if>
  304. <if test="isHrSupply != null and isHrSupply != ''">IS_HR_SUPPLY = #{isHrSupply},</if>
  305. <if test="hrNote != null and hrNote != ''">HR_NOTE = #{hrNote},</if>
  306. <if test="waterFee != null">WATER_FEE = #{waterFee},</if>
  307. <if test="otherProblem != null">OTHER_PROBLEM = #{otherProblem},</if>
  308. </trim>
  309. <include refid="page_where"/>
  310. </update>
  311. <!-- 其他自定义SQL -->
  312. <select id="getListByCodeAndPerId" parameterType="cn.com.goldenwater.dcproj.dto.VillRgstrDto"
  313. resultType="cn.com.goldenwater.dcproj.model.BisInspWateruserInfo">
  314. SELECT * FROM BIS_INSP_WATERUSER_INFO A LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID = B.ENG_ID
  315. LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
  316. WHERE
  317. <!--
  318. REGEXP_LIKE(
  319. C.Id,(SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persId})
  320. )
  321. -->
  322. REGEXP_LIKE(
  323. C.Id,'^('||
  324. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId})>0 then
  325. (SELECT LISTAGG(id, '|') as
  326. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId} group by persid)
  327. else (select 'non' from dual) end)
  328. ||')')
  329. AND C.CODE LIKE '${adCode}%' AND C.PTYPE = '2'
  330. <if test="adNm != null and adNm != ''">and A.VILLAGE_NM LIKE '%${adNm}%'</if>
  331. </select>
  332. <select id="getPageByNodeId" parameterType="cn.com.goldenwater.dcproj.param.GetVillPageByNodeIdParam"
  333. resultType="cn.com.goldenwater.dcproj.dto.BisInspWateruserInfoDcdxDto">
  334. select A.VILLAGE_CODE ,
  335. A.PRSN_WATER_ID ,
  336. A.ENG_ID ,
  337. A.VILLAGE_NM ,
  338. A.USER_NM ,
  339. A.TELPHONE ,
  340. A.CWS_CODE ,
  341. A.CWS_NAME,
  342. A.IS_QUALITY_GOOD ,
  343. A.IS_QUALITY_PROBLEM ,
  344. A.QUALITY_PROBLEM ,
  345. A.IS_SPLY_HOME ,
  346. A.IS_24H_SUPPLY ,
  347. A.IS_WATER_PROBLEM ,
  348. A.WATER_PROBLEM ,
  349. A.IS_CAL_FEE ,
  350. A.IS_FEE_PROBLEM ,
  351. A.FEE_PROBLEM ,
  352. A.IS_SPLY_PROBLEM ,
  353. A.SPLY_PROBLEM ,
  354. A.EVALUATE ,
  355. TO_CHAR(A.VISIT_DATE,'YYYY-MM-DD') VISIT_DATE,
  356. A.REC_PERS_ID ,
  357. A.REC_PERS2 ,
  358. A.REC_PERS_TEL ,
  359. TO_CHAR(A.CREATE_TIME,'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
  360. TO_CHAR(A.UPDATE_TIME,'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
  361. A.STATUS,
  362. A.IS_HR_SUPPLY,
  363. A.HR_NOTE,
  364. A.WATER_FEE,D.PNM GROUP_NM,F.PNM CHKCOM,H.AD_NAME TOWN,I.AD_NAME COUNTY,J.AD_NAME CITY,K.AD_NAME PROVINCE from
  365. BIS_INSP_WATERUSER_INFO A
  366. LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID=B.ENG_ID LEFT JOIN bis_insp_all_obj C ON B.OBJ_ID=C.OBJ_ID
  367. LEFT JOIN BIS_INSP_ALL D ON C.ID=D.ID LEFT JOIN BIS_INSP_ALL E ON D.PID=E.ID LEFT JOIN BIS_INSP_ALL F ON
  368. E.PID=F.ID
  369. LEFT JOIN ATT_AD_X_BASE G ON A.VILLAGE_CODE=G.AD_CODE LEFT JOIN ATT_AD_X_BASE H ON G.AD_FCODE=H.AD_CODE
  370. LEFT JOIN ATT_AD_X_BASE I ON H.AD_FCODE=I.AD_CODE LEFT JOIN ATT_AD_X_BASE J ON I.AD_FCODE=J.AD_CODE
  371. LEFT JOIN ATT_AD_X_BASE K ON J.AD_FCODE=K.AD_CODE WHERE 1=1
  372. <if test="nodeId != null and nodeId != ''">
  373. and C.ID like #{nodeId}||'%'
  374. </if>
  375. <if test="startDate != null and startDate != ''">
  376. AND A.VISIT_DATE &gt;=TO_DATE(#{startDate},'YYYY-MM-DD')
  377. </if>
  378. <if test="endDate != null and endDate != ''">
  379. AND A.VISIT_DATE &lt;TO_DATE(#{endDate},'YYYY-MM-DD')+1
  380. </if>
  381. <if test="chkComId != null and chkComId != ''">
  382. AND F.ID =#{chkComId}
  383. </if>
  384. <if test="groupId != null and groupId != ''">
  385. AND D.ID =#{groupId}
  386. </if>
  387. <if test="adNm != null and adNm != ''">
  388. AND( A.VILLAGE_NM LIKE '%'||#{adNm}||'%' OR H.AD_NAME LIKE '%'||#{adNm}||'%' OR I.AD_NAME LIKE
  389. '%'||#{adNm}||'%' OR J.AD_NAME LIKE '%'||#{adNm}||'%' OR K.AD_NAME LIKE '%'||#{adNm}||'%')
  390. </if>
  391. ORDER BY A.UPDATE_TIME DESC,A.VISIT_DATE DESC
  392. </select>
  393. </mapper>