BisInspIrrTownsDsuDao.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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.BisInspIrrTownsDsuDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspIrrTownsDsu" id="bisInspIrrTownsDsuResultMap">
  5. <result property="curBulDep" column="CUR_BUL_DEP"/>
  6. <result property="curRunDep" column="CUR_RUN_DEP"/>
  7. <result property="inBulMoney" column="IN_BUL_MONEY"/>
  8. <result property="inRunMoney" column="IN_RUN_MONEY"/>
  9. <result property="othrStnMoney" column="OTHR_STN_MONEY"/>
  10. <result property="collectStnMoney" column="COLLECT_STN_MONEY"/>
  11. <result property="wtrpPblm" column="WTRP_PBLM"/>
  12. <result property="comments" column="COMMENTS"/>
  13. <result property="invsrName" column="INVSR_NAME"/>
  14. <result property="invsrPhone" column="INVSR_PHONE"/>
  15. <result property="cunCntcName" column="CUN_CNTC_NAME"/>
  16. <result property="cunCntcPhone" column="CUN_CNTC_PHONE"/>
  17. <result property="rsrchTm" column="RSRCH_TM"/>
  18. <result property="persId" column="PERS_ID"/>
  19. <result property="intm" column="INTM"/>
  20. <result property="uptm" column="UPTM"/>
  21. <result property="dataStat" column="DATA_STAT"/>
  22. <result property="state" column="STATE"/>
  23. <result property="id" column="ID"/>
  24. <result property="rgstrId" column="RGSTR_ID"/>
  25. <result property="objId" column="OBJ_ID"/>
  26. <result property="adCode" column="AD_CODE"/>
  27. <result property="adName" column="AD_NAME"/>
  28. <result property="rurPop" column="RUR_POP"/>
  29. <result property="effIrrArea" column="EFF_IRR_AREA"/>
  30. <result property="lndfrm" column="LNDFRM"/>
  31. <result property="prjPbmArea" column="PRJ_PBM_AREA"/>
  32. <result property="townsOrgNm" column="TOWNS_ORG_NM"/>
  33. <result property="townsOrgType" column="TOWNS_ORG_TYPE"/>
  34. <result property="townsOrgWork" column="TOWNS_ORG_WORK"/>
  35. <result property="centerX" column="CENTER_X"/>
  36. <result property="centerY" column="CENTER_Y"/>
  37. <result property="gdX" column="GD_X"/>
  38. <result property="gdY" column="GD_Y"/>
  39. <result property="townsOrgTypeNote" column="TOWNS_ORG_TYPE_NOTE"/>
  40. <result property="curBulDepNote" column="CUR_BUL_DEP_NOTE"/>
  41. <result property="curRunDepNote" column="CUR_RUN_DEP_NOTE"/>
  42. </resultMap>
  43. <sql id="table_columns">
  44. TOWNS_ORG_TYPE_NOTE,
  45. CUR_BUL_DEP_NOTE,
  46. CUR_RUN_DEP_NOTE,
  47. CENTER_X,
  48. CENTER_Y,
  49. GD_X,
  50. GD_Y,
  51. CUR_BUL_DEP,
  52. CUR_RUN_DEP,
  53. IN_BUL_MONEY,
  54. IN_RUN_MONEY,
  55. OTHR_STN_MONEY,
  56. COLLECT_STN_MONEY,
  57. WTRP_PBLM,
  58. COMMENTS,
  59. INVSR_NAME,
  60. INVSR_PHONE,
  61. CUN_CNTC_NAME,
  62. CUN_CNTC_PHONE,
  63. RSRCH_TM,
  64. PERS_ID,
  65. INTM,
  66. UPTM,
  67. DATA_STAT,
  68. STATE,
  69. ID,
  70. RGSTR_ID,
  71. OBJ_ID,
  72. AD_CODE,
  73. AD_NAME,
  74. RUR_POP,
  75. EFF_IRR_AREA,
  76. LNDFRM,
  77. PRJ_PBM_AREA,
  78. TOWNS_ORG_NM,
  79. TOWNS_ORG_TYPE,
  80. TOWNS_ORG_WORK
  81. </sql>
  82. <sql id="entity_properties">
  83. #{townsOrgTypeNote},
  84. #{curBulDepNote},
  85. #{curRunDepNote},
  86. #{centerX},
  87. #{centerY},
  88. #{gdX},
  89. #{gdY},
  90. #{curBulDep},
  91. #{curRunDep},
  92. #{inBulMoney},
  93. #{inRunMoney},
  94. #{othrStnMoney},
  95. #{collectStnMoney},
  96. #{wtrpPblm},
  97. #{comments},
  98. #{invsrName},
  99. #{invsrPhone},
  100. #{cunCntcName},
  101. #{cunCntcPhone},
  102. #{rsrchTm},
  103. #{persId},
  104. #{intm},
  105. #{uptm},
  106. #{dataStat},
  107. #{state},
  108. #{id},
  109. #{rgstrId},
  110. #{objId},
  111. #{adCode},
  112. #{adName},
  113. #{rurPop},
  114. #{effIrrArea},
  115. #{lndfrm},
  116. #{prjPbmArea},
  117. #{townsOrgNm},
  118. #{townsOrgType},
  119. #{townsOrgWork}
  120. </sql>
  121. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  122. <sql id="page_where">
  123. <trim prefix="where" prefixOverrides="and | or ">
  124. <if test="townsOrgTypeNote != null and townsOrgTypeNote != ''">and TOWNS_ORG_TYPE_NOTE = #{townsOrgTypeNote}</if>
  125. <if test="curBulDepNote != null and curBulDepNote != ''">and CUR_BUL_DEP_NOTE = #{curBulDepNote}</if>
  126. <if test="curRunDepNote != null and curRunDepNote != ''">and CUR_RUN_DEP_NOTE = #{curRunDepNote}</if>
  127. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  128. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  129. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  130. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  131. <if test="curRunDep != null and curRunDep != ''">and CUR_RUN_DEP = #{curRunDep}</if>
  132. <if test="inBulMoney != null and inBulMoney != ''">and IN_BUL_MONEY = #{inBulMoney}</if>
  133. <if test="inRunMoney != null and inRunMoney != ''">and IN_RUN_MONEY = #{inRunMoney}</if>
  134. <if test="othrStnMoney != null and othrStnMoney != ''">and OTHR_STN_MONEY = #{othrStnMoney}</if>
  135. <if test="collectStnMoney != null and collectStnMoney != ''">and COLLECT_STN_MONEY = #{collectStnMoney}</if>
  136. <if test="wtrpPblm != null and wtrpPblm != ''">and WTRP_PBLM = #{wtrpPblm}</if>
  137. <if test="comments != null and comments != ''">and COMMENTS = #{comments}</if>
  138. <if test="invsrName != null and invsrName != ''">and INVSR_NAME = #{invsrName}</if>
  139. <if test="invsrPhone != null and invsrPhone != ''">and INVSR_PHONE = #{invsrPhone}</if>
  140. <if test="cunCntcName != null and cunCntcName != ''">and CUN_CNTC_NAME = #{cunCntcName}</if>
  141. <if test="cunCntcPhone != null and cunCntcPhone != ''">and CUN_CNTC_PHONE = #{cunCntcPhone}</if>
  142. <if test="rsrchTm != null">and RSRCH_TM = #{rsrchTm}</if>
  143. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  144. <if test="intm != null">and INTM = #{intm}</if>
  145. <if test="uptm != null">and UPTM = #{uptm}</if>
  146. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  147. <if test="state != null and state != ''">and STATE = #{state}</if>
  148. <if test="id != null and id != ''">and ID = #{id}</if>
  149. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  150. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  151. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  152. <if test="adName != null and adName != ''">and AD_NAME like concat('%',concat(#{adName},'%'))</if>
  153. <if test="rurPop != null and rurPop != ''">and RUR_POP = #{rurPop}</if>
  154. <if test="effIrrArea != null and effIrrArea != ''">and EFF_IRR_AREA = #{effIrrArea}</if>
  155. <if test="lndfrm != null and lndfrm != ''">and LNDFRM = #{lndfrm}</if>
  156. <if test="prjPbmArea != null and prjPbmArea != ''">and PRJ_PBM_AREA = #{prjPbmArea}</if>
  157. <if test="townsOrgNm != null and townsOrgNm != ''">and TOWNS_ORG_NM = #{townsOrgNm}</if>
  158. <if test="townsOrgType != null and townsOrgType != ''">and TOWNS_ORG_TYPE = #{townsOrgType}</if>
  159. <if test="townsOrgWork != null and townsOrgWork != ''">and TOWNS_ORG_WORK = #{townsOrgWork}</if>
  160. and DATA_STAT='0'
  161. </trim>
  162. </sql>
  163. <select id="get" resultMap="bisInspIrrTownsDsuResultMap" parameterType="String" >
  164. select <include refid="table_columns" /> from BIS_INSP_IRR_TOWNS_DSU where ID = #{id}
  165. </select>
  166. <select id="getBy" resultMap="bisInspIrrTownsDsuResultMap">
  167. select <include refid="table_columns" /> from BIS_INSP_IRR_TOWNS_DSU <include refid="page_where" />
  168. </select>
  169. <select id="findAll" resultMap="bisInspIrrTownsDsuResultMap">
  170. select <include refid="table_columns" /> from BIS_INSP_IRR_TOWNS_DSU
  171. </select>
  172. <select id="findList" resultMap="bisInspIrrTownsDsuResultMap">
  173. select <include refid="table_columns" /> from BIS_INSP_IRR_TOWNS_DSU <include refid="page_where" />
  174. </select>
  175. <select id="selectCount" resultType="int" >
  176. select count(ID) from BIS_INSP_IRR_TOWNS_DSU <include refid="page_where" />
  177. </select>
  178. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspIrrTownsDsu">
  179. insert into BIS_INSP_IRR_TOWNS_DSU( <include refid="table_columns" /> )
  180. values ( <include refid="entity_properties" /> )
  181. </insert>
  182. <delete id="delete" parameterType="java.lang.String">
  183. update BIS_INSP_IRR_TOWNS_DSU set DATA_STAT='9' where ID = #{id}
  184. </delete>
  185. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspIrrTownsDsu">
  186. update BIS_INSP_IRR_TOWNS_DSU set DATA_STAT='9' <include refid="page_where" />
  187. </delete>
  188. <update id="deleteInFlag" parameterType="java.lang.String">
  189. update BIS_INSP_IRR_TOWNS_DSU set DATA_STAT = '9' where ID = #{id}
  190. </update>
  191. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspIrrTownsDsu">
  192. update BIS_INSP_IRR_TOWNS_DSU
  193. <trim prefix="set" suffixOverrides=",">
  194. <if test="townsOrgTypeNote != null and townsOrgTypeNote != ''">TOWNS_ORG_TYPE_NOTE = #{townsOrgTypeNote},</if>
  195. <if test="curBulDepNote != null and curBulDepNote != ''">CUR_BUL_DEP_NOTE = #{curBulDepNote},</if>
  196. <if test="curRunDepNote != null and curRunDepNote != ''">CUR_RUN_DEP_NOTE = #{curRunDepNote},</if>
  197. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  198. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  199. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  200. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  201. <if test="curRunDep != null and curRunDep != ''">CUR_RUN_DEP = #{curRunDep},</if>
  202. <if test="inBulMoney != null and inBulMoney != ''">IN_BUL_MONEY = #{inBulMoney},</if>
  203. <if test="inRunMoney != null and inRunMoney != ''">IN_RUN_MONEY = #{inRunMoney},</if>
  204. <if test="othrStnMoney != null and othrStnMoney != ''">OTHR_STN_MONEY = #{othrStnMoney},</if>
  205. <if test="collectStnMoney != null and collectStnMoney != ''">COLLECT_STN_MONEY = #{collectStnMoney},</if>
  206. <if test="wtrpPblm != null and wtrpPblm != ''">WTRP_PBLM = #{wtrpPblm},</if>
  207. <if test="comments != null and comments != ''">COMMENTS = #{comments},</if>
  208. <if test="invsrName != null and invsrName != ''">INVSR_NAME = #{invsrName},</if>
  209. <if test="invsrPhone != null and invsrPhone != ''">INVSR_PHONE = #{invsrPhone},</if>
  210. <if test="cunCntcName != null and cunCntcName != ''">CUN_CNTC_NAME = #{cunCntcName},</if>
  211. <if test="cunCntcPhone != null and cunCntcPhone != ''">CUN_CNTC_PHONE = #{cunCntcPhone},</if>
  212. <if test="rsrchTm != null">RSRCH_TM = #{rsrchTm},</if>
  213. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  214. <if test="intm != null">INTM = #{intm},</if>
  215. <if test="uptm != null">UPTM = #{uptm},</if>
  216. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  217. <if test="state != null and state != ''">STATE = #{state},</if>
  218. <if test="id != null and id != ''">ID = #{id},</if>
  219. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  220. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  221. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  222. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  223. <if test="rurPop != null and rurPop != ''">RUR_POP = #{rurPop},</if>
  224. <if test="effIrrArea != null and effIrrArea != ''">EFF_IRR_AREA = #{effIrrArea},</if>
  225. <if test="lndfrm != null and lndfrm != ''">LNDFRM = #{lndfrm},</if>
  226. <if test="prjPbmArea != null and prjPbmArea != ''">PRJ_PBM_AREA = #{prjPbmArea},</if>
  227. <if test="townsOrgNm != null and townsOrgNm != ''">TOWNS_ORG_NM = #{townsOrgNm},</if>
  228. <if test="townsOrgType != null and townsOrgType != ''">TOWNS_ORG_TYPE = #{townsOrgType},</if>
  229. <if test="townsOrgWork != null and townsOrgWork != ''">TOWNS_ORG_WORK = #{townsOrgWork},</if>
  230. </trim>
  231. <where>ID = #{id}</where>
  232. </update>
  233. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspIrrTownsDsu">
  234. update BIS_INSP_IRR_TOWNS_DSU
  235. <trim prefix="set" suffixOverrides=",">
  236. <if test="townsOrgTypeNote != null and townsOrgTypeNote != ''">TOWNS_ORG_TYPE_NOTE = #{townsOrgTypeNote},</if>
  237. <if test="curBulDepNote != null and curBulDepNote != ''">CUR_BUL_DEP_NOTE = #{curBulDepNote},</if>
  238. <if test="curRunDepNote != null and curRunDepNote != ''">CUR_RUN_DEP_NOTE = #{curRunDepNote},</if>
  239. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  240. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  241. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  242. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  243. <if test="curRunDep != null and curRunDep != ''">CUR_RUN_DEP = #{curRunDep},</if>
  244. <if test="inBulMoney != null and inBulMoney != ''">IN_BUL_MONEY = #{inBulMoney},</if>
  245. <if test="inRunMoney != null and inRunMoney != ''">IN_RUN_MONEY = #{inRunMoney},</if>
  246. <if test="othrStnMoney != null and othrStnMoney != ''">OTHR_STN_MONEY = #{othrStnMoney},</if>
  247. <if test="collectStnMoney != null and collectStnMoney != ''">COLLECT_STN_MONEY = #{collectStnMoney},</if>
  248. <if test="wtrpPblm != null and wtrpPblm != ''">WTRP_PBLM = #{wtrpPblm},</if>
  249. <if test="comments != null and comments != ''">COMMENTS = #{comments},</if>
  250. <if test="invsrName != null and invsrName != ''">INVSR_NAME = #{invsrName},</if>
  251. <if test="invsrPhone != null and invsrPhone != ''">INVSR_PHONE = #{invsrPhone},</if>
  252. <if test="cunCntcName != null and cunCntcName != ''">CUN_CNTC_NAME = #{cunCntcName},</if>
  253. <if test="cunCntcPhone != null and cunCntcPhone != ''">CUN_CNTC_PHONE = #{cunCntcPhone},</if>
  254. <if test="rsrchTm != null">RSRCH_TM = #{rsrchTm},</if>
  255. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  256. <if test="intm != null">INTM = #{intm},</if>
  257. <if test="uptm != null">UPTM = #{uptm},</if>
  258. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  259. <if test="state != null and state != ''">STATE = #{state},</if>
  260. <if test="id != null and id != ''">ID = #{id},</if>
  261. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  262. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  263. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  264. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  265. <if test="rurPop != null and rurPop != ''">RUR_POP = #{rurPop},</if>
  266. <if test="effIrrArea != null and effIrrArea != ''">EFF_IRR_AREA = #{effIrrArea},</if>
  267. <if test="lndfrm != null and lndfrm != ''">LNDFRM = #{lndfrm},</if>
  268. <if test="prjPbmArea != null and prjPbmArea != ''">PRJ_PBM_AREA = #{prjPbmArea},</if>
  269. <if test="townsOrgNm != null and townsOrgNm != ''">TOWNS_ORG_NM = #{townsOrgNm},</if>
  270. <if test="townsOrgType != null and townsOrgType != ''">TOWNS_ORG_TYPE = #{townsOrgType},</if>
  271. <if test="townsOrgWork != null and townsOrgWork != ''">TOWNS_ORG_WORK = #{townsOrgWork},</if>
  272. </trim>
  273. <include refid="page_where" />
  274. </update>
  275. <!-- 其他自定义SQL -->
  276. <select id="findTownList" parameterType="cn.com.goldenwater.dcproj.param.BisInspIrrTownsDsuParam" resultType="cn.com.goldenwater.dcproj.dto.TreeDto">
  277. select t.ad_code,t.ad_name,t.id from BIS_INSP_IRR_TOWNS_DSU t where
  278. t.data_stat = '0'
  279. and t.ad_code is not null and substr(t.ad_code,10)='000' and t.data_stat = '0'
  280. <if test="rgstrId != null and rgstrId != ''">
  281. AND t.rgstr_id = #{rgstrId}
  282. </if>
  283. <if test="adCode != null and adCode != ''">
  284. and t.ad_code like '${adCode}%'
  285. </if>
  286. </select>
  287. <select id="findTownDsuList" parameterType="cn.com.goldenwater.dcproj.param.BisInspIrrTownsDsuParam" resultType="cn.com.goldenwater.dcproj.model.BisInspIrrTownsDsu">
  288. select * from BIS_INSP_IRR_TOWNS_DSU t where
  289. t.data_stat = '0'
  290. and t.ad_code is not null and t.data_stat = '0' and substr(t.ad_code,10)='000'
  291. <if test="rgstrId != null and rgstrId != ''">
  292. AND t.rgstr_id = #{rgstrId}
  293. </if>
  294. <if test="adCode != null and adCode != ''">
  295. and t.ad_code like '${adCode}%'
  296. </if>
  297. </select>
  298. <select id="findVillList" parameterType="cn.com.goldenwater.dcproj.param.BisInspIrrTownsDsuParam" resultType="cn.com.goldenwater.dcproj.model.BisInspIrrTownsDsu">
  299. select * from BIS_INSP_IRR_TOWNS_DSU t where
  300. t.data_stat = '0'
  301. and t.ad_code is not null and t.data_stat = '0' and substr(t.ad_code,10)!='000'
  302. <if test="rgstrId != null and rgstrId != ''">
  303. AND t.rgstr_id = #{rgstrId}
  304. </if>
  305. <if test="adCode != null and adCode != ''">
  306. and t.ad_code like '${adCode}%'
  307. </if>
  308. </select>
  309. <select id="findProjectList" parameterType="cn.com.goldenwater.dcproj.param.BisInspIrrTownsDsuParam" resultType="cn.com.goldenwater.dcproj.dto.BisInspTownsDsuDto">
  310. select * from VIEW_IRR_LIST t
  311. where t.rgstr_id = #{rgstrId}
  312. <if test="type != null and type != ''">
  313. and t.type in (${type})
  314. </if>
  315. <if test="adCode != null and adCode != ''">
  316. and t.ad_code = #{adCode}
  317. </if>
  318. </select>
  319. </mapper>