BisInspWateruserInfoDao.xml 19 KB

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