2db9cd9a063ee8ec7a27cd9eb697ffa1eb7a3ee2.svn-base 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  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.AttEngResDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttEngRes" id="attEngResResultMap">
  5. <result property="deadCap" column="DEAD_CAP"/>
  6. <result property="flcoCap" column="FLCO_CAP"/>
  7. <result property="note" column="NOTE"/>
  8. <result property="collTime" column="COLL_TIME"/>
  9. <result property="updTime" column="UPD_TIME"/>
  10. <result property="recPers" column="REC_PERS"/>
  11. <result property="engReinForceGuid" column="ENG_REIN_FORCE_GUID"/>
  12. <result property="guid" column="GUID"/>
  13. <result property="pGuid" column="P_GUID"/>
  14. <result property="engName" column="ENG_NAME"/>
  15. <result property="engGuid" column="ENG_GUID"/>
  16. <result property="impoGrad" column="IMPO_GRAD"/>
  17. <result property="apprBudg" column="APPR_BUDG"/>
  18. <result property="startDate" column="START_DATE"/>
  19. <result property="compDate" column="COMP_DATE"/>
  20. <result property="engStat" column="ENG_STAT"/>
  21. <result property="orgGuid" column="ORG_GUID"/>
  22. <result property="oflpCode" column="OFLP_CODE"/>
  23. <result property="ifReinForce" column="IF_REIN_FORCE"/>
  24. <result property="projGuid" column="PROJ_GUID"/>
  25. <result property="stat" column="STAT"/>
  26. <result property="resCode" column="RES_CODE"/>
  27. <result property="cenLong" column="CEN_LONG"/>
  28. <result property="cenLat" column="CEN_LAT"/>
  29. <result property="resLoc" column="RES_LOC"/>
  30. <result property="rvGuid" column="RV_GUID"/>
  31. <result property="adGuid" column="AD_GUID"/>
  32. <result property="engGrad" column="ENG_GRAD"/>
  33. <result property="engScal" column="ENG_SCAL"/>
  34. <result property="damTypeMat" column="DAM_TYPE_MAT"/>
  35. <result property="damTypeStr" column="DAM_TYPE_STR"/>
  36. <result property="damSizeHig" column="DAM_SIZE_HIG"/>
  37. <result property="damSizeLen" column="DAM_SIZE_LEN"/>
  38. <result property="damCreElv" column="DAM_CRE_ELV"/>
  39. <result property="desFlStand" column="DES_FL_STAND"/>
  40. <result property="flLowLimLev" column="FL_LOW_LIM_LEV"/>
  41. <result property="flLowLimLevStart" column="FL_LOW_LIM_LEV_START"/>
  42. <result property="flLowLimLevEnd" column="FL_LOW_LIM_LEV_END"/>
  43. <result property="desFlStag" column="DES_FL_STAG"/>
  44. <result property="mainFlType" column="MAIN_FL_TYPE"/>
  45. <result property="deadLev" column="DEAD_LEV"/>
  46. <result property="totCap" column="TOT_CAP"/>
  47. </resultMap>
  48. <sql id="table_columns">
  49. DEAD_CAP,
  50. FLCO_CAP,
  51. NOTE,
  52. COLL_TIME,
  53. UPD_TIME,
  54. REC_PERS,
  55. ENG_REIN_FORCE_GUID,
  56. GUID,
  57. P_GUID,
  58. ENG_NAME,
  59. ENG_GUID,
  60. IMPO_GRAD,
  61. APPR_BUDG,
  62. START_DATE,
  63. COMP_DATE,
  64. ENG_STAT,
  65. ORG_GUID,
  66. OFLP_CODE,
  67. IF_REIN_FORCE,
  68. PROJ_GUID,
  69. STAT,
  70. RES_CODE,
  71. CEN_LONG,
  72. CEN_LAT,
  73. RES_LOC,
  74. RV_GUID,
  75. AD_GUID,
  76. ENG_GRAD,
  77. ENG_SCAL,
  78. DAM_TYPE_MAT,
  79. DAM_TYPE_STR,
  80. DAM_SIZE_HIG,
  81. DAM_SIZE_LEN,
  82. DAM_CRE_ELV,
  83. DES_FL_STAND,
  84. FL_LOW_LIM_LEV,
  85. FL_LOW_LIM_LEV_START,
  86. FL_LOW_LIM_LEV_END,
  87. DES_FL_STAG,
  88. MAIN_FL_TYPE,
  89. DEAD_LEV,
  90. TOT_CAP
  91. </sql>
  92. <sql id="entity_properties">
  93. #{deadCap},
  94. #{flcoCap},
  95. #{note},
  96. #{collTime},
  97. #{updTime},
  98. #{recPers},
  99. #{engReinForceGuid},
  100. #{guid},
  101. #{pGuid},
  102. #{engName},
  103. #{engGuid},
  104. #{impoGrad},
  105. #{apprBudg},
  106. #{startDate},
  107. #{compDate},
  108. #{engStat},
  109. #{orgGuid},
  110. #{oflpCode},
  111. #{ifReinForce},
  112. #{projGuid},
  113. #{stat},
  114. #{resCode},
  115. #{cenLong},
  116. #{cenLat},
  117. #{resLoc},
  118. #{rvGuid},
  119. #{adGuid},
  120. #{engGrad},
  121. #{engScal},
  122. #{damTypeMat},
  123. #{damTypeStr},
  124. #{damSizeHig},
  125. #{damSizeLen},
  126. #{damCreElv},
  127. #{desFlStand},
  128. #{flLowLimLev},
  129. #{flLowLimLevStart},
  130. #{flLowLimLevEnd},
  131. #{desFlStag},
  132. #{mainFlType},
  133. #{deadLev},
  134. #{totCap}
  135. </sql>
  136. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  137. <sql id="page_where">
  138. <trim prefix="where" prefixOverrides="and | or ">
  139. <if test="flcoCap != null and flcoCap != ''">and FLCO_CAP = #{flcoCap}</if>
  140. <if test="note != null and note != ''">and NOTE = #{note}</if>
  141. <if test="collTime != null">and COLL_TIME = #{collTime}</if>
  142. <if test="updTime != null">and UPD_TIME = #{updTime}</if>
  143. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  144. <if test="engReinForceGuid != null and engReinForceGuid != ''">and ENG_REIN_FORCE_GUID = #{engReinForceGuid}</if>
  145. <if test="guid != null and guid != ''">and GUID = #{guid}</if>
  146. <if test="pGuid != null and pGuid != ''">and P_GUID = #{pGuid}</if>
  147. <if test="engName != null and engName != ''">and ENG_NAME = #{engName}</if>
  148. <if test="engGuid != null and engGuid != ''">and ENG_GUID = #{engGuid}</if>
  149. <if test="impoGrad != null">and IMPO_GRAD = #{impoGrad}</if>
  150. <if test="apprBudg != null and apprBudg != ''">and APPR_BUDG = #{apprBudg}</if>
  151. <if test="startDate != null">and START_DATE = #{startDate}</if>
  152. <if test="compDate != null">and COMP_DATE = #{compDate}</if>
  153. <if test="engStat != null">and ENG_STAT = #{engStat}</if>
  154. <if test="orgGuid != null and orgGuid != ''">and ORG_GUID = #{orgGuid}</if>
  155. <if test="oflpCode != null and oflpCode != ''">and OFLP_CODE = #{oflpCode}</if>
  156. <if test="ifReinForce != null">and IF_REIN_FORCE = #{ifReinForce}</if>
  157. <if test="projGuid != null and projGuid != ''">and PROJ_GUID = #{projGuid}</if>
  158. <if test="stat != null">and STAT = #{stat}</if>
  159. <if test="resCode != null and resCode != ''">and RES_CODE = #{resCode}</if>
  160. <if test="cenLong != null and cenLong != ''">and CEN_LONG = #{cenLong}</if>
  161. <if test="cenLat != null and cenLat != ''">and CEN_LAT = #{cenLat}</if>
  162. <if test="resLoc != null and resLoc != ''">and RES_LOC = #{resLoc}</if>
  163. <if test="rvGuid != null and rvGuid != ''">and RV_GUID = #{rvGuid}</if>
  164. <if test="adGuid != null and adGuid != ''">and AD_GUID = #{adGuid}</if>
  165. <if test="engGrad != null">and ENG_GRAD = #{engGrad}</if>
  166. <if test="engScal != null">and ENG_SCAL = #{engScal}</if>
  167. <if test="damTypeMat != null">and DAM_TYPE_MAT = #{damTypeMat}</if>
  168. <if test="damTypeStr != null">and DAM_TYPE_STR = #{damTypeStr}</if>
  169. <if test="damSizeHig != null and damSizeHig != ''">and DAM_SIZE_HIG = #{damSizeHig}</if>
  170. <if test="damSizeLen != null and damSizeLen != ''">and DAM_SIZE_LEN = #{damSizeLen}</if>
  171. <if test="damCreElv != null and damCreElv != ''">and DAM_CRE_ELV = #{damCreElv}</if>
  172. <if test="desFlStand != null and desFlStand != ''">and DES_FL_STAND = #{desFlStand}</if>
  173. <if test="flLowLimLev != null and flLowLimLev != ''">and FL_LOW_LIM_LEV = #{flLowLimLev}</if>
  174. <if test="flLowLimLevStart != null">and FL_LOW_LIM_LEV_START = #{flLowLimLevStart}</if>
  175. <if test="flLowLimLevEnd != null">and FL_LOW_LIM_LEV_END = #{flLowLimLevEnd}</if>
  176. <if test="desFlStag != null and desFlStag != ''">and DES_FL_STAG = #{desFlStag}</if>
  177. <if test="mainFlType != null">and MAIN_FL_TYPE = #{mainFlType}</if>
  178. <if test="deadLev != null and deadLev != ''">and DEAD_LEV = #{deadLev}</if>
  179. <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
  180. </trim>
  181. </sql>
  182. <select id="get" resultMap="attEngResResultMap" parameterType="String" >
  183. select <include refid="table_columns" /> from ATT_ENG_RES where ID = #{id}
  184. </select>
  185. <select id="getBy" resultMap="attEngResResultMap">
  186. select <include refid="table_columns" /> from ATT_ENG_RES <include refid="page_where" />
  187. </select>
  188. <select id="findAll" resultMap="attEngResResultMap">
  189. select <include refid="table_columns" /> from ATT_ENG_RES
  190. </select>
  191. <select id="findList" resultMap="attEngResResultMap">
  192. select <include refid="table_columns" /> from ATT_ENG_RES <include refid="page_where" />
  193. </select>
  194. <select id="selectCount" resultType="int" >
  195. select count(ID) from ATT_ENG_RES <include refid="page_where" />
  196. </select>
  197. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttEngRes">
  198. insert into ATT_ENG_RES( <include refid="table_columns" /> )
  199. values ( <include refid="entity_properties" /> )
  200. </insert>
  201. <delete id="delete" parameterType="java.lang.String">
  202. delete from ATT_ENG_RES where ID = #{id}
  203. </delete>
  204. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttEngRes">
  205. delete from ATT_ENG_RES <include refid="page_where" />
  206. </delete>
  207. <update id="deleteInFlag" parameterType="java.lang.String">
  208. update ATT_ENG_RES set flag_valid = 0 where ID = #{id}
  209. </update>
  210. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttEngRes">
  211. update ATT_ENG_RES
  212. <trim prefix="set" suffixOverrides=",">
  213. <if test="flcoCap != null and flcoCap != ''">FLCO_CAP = #{flcoCap},</if>
  214. <if test="note != null and note != ''">NOTE = #{note},</if>
  215. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  216. <if test="updTime != null">UPD_TIME = #{updTime},</if>
  217. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  218. <if test="engReinForceGuid != null and engReinForceGuid != ''">ENG_REIN_FORCE_GUID = #{engReinForceGuid},</if>
  219. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  220. <if test="pGuid != null and pGuid != ''">P_GUID = #{pGuid},</if>
  221. <if test="engName != null and engName != ''">ENG_NAME = #{engName},</if>
  222. <if test="engGuid != null and engGuid != ''">ENG_GUID = #{engGuid},</if>
  223. <if test="impoGrad != null">IMPO_GRAD = #{impoGrad},</if>
  224. <if test="apprBudg != null and apprBudg != ''">APPR_BUDG = #{apprBudg},</if>
  225. <if test="startDate != null">START_DATE = #{startDate},</if>
  226. <if test="compDate != null">COMP_DATE = #{compDate},</if>
  227. <if test="engStat != null">ENG_STAT = #{engStat},</if>
  228. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  229. <if test="oflpCode != null and oflpCode != ''">OFLP_CODE = #{oflpCode},</if>
  230. <if test="ifReinForce != null">IF_REIN_FORCE = #{ifReinForce},</if>
  231. <if test="projGuid != null and projGuid != ''">PROJ_GUID = #{projGuid},</if>
  232. <if test="stat != null">STAT = #{stat},</if>
  233. <if test="resCode != null and resCode != ''">RES_CODE = #{resCode},</if>
  234. <if test="cenLong != null and cenLong != ''">CEN_LONG = #{cenLong},</if>
  235. <if test="cenLat != null and cenLat != ''">CEN_LAT = #{cenLat},</if>
  236. <if test="resLoc != null and resLoc != ''">RES_LOC = #{resLoc},</if>
  237. <if test="rvGuid != null and rvGuid != ''">RV_GUID = #{rvGuid},</if>
  238. <if test="adGuid != null and adGuid != ''">AD_GUID = #{adGuid},</if>
  239. <if test="engGrad != null">ENG_GRAD = #{engGrad},</if>
  240. <if test="engScal != null">ENG_SCAL = #{engScal},</if>
  241. <if test="damTypeMat != null">DAM_TYPE_MAT = #{damTypeMat},</if>
  242. <if test="damTypeStr != null">DAM_TYPE_STR = #{damTypeStr},</if>
  243. <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
  244. <if test="damSizeLen != null and damSizeLen != ''">DAM_SIZE_LEN = #{damSizeLen},</if>
  245. <if test="damCreElv != null and damCreElv != ''">DAM_CRE_ELV = #{damCreElv},</if>
  246. <if test="desFlStand != null and desFlStand != ''">DES_FL_STAND = #{desFlStand},</if>
  247. <if test="flLowLimLev != null and flLowLimLev != ''">FL_LOW_LIM_LEV = #{flLowLimLev},</if>
  248. <if test="flLowLimLevStart != null">FL_LOW_LIM_LEV_START = #{flLowLimLevStart},</if>
  249. <if test="flLowLimLevEnd != null">FL_LOW_LIM_LEV_END = #{flLowLimLevEnd},</if>
  250. <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
  251. <if test="mainFlType != null">MAIN_FL_TYPE = #{mainFlType},</if>
  252. <if test="deadLev != null and deadLev != ''">DEAD_LEV = #{deadLev},</if>
  253. <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
  254. </trim>
  255. <where>ID = #{id}</where>
  256. </update>
  257. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttEngRes">
  258. update ATT_ENG_RES
  259. <trim prefix="set" suffixOverrides=",">
  260. <if test="flcoCap != null and flcoCap != ''">FLCO_CAP = #{flcoCap},</if>
  261. <if test="note != null and note != ''">NOTE = #{note},</if>
  262. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  263. <if test="updTime != null">UPD_TIME = #{updTime},</if>
  264. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  265. <if test="engReinForceGuid != null and engReinForceGuid != ''">ENG_REIN_FORCE_GUID = #{engReinForceGuid},</if>
  266. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  267. <if test="pGuid != null and pGuid != ''">P_GUID = #{pGuid},</if>
  268. <if test="engName != null and engName != ''">ENG_NAME = #{engName},</if>
  269. <if test="engGuid != null and engGuid != ''">ENG_GUID = #{engGuid},</if>
  270. <if test="impoGrad != null">IMPO_GRAD = #{impoGrad},</if>
  271. <if test="apprBudg != null and apprBudg != ''">APPR_BUDG = #{apprBudg},</if>
  272. <if test="startDate != null">START_DATE = #{startDate},</if>
  273. <if test="compDate != null">COMP_DATE = #{compDate},</if>
  274. <if test="engStat != null">ENG_STAT = #{engStat},</if>
  275. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  276. <if test="oflpCode != null and oflpCode != ''">OFLP_CODE = #{oflpCode},</if>
  277. <if test="ifReinForce != null">IF_REIN_FORCE = #{ifReinForce},</if>
  278. <if test="projGuid != null and projGuid != ''">PROJ_GUID = #{projGuid},</if>
  279. <if test="stat != null">STAT = #{stat},</if>
  280. <if test="resCode != null and resCode != ''">RES_CODE = #{resCode},</if>
  281. <if test="cenLong != null and cenLong != ''">CEN_LONG = #{cenLong},</if>
  282. <if test="cenLat != null and cenLat != ''">CEN_LAT = #{cenLat},</if>
  283. <if test="resLoc != null and resLoc != ''">RES_LOC = #{resLoc},</if>
  284. <if test="rvGuid != null and rvGuid != ''">RV_GUID = #{rvGuid},</if>
  285. <if test="adGuid != null and adGuid != ''">AD_GUID = #{adGuid},</if>
  286. <if test="engGrad != null">ENG_GRAD = #{engGrad},</if>
  287. <if test="engScal != null">ENG_SCAL = #{engScal},</if>
  288. <if test="damTypeMat != null">DAM_TYPE_MAT = #{damTypeMat},</if>
  289. <if test="damTypeStr != null">DAM_TYPE_STR = #{damTypeStr},</if>
  290. <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
  291. <if test="damSizeLen != null and damSizeLen != ''">DAM_SIZE_LEN = #{damSizeLen},</if>
  292. <if test="damCreElv != null and damCreElv != ''">DAM_CRE_ELV = #{damCreElv},</if>
  293. <if test="desFlStand != null and desFlStand != ''">DES_FL_STAND = #{desFlStand},</if>
  294. <if test="flLowLimLev != null and flLowLimLev != ''">FL_LOW_LIM_LEV = #{flLowLimLev},</if>
  295. <if test="flLowLimLevStart != null">FL_LOW_LIM_LEV_START = #{flLowLimLevStart},</if>
  296. <if test="flLowLimLevEnd != null">FL_LOW_LIM_LEV_END = #{flLowLimLevEnd},</if>
  297. <if test="desFlStag != null and desFlStag != ''">DES_FL_STAG = #{desFlStag},</if>
  298. <if test="mainFlType != null">MAIN_FL_TYPE = #{mainFlType},</if>
  299. <if test="deadLev != null and deadLev != ''">DEAD_LEV = #{deadLev},</if>
  300. <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
  301. </trim>
  302. <include refid="page_where" />
  303. </update>
  304. <select id="getListByAdCode" resultType="cn.com.goldenwater.dcproj.model.AttEngResAssociated" parameterType="String">
  305. select t.*, ad.ad_code, ad.ad_grad, ad.ad_name
  306. from ATT_ENG_RES t, ATT_AD_BASE ad
  307. where t.ad_guid = ad.guid
  308. <if test="null != code and ''!=code">
  309. and ad.ad_code like #{code}
  310. </if>
  311. order by ad.ad_code, ad.ad_grad asc
  312. </select>
  313. <!-- 其他自定义SQL -->
  314. <select id="getListByInspGroupIdObjType" resultType="cn.com.goldenwater.dcproj.model.AttEngRes">
  315. select t.*,o.obj_id
  316. from ATT_ENG_RES t
  317. left join BIS_INSP_OBJ o
  318. on o.obj_id = t.guid
  319. and o.obj_type = #{objType}
  320. where o.insp_group_id = #{inspGroupId}
  321. <include refid="choseSql"/>
  322. </select>
  323. <select id="getObjListByGroupIdAndTypeNew" resultType="cn.com.goldenwater.dcproj.model.AttEngRes">
  324. select * from BIS_INSP_ALL_OBJ o where id like concat(#{inspGroupId},'%')
  325. <if test="null != objType and ''!=objType">
  326. and ptype=#{objType}
  327. </if>
  328. <if test="null != name and ''!=name">
  329. and nm like concat(#{name},'%')
  330. </if>
  331. <include refid="choseSql"/>
  332. </select>
  333. <sql id="choseSql" >
  334. <choose>
  335. <when test="province !=null and province !=''">
  336. and o.ad_code=#{province}
  337. </when>
  338. <otherwise>
  339. and o.ad_code is null
  340. </otherwise>
  341. </choose>
  342. </sql>
  343. <select id="getObjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttEngRes">
  344. select *
  345. from ATT_ENG_RES t
  346. where t.guid not in (select o.obj_id
  347. from BIS_INSP_OBJ o
  348. where o.insp_group_id = #{inspGroupId}
  349. and o.obj_type = #{objType}
  350. )
  351. and t.stat = '1'
  352. <if test="null != name and '' != name">
  353. and t.eng_name like ''
  354. </if>
  355. </select>
  356. </mapper>