AttEngDikeDao.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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.AttEngDikeDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttEngDike" id="attEngDikeResultMap">
  5. <result property="guid" column="GUID"/>
  6. <result property="pGuid" column="P_GUID"/>
  7. <result property="engName" column="ENG_NAME"/>
  8. <result property="engGuid" column="ENG_GUID"/>
  9. <result property="impoGrad" column="IMPO_GRAD"/>
  10. <result property="apprBudg" column="APPR_BUDG"/>
  11. <result property="startDate" column="START_DATE"/>
  12. <result property="compDate" column="COMP_DATE"/>
  13. <result property="engStat" column="ENG_STAT"/>
  14. <result property="orgGuid" column="ORG_GUID"/>
  15. <result property="oflpCode" column="OFLP_CODE"/>
  16. <result property="ifReinForce" column="IF_REIN_FORCE"/>
  17. <result property="projGuid" column="PROJ_GUID"/>
  18. <result property="stat" column="STAT"/>
  19. <result property="dikeCode" column="DIKE_CODE"/>
  20. <result property="startLong" column="START_LONG"/>
  21. <result property="startLat" column="START_LAT"/>
  22. <result property="endLong" column="END_LONG"/>
  23. <result property="endLat" column="END_LAT"/>
  24. <result property="startLoc" column="START_LOC"/>
  25. <result property="endLoc" column="END_LOC"/>
  26. <result property="firsPoinAdGuid" column="FIRS_POIN_AD_GUID"/>
  27. <result property="endAdGuid" column="END_AD_GUID"/>
  28. <result property="rvGuid" column="RV_GUID"/>
  29. <result property="lkGuid" column="LK_GUID"/>
  30. <result property="dikeGrad" column="DIKE_GRAD"/>
  31. <result property="dikeType" column="DIKE_TYPE"/>
  32. <result property="dikeLen" column="DIKE_LEN"/>
  33. <result property="dikeSlope" column="DIKE_SLOPE"/>
  34. <result property="rvBank" column="RV_BANK"/>
  35. <result property="crosSitu" column="CROS_SITU"/>
  36. <result property="ifRoad" column="IF_ROAD"/>
  37. <result property="desFlStand" column="DES_FL_STAND"/>
  38. <result property="note" column="NOTE"/>
  39. <result property="collTime" column="COLL_TIME"/>
  40. <result property="updTime" column="UPD_TIME"/>
  41. <result property="recPers" column="REC_PERS"/>
  42. <result property="engReinForceGuid" column="ENG_REIN_FORCE_GUID"/>
  43. </resultMap>
  44. <sql id="table_columns">
  45. GUID,
  46. P_GUID,
  47. ENG_NAME,
  48. ENG_GUID,
  49. IMPO_GRAD,
  50. APPR_BUDG,
  51. START_DATE,
  52. COMP_DATE,
  53. ENG_STAT,
  54. ORG_GUID,
  55. OFLP_CODE,
  56. IF_REIN_FORCE,
  57. PROJ_GUID,
  58. STAT,
  59. DIKE_CODE,
  60. START_LONG,
  61. START_LAT,
  62. END_LONG,
  63. END_LAT,
  64. START_LOC,
  65. END_LOC,
  66. FIRS_POIN_AD_GUID,
  67. END_AD_GUID,
  68. RV_GUID,
  69. LK_GUID,
  70. DIKE_GRAD,
  71. DIKE_TYPE,
  72. DIKE_LEN,
  73. DIKE_SLOPE,
  74. RV_BANK,
  75. CROS_SITU,
  76. IF_ROAD,
  77. DES_FL_STAND,
  78. NOTE,
  79. COLL_TIME,
  80. UPD_TIME,
  81. REC_PERS,
  82. ENG_REIN_FORCE_GUID
  83. </sql>
  84. <sql id="entity_properties">
  85. #{guid},
  86. #{pGuid},
  87. #{engName},
  88. #{engGuid},
  89. #{impoGrad},
  90. #{apprBudg},
  91. #{startDate},
  92. #{compDate},
  93. #{engStat},
  94. #{orgGuid},
  95. #{oflpCode},
  96. #{ifReinForce},
  97. #{projGuid},
  98. #{stat},
  99. #{dikeCode},
  100. #{startLong},
  101. #{startLat},
  102. #{endLong},
  103. #{endLat},
  104. #{startLoc},
  105. #{endLoc},
  106. #{firsPoinAdGuid},
  107. #{endAdGuid},
  108. #{rvGuid},
  109. #{lkGuid},
  110. #{dikeGrad},
  111. #{dikeType},
  112. #{dikeLen},
  113. #{dikeSlope},
  114. #{rvBank},
  115. #{crosSitu},
  116. #{ifRoad},
  117. #{desFlStand},
  118. #{note},
  119. #{collTime},
  120. #{updTime},
  121. #{recPers},
  122. #{engReinForceGuid}
  123. </sql>
  124. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  125. <sql id="page_where">
  126. <trim prefix="where" prefixOverrides="and | or ">
  127. <if test="pGuid != null and pGuid != ''">and P_GUID = #{pGuid}</if>
  128. <if test="engName != null and engName != ''">and ENG_NAME = #{engName}</if>
  129. <if test="engGuid != null and engGuid != ''">and ENG_GUID = #{engGuid}</if>
  130. <if test="impoGrad != null and impoGrad != ''">and IMPO_GRAD = #{impoGrad}</if>
  131. <if test="apprBudg != null and apprBudg != ''">and APPR_BUDG = #{apprBudg}</if>
  132. <if test="startDate != null">and START_DATE = #{startDate}</if>
  133. <if test="compDate != null">and COMP_DATE = #{compDate}</if>
  134. <if test="engStat != null and engStat != ''">and ENG_STAT = #{engStat}</if>
  135. <if test="orgGuid != null and orgGuid != ''">and ORG_GUID = #{orgGuid}</if>
  136. <if test="oflpCode != null and oflpCode != ''">and OFLP_CODE = #{oflpCode}</if>
  137. <if test="ifReinForce != null and ifReinForce != ''">and IF_REIN_FORCE = #{ifReinForce}</if>
  138. <if test="projGuid != null and projGuid != ''">and PROJ_GUID = #{projGuid}</if>
  139. <if test="stat != null and stat != ''">and STAT = #{stat}</if>
  140. <if test="dikeCode != null and dikeCode != ''">and DIKE_CODE = #{dikeCode}</if>
  141. <if test="startLong != null and startLong != ''">and START_LONG = #{startLong}</if>
  142. <if test="startLat != null and startLat != ''">and START_LAT = #{startLat}</if>
  143. <if test="endLong != null and endLong != ''">and END_LONG = #{endLong}</if>
  144. <if test="endLat != null and endLat != ''">and END_LAT = #{endLat}</if>
  145. <if test="startLoc != null and startLoc != ''">and START_LOC = #{startLoc}</if>
  146. <if test="endLoc != null and endLoc != ''">and END_LOC = #{endLoc}</if>
  147. <if test="firsPoinAdGuid != null and firsPoinAdGuid != ''">and FIRS_POIN_AD_GUID = #{firsPoinAdGuid}</if>
  148. <if test="endAdGuid != null and endAdGuid != ''">and END_AD_GUID = #{endAdGuid}</if>
  149. <if test="rvGuid != null and rvGuid != ''">and RV_GUID = #{rvGuid}</if>
  150. <if test="lkGuid != null and lkGuid != ''">and LK_GUID = #{lkGuid}</if>
  151. <if test="dikeGrad != null and dikeGrad != ''">and DIKE_GRAD = #{dikeGrad}</if>
  152. <if test="dikeType != null and dikeType != ''">and DIKE_TYPE = #{dikeType}</if>
  153. <if test="dikeLen != null and dikeLen != ''">and DIKE_LEN = #{dikeLen}</if>
  154. <if test="dikeSlope != null and dikeSlope != ''">and DIKE_SLOPE = #{dikeSlope}</if>
  155. <if test="rvBank != null and rvBank != ''">and RV_BANK = #{rvBank}</if>
  156. <if test="crosSitu != null and crosSitu != ''">and CROS_SITU = #{crosSitu}</if>
  157. <if test="ifRoad != null and ifRoad != ''">and IF_ROAD = #{ifRoad}</if>
  158. <if test="desFlStand != null and desFlStand != ''">and DES_FL_STAND = #{desFlStand}</if>
  159. <if test="note != null and note != ''">and NOTE = #{note}</if>
  160. <if test="collTime != null">and COLL_TIME = #{collTime}</if>
  161. <if test="updTime != null">and UPD_TIME = #{updTime}</if>
  162. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  163. <if test="engReinForceGuid != null and engReinForceGuid != ''">and ENG_REIN_FORCE_GUID =
  164. #{engReinForceGuid}
  165. </if>
  166. </trim>
  167. </sql>
  168. <select id="get" resultMap="attEngDikeResultMap" parameterType="String">
  169. select
  170. <include refid="table_columns"/>
  171. from att_eng_dike where GUID = #{id}
  172. </select>
  173. <select id="getBy" resultMap="attEngDikeResultMap">
  174. select
  175. <include refid="table_columns"/>
  176. from att_eng_dike
  177. <include refid="page_where"/>
  178. </select>
  179. <select id="findAll" resultMap="attEngDikeResultMap">
  180. select
  181. <include refid="table_columns"/>
  182. from att_eng_dike
  183. </select>
  184. <select id="findList" resultMap="attEngDikeResultMap">
  185. select
  186. <include refid="table_columns"/>
  187. from att_eng_dike
  188. <include refid="page_where"/>
  189. </select>
  190. <select id="selectCount" resultType="int">
  191. select count(GUID) from att_eng_dike
  192. <include refid="page_where"/>
  193. </select>
  194. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttEngDike">
  195. insert into att_eng_dike(
  196. <include refid="table_columns"/>
  197. )
  198. values (
  199. <include refid="entity_properties"/>
  200. )
  201. </insert>
  202. <delete id="delete" parameterType="java.lang.String">
  203. delete from att_eng_dike where GUID = #{id}
  204. </delete>
  205. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttEngDike">
  206. delete from att_eng_dike
  207. <include refid="page_where"/>
  208. </delete>
  209. <update id="deleteInFlag" parameterType="java.lang.String">
  210. update att_eng_dike set flag_valid = 0 where GUID = #{id}
  211. </update>
  212. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttEngDike">
  213. update att_eng_dike
  214. <trim prefix="set" suffixOverrides=",">
  215. <if test="pGuid != null and pGuid != ''">P_GUID = #{pGuid},</if>
  216. <if test="engName != null and engName != ''">ENG_NAME = #{engName},</if>
  217. <if test="engGuid != null and engGuid != ''">ENG_GUID = #{engGuid},</if>
  218. <if test="impoGrad != null and impoGrad != ''">IMPO_GRAD = #{impoGrad},</if>
  219. <if test="apprBudg != null and apprBudg != ''">APPR_BUDG = #{apprBudg},</if>
  220. <if test="startDate != null">START_DATE = #{startDate},</if>
  221. <if test="compDate != null">COMP_DATE = #{compDate},</if>
  222. <if test="engStat != null and engStat != ''">ENG_STAT = #{engStat},</if>
  223. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  224. <if test="oflpCode != null and oflpCode != ''">OFLP_CODE = #{oflpCode},</if>
  225. <if test="ifReinForce != null and ifReinForce != ''">IF_REIN_FORCE = #{ifReinForce},</if>
  226. <if test="projGuid != null and projGuid != ''">PROJ_GUID = #{projGuid},</if>
  227. <if test="stat != null and stat != ''">STAT = #{stat},</if>
  228. <if test="dikeCode != null and dikeCode != ''">DIKE_CODE = #{dikeCode},</if>
  229. <if test="startLong != null and startLong != ''">START_LONG = #{startLong},</if>
  230. <if test="startLat != null and startLat != ''">START_LAT = #{startLat},</if>
  231. <if test="endLong != null and endLong != ''">END_LONG = #{endLong},</if>
  232. <if test="endLat != null and endLat != ''">END_LAT = #{endLat},</if>
  233. <if test="startLoc != null and startLoc != ''">START_LOC = #{startLoc},</if>
  234. <if test="endLoc != null and endLoc != ''">END_LOC = #{endLoc},</if>
  235. <if test="firsPoinAdGuid != null and firsPoinAdGuid != ''">FIRS_POIN_AD_GUID = #{firsPoinAdGuid},</if>
  236. <if test="endAdGuid != null and endAdGuid != ''">END_AD_GUID = #{endAdGuid},</if>
  237. <if test="rvGuid != null and rvGuid != ''">RV_GUID = #{rvGuid},</if>
  238. <if test="lkGuid != null and lkGuid != ''">LK_GUID = #{lkGuid},</if>
  239. <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
  240. <if test="dikeType != null and dikeType != ''">DIKE_TYPE = #{dikeType},</if>
  241. <if test="dikeLen != null and dikeLen != ''">DIKE_LEN = #{dikeLen},</if>
  242. <if test="dikeSlope != null and dikeSlope != ''">DIKE_SLOPE = #{dikeSlope},</if>
  243. <if test="rvBank != null and rvBank != ''">RV_BANK = #{rvBank},</if>
  244. <if test="crosSitu != null and crosSitu != ''">CROS_SITU = #{crosSitu},</if>
  245. <if test="ifRoad != null and ifRoad != ''">IF_ROAD = #{ifRoad},</if>
  246. <if test="desFlStand != null and desFlStand != ''">DES_FL_STAND = #{desFlStand},</if>
  247. <if test="note != null and note != ''">NOTE = #{note},</if>
  248. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  249. <if test="updTime != null">UPD_TIME = #{updTime},</if>
  250. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  251. <if test="engReinForceGuid != null and engReinForceGuid != ''">ENG_REIN_FORCE_GUID = #{engReinForceGuid},
  252. </if>
  253. </trim>
  254. <where>GUID = #{guid}</where>
  255. </update>
  256. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttEngDike">
  257. update att_eng_dike
  258. <trim prefix="set" suffixOverrides=",">
  259. <if test="pGuid != null and pGuid != ''">P_GUID = #{pGuid},</if>
  260. <if test="engName != null and engName != ''">ENG_NAME = #{engName},</if>
  261. <if test="engGuid != null and engGuid != ''">ENG_GUID = #{engGuid},</if>
  262. <if test="impoGrad != null and impoGrad != ''">IMPO_GRAD = #{impoGrad},</if>
  263. <if test="apprBudg != null and apprBudg != ''">APPR_BUDG = #{apprBudg},</if>
  264. <if test="startDate != null">START_DATE = #{startDate},</if>
  265. <if test="compDate != null">COMP_DATE = #{compDate},</if>
  266. <if test="engStat != null and engStat != ''">ENG_STAT = #{engStat},</if>
  267. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  268. <if test="oflpCode != null and oflpCode != ''">OFLP_CODE = #{oflpCode},</if>
  269. <if test="ifReinForce != null and ifReinForce != ''">IF_REIN_FORCE = #{ifReinForce},</if>
  270. <if test="projGuid != null and projGuid != ''">PROJ_GUID = #{projGuid},</if>
  271. <if test="stat != null and stat != ''">STAT = #{stat},</if>
  272. <if test="dikeCode != null and dikeCode != ''">DIKE_CODE = #{dikeCode},</if>
  273. <if test="startLong != null and startLong != ''">START_LONG = #{startLong},</if>
  274. <if test="startLat != null and startLat != ''">START_LAT = #{startLat},</if>
  275. <if test="endLong != null and endLong != ''">END_LONG = #{endLong},</if>
  276. <if test="endLat != null and endLat != ''">END_LAT = #{endLat},</if>
  277. <if test="startLoc != null and startLoc != ''">START_LOC = #{startLoc},</if>
  278. <if test="endLoc != null and endLoc != ''">END_LOC = #{endLoc},</if>
  279. <if test="firsPoinAdGuid != null and firsPoinAdGuid != ''">FIRS_POIN_AD_GUID = #{firsPoinAdGuid},</if>
  280. <if test="endAdGuid != null and endAdGuid != ''">END_AD_GUID = #{endAdGuid},</if>
  281. <if test="rvGuid != null and rvGuid != ''">RV_GUID = #{rvGuid},</if>
  282. <if test="lkGuid != null and lkGuid != ''">LK_GUID = #{lkGuid},</if>
  283. <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
  284. <if test="dikeType != null and dikeType != ''">DIKE_TYPE = #{dikeType},</if>
  285. <if test="dikeLen != null and dikeLen != ''">DIKE_LEN = #{dikeLen},</if>
  286. <if test="dikeSlope != null and dikeSlope != ''">DIKE_SLOPE = #{dikeSlope},</if>
  287. <if test="rvBank != null and rvBank != ''">RV_BANK = #{rvBank},</if>
  288. <if test="crosSitu != null and crosSitu != ''">CROS_SITU = #{crosSitu},</if>
  289. <if test="ifRoad != null and ifRoad != ''">IF_ROAD = #{ifRoad},</if>
  290. <if test="desFlStand != null and desFlStand != ''">DES_FL_STAND = #{desFlStand},</if>
  291. <if test="note != null and note != ''">NOTE = #{note},</if>
  292. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  293. <if test="updTime != null">UPD_TIME = #{updTime},</if>
  294. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  295. <if test="engReinForceGuid != null and engReinForceGuid != ''">ENG_REIN_FORCE_GUID = #{engReinForceGuid},
  296. </if>
  297. </trim>
  298. <include refid="page_where"/>
  299. </update>
  300. <!-- 其他自定义SQL -->
  301. <select id="getByTop3ByParam" resultType="cn.com.goldenwater.dcproj.dto.AttEngDikeDto">
  302. select A.* from ATT_ENG_DIKE A LEFT JOIN ATT_AD_BASE B ON A.ORG_GUID=B.GUID where rownum&lt;=3 order by DIKE_CODE
  303. </select>
  304. </mapper>