BisInspVillgdNvillDao.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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.BisInspVillgdNvillDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspVillgdNvill" id="bisInspVillgdNvillResultMap">
  5. <result property="isOver" column="IS_OVER"/>
  6. <result property="othNote" column="OTH_NOTE"/>
  7. <result property="tm" column="TM"/>
  8. <result property="isInHome" column="IS_IN_HOME"/>
  9. <result property="total" column="TOTAL"/>
  10. <result property="inTotal" column="IN_TOTAL"/>
  11. <result property="inRate" column="IN_RATE"/>
  12. <result property="isTari" column="IS_TARI"/>
  13. <result property="tariMet" column="TARI_MET"/>
  14. <result property="tariMon" column="TARI_MON"/>
  15. <result property="isPayCost" column="IS_PAY_COST"/>
  16. <result property="isWaterSupply" column="IS_WATER_SUPPLY"/>
  17. <result property="supplyPblm" column="SUPPLY_PBLM"/>
  18. <result property="supplyNote" column="SUPPLY_NOTE"/>
  19. <result property="persId" column="PERS_ID"/>
  20. <result property="intm" column="INTM"/>
  21. <result property="uptm" column="UPTM"/>
  22. <result property="note" column="NOTE"/>
  23. <result property="dataStat" column="DATA_STAT"/>
  24. <result property="id" column="ID"/>
  25. <result property="rgstrId" column="RGSTR_ID"/>
  26. <result property="villId" column="VILL_ID"/>
  27. <result property="nm" column="NM"/>
  28. <result property="loc" column="LOC"/>
  29. <result property="isPov" column="IS_POV"/>
  30. <result property="isMin" column="IS_MIN"/>
  31. </resultMap>
  32. <sql id="table_columns">
  33. IS_OVER,
  34. OTH_NOTE,
  35. TM,
  36. IS_IN_HOME,
  37. TOTAL,
  38. IN_TOTAL,
  39. IN_RATE,
  40. IS_TARI,
  41. TARI_MET,
  42. TARI_MON,
  43. IS_PAY_COST,
  44. IS_WATER_SUPPLY,
  45. SUPPLY_PBLM,
  46. SUPPLY_NOTE,
  47. PERS_ID,
  48. INTM,
  49. UPTM,
  50. NOTE,
  51. DATA_STAT,
  52. ID,
  53. RGSTR_ID,
  54. VILL_ID,
  55. NM,
  56. LOC,
  57. IS_POV,
  58. IS_MIN
  59. </sql>
  60. <sql id="entity_properties">
  61. #{isOver},
  62. #{othNote},
  63. #{tm},
  64. #{isInHome},
  65. #{total},
  66. #{inTotal},
  67. #{inRate},
  68. #{isTari},
  69. #{tariMet},
  70. #{tariMon},
  71. #{isPayCost},
  72. #{isWaterSupply},
  73. #{supplyPblm},
  74. #{supplyNote},
  75. #{persId},
  76. #{intm},
  77. #{uptm},
  78. #{note},
  79. #{dataStat},
  80. #{id},
  81. #{rgstrId},
  82. #{villId},
  83. #{nm},
  84. #{loc},
  85. #{isPov},
  86. #{isMin}
  87. </sql>
  88. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  89. <sql id="page_where">
  90. <trim prefix="where" prefixOverrides="and | or ">
  91. <if test="isOver != null and isOver != ''">
  92. and IS_OVER = #{isOver}
  93. </if>
  94. <if test="othNote != null and othNote != ''">
  95. and OTH_NOTE = #{othNote}
  96. </if>
  97. <if test="tm != null">
  98. and TM = #{tm}
  99. </if>
  100. <if test="isInHome != null and isInHome != ''">
  101. and IS_IN_HOME = #{isInHome}
  102. </if>
  103. <if test="total != null and total != ''">
  104. and TOTAL = #{total}
  105. </if>
  106. <if test="inTotal != null and inTotal != ''">
  107. and IN_TOTAL = #{inTotal}
  108. </if>
  109. <if test="inRate != null and inRate != ''">
  110. and IN_RATE = #{inRate}
  111. </if>
  112. <if test="isTari != null and isTari != ''">
  113. and IS_TARI = #{isTari}
  114. </if>
  115. <if test="tariMet != null and tariMet != ''">
  116. and TARI_MET = #{tariMet}
  117. </if>
  118. <if test="tariMon != null and tariMon != ''">
  119. and TARI_MON = #{tariMon}
  120. </if>
  121. <if test="isPayCost != null and isPayCost != ''">
  122. and IS_PAY_COST = #{isPayCost}
  123. </if>
  124. <if test="isWaterSupply != null and isWaterSupply != ''">
  125. and IS_WATER_SUPPLY = #{isWaterSupply}
  126. </if>
  127. <if test="supplyPblm != null and supplyPblm != ''">
  128. and SUPPLY_PBLM = #{supplyPblm}
  129. </if>
  130. <if test="supplyNote != null and supplyNote != ''">
  131. and SUPPLY_NOTE = #{supplyNote}
  132. </if>
  133. <if test="persId != null and persId != ''">
  134. and PERS_ID = #{persId}
  135. </if>
  136. <if test="intm != null">
  137. and INTM = #{intm}
  138. </if>
  139. <if test="uptm != null">
  140. and UPTM = #{uptm}
  141. </if>
  142. <if test="note != null and note != ''">
  143. and NOTE = #{note}
  144. </if>
  145. <if test="dataStat != null and dataStat != ''">
  146. and DATA_STAT = #{dataStat}
  147. </if>
  148. <if test="rgstrId != null and rgstrId != ''">
  149. and RGSTR_ID = #{rgstrId}
  150. </if>
  151. <if test="villId != null and villId != ''">
  152. and VILL_ID = #{villId}
  153. </if>
  154. <if test="nm != null and nm != ''">
  155. and NM = #{nm}
  156. </if>
  157. <if test="loc != null and loc != ''">
  158. and LOC = #{loc}
  159. </if>
  160. <if test="isPov != null and isPov != ''">
  161. and IS_POV = #{isPov}
  162. </if>
  163. <if test="isMin != null and isMin != ''">
  164. and IS_MIN = #{isMin}
  165. </if>
  166. and DATA_STAT='0'
  167. </trim>
  168. </sql>
  169. <select id="get" resultMap="bisInspVillgdNvillResultMap" parameterType="String">
  170. select
  171. <include refid="table_columns"/>
  172. from BIS_INSP_VILLGD_NVILL where ID = #{id}
  173. </select>
  174. <select id="getBy" resultMap="bisInspVillgdNvillResultMap">
  175. select
  176. <include refid="table_columns"/>
  177. from BIS_INSP_VILLGD_NVILL
  178. <include refid="page_where"/>
  179. </select>
  180. <select id="findAll" resultMap="bisInspVillgdNvillResultMap">
  181. select
  182. <include refid="table_columns"/>
  183. from BIS_INSP_VILLGD_NVILL
  184. </select>
  185. <select id="findList" resultMap="bisInspVillgdNvillResultMap">
  186. select
  187. <include refid="table_columns"/>
  188. from BIS_INSP_VILLGD_NVILL
  189. <include refid="page_where"/>
  190. </select>
  191. <select id="selectCount" resultType="int">
  192. select count(NV.ID)
  193. from BIS_INSP_VILLGD_NVILL NV
  194. JOIN BIS_INSP_VILLGD_VILL V ON V.ID = NV.VILL_ID
  195. <where>
  196. NV.DATA_STAT='0'
  197. <if test="rgstrId != null and rgstrId != ''">
  198. and V.RGSTR_ID = #{rgstrId}
  199. </if>
  200. </where>
  201. </select>
  202. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspVillgdNvill">
  203. insert into BIS_INSP_VILLGD_NVILL(
  204. <include refid="table_columns"/>
  205. ) values (
  206. <include refid="entity_properties"/>
  207. )
  208. </insert>
  209. <delete id="delete" parameterType="java.lang.String">
  210. update BIS_INSP_VILLGD_NVILL set DATA_STAT='9' where ID = #{id}
  211. </delete>
  212. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspVillgdNvill">
  213. update BIS_INSP_VILLGD_NVILL set DATA_STAT='9'
  214. <include refid="page_where"/>
  215. </delete>
  216. <update id="deleteInFlag" parameterType="java.lang.String">
  217. update BIS_INSP_VILLGD_NVILL set DATA_STAT = '9' where ID = #{id}
  218. </update>
  219. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspVillgdNvill">
  220. update BIS_INSP_VILLGD_NVILL
  221. <trim prefix="set" suffixOverrides=",">
  222. <if test="isOver != null and isOver != ''">IS_OVER
  223. = #{isOver},
  224. </if>
  225. <if test="othNote != null and othNote != ''">OTH_NOTE
  226. = #{othNote},
  227. </if>
  228. <if test="tm != null">TM
  229. = #{tm},
  230. </if>
  231. <if test="isInHome != null and isInHome != ''">IS_IN_HOME
  232. = #{isInHome},
  233. </if>
  234. <if test="total != null and total != ''">TOTAL
  235. = #{total},
  236. </if>
  237. <if test="inTotal != null and inTotal != ''">IN_TOTAL
  238. = #{inTotal},
  239. </if>
  240. <if test="inRate != null and inRate != ''">IN_RATE
  241. = #{inRate},
  242. </if>
  243. <if test="isTari != null and isTari != ''">IS_TARI
  244. = #{isTari},
  245. </if>
  246. <if test="tariMet != null and tariMet != ''">TARI_MET
  247. = #{tariMet},
  248. </if>
  249. <if test="tariMon != null and tariMon != ''">TARI_MON
  250. = #{tariMon},
  251. </if>
  252. <if test="isPayCost != null and isPayCost != ''">IS_PAY_COST
  253. = #{isPayCost},
  254. </if>
  255. <if test="isWaterSupply != null and isWaterSupply != ''">IS_WATER_SUPPLY
  256. = #{isWaterSupply},
  257. </if>
  258. <if test="supplyPblm != null and supplyPblm != ''">SUPPLY_PBLM
  259. = #{supplyPblm},
  260. </if>
  261. <if test="supplyNote != null and supplyNote != ''">SUPPLY_NOTE
  262. = #{supplyNote},
  263. </if>
  264. <if test="persId != null and persId != ''">PERS_ID
  265. = #{persId},
  266. </if>
  267. <if test="intm != null">INTM
  268. = #{intm},
  269. </if>
  270. <if test="uptm != null">UPTM
  271. = #{uptm},
  272. </if>
  273. <if test="note != null and note != ''">NOTE
  274. = #{note},
  275. </if>
  276. <if test="dataStat != null and dataStat != ''">DATA_STAT
  277. = #{dataStat},
  278. </if>
  279. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  280. = #{rgstrId},
  281. </if>
  282. <if test="villId != null and villId != ''">VILL_ID
  283. = #{villId},
  284. </if>
  285. <if test="nm != null and nm != ''">NM
  286. = #{nm},
  287. </if>
  288. <if test="loc != null and loc != ''">LOC
  289. = #{loc},
  290. </if>
  291. <if test="isPov != null and isPov != ''">IS_POV
  292. = #{isPov},
  293. </if>
  294. <if test="isMin != null and isMin != ''">IS_MIN
  295. = #{isMin},
  296. </if>
  297. </trim>
  298. <where>ID = #{id}</where>
  299. </update>
  300. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspVillgdNvill">
  301. update BIS_INSP_VILLGD_NVILL
  302. <trim prefix="set" suffixOverrides=",">
  303. <if test="isOver != null and isOver != ''">IS_OVER
  304. = #{isOver},
  305. </if>
  306. <if test="othNote != null and othNote != ''">OTH_NOTE
  307. = #{othNote},
  308. </if>
  309. <if test="tm != null">TM
  310. = #{tm},
  311. </if>
  312. <if test="isInHome != null and isInHome != ''">IS_IN_HOME
  313. = #{isInHome},
  314. </if>
  315. <if test="total != null and total != ''">TOTAL
  316. = #{total},
  317. </if>
  318. <if test="inTotal != null and inTotal != ''">IN_TOTAL
  319. = #{inTotal},
  320. </if>
  321. <if test="inRate != null and inRate != ''">IN_RATE
  322. = #{inRate},
  323. </if>
  324. <if test="isTari != null and isTari != ''">IS_TARI
  325. = #{isTari},
  326. </if>
  327. <if test="tariMet != null and tariMet != ''">TARI_MET
  328. = #{tariMet},
  329. </if>
  330. <if test="tariMon != null and tariMon != ''">TARI_MON
  331. = #{tariMon},
  332. </if>
  333. <if test="isPayCost != null and isPayCost != ''">IS_PAY_COST
  334. = #{isPayCost},
  335. </if>
  336. <if test="isWaterSupply != null and isWaterSupply != ''">IS_WATER_SUPPLY
  337. = #{isWaterSupply},
  338. </if>
  339. <if test="supplyPblm != null and supplyPblm != ''">SUPPLY_PBLM
  340. = #{supplyPblm},
  341. </if>
  342. <if test="supplyNote != null and supplyNote != ''">SUPPLY_NOTE
  343. = #{supplyNote},
  344. </if>
  345. <if test="persId != null and persId != ''">PERS_ID
  346. = #{persId},
  347. </if>
  348. <if test="intm != null">INTM
  349. = #{intm},
  350. </if>
  351. <if test="uptm != null">UPTM
  352. = #{uptm},
  353. </if>
  354. <if test="note != null and note != ''">NOTE
  355. = #{note},
  356. </if>
  357. <if test="dataStat != null and dataStat != ''">DATA_STAT
  358. = #{dataStat},
  359. </if>
  360. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  361. = #{rgstrId},
  362. </if>
  363. <if test="villId != null and villId != ''">VILL_ID
  364. = #{villId},
  365. </if>
  366. <if test="nm != null and nm != ''">NM
  367. = #{nm},
  368. </if>
  369. <if test="loc != null and loc != ''">LOC
  370. = #{loc},
  371. </if>
  372. <if test="isPov != null and isPov != ''">IS_POV
  373. = #{isPov},
  374. </if>
  375. <if test="isMin != null and isMin != ''">IS_MIN
  376. = #{isMin},
  377. </if>
  378. </trim>
  379. <include refid="page_where"/>
  380. </update>
  381. <!-- 其他自定义SQL -->
  382. </mapper>