AttStstnBaseDao.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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.AttStstnBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttStstnBase" id="attStstnBaseResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="nm" column="NM"/>
  7. <result property="adCode" column="AD_CODE"/>
  8. <result property="adName" column="AD_NAME"/>
  9. <result property="loc" column="LOC"/>
  10. <result property="prjcType" column="PRJC_TYPE"/>
  11. <result property="cost" column="COST"/>
  12. <result property="costYear" column="COST_YEAR"/>
  13. <result property="mgr" column="MGR"/>
  14. <result property="owner" column="OWNER"/>
  15. <result property="quality" column="QUALITY"/>
  16. <result property="design" column="DESIGN"/>
  17. <result property="supervisor" column="SUPERVISOR"/>
  18. <result property="build" column="BUILD"/>
  19. <result property="prjcPers" column="PRJC_PERS"/>
  20. <result property="prjcPresTel" column="PRJC_PRES_TEL"/>
  21. <result property="centerX" column="CENTER_X"/>
  22. <result property="centerY" column="CENTER_Y"/>
  23. <result property="gdX" column="GD_X"/>
  24. <result property="gdY" column="GD_Y"/>
  25. <result property="intm" column="INTM"/>
  26. <result property="uptm" column="UPTM"/>
  27. <result property="dataStat" column="DATA_STAT"/>
  28. </resultMap>
  29. <sql id="table_columns">
  30. ID,
  31. NM,
  32. AD_CODE,
  33. AD_NAME,
  34. LOC,
  35. PRJC_TYPE,
  36. COST,
  37. COST_YEAR,
  38. MGR,
  39. OWNER,
  40. QUALITY,
  41. DESIGN,
  42. SUPERVISOR,
  43. BUILD,
  44. PRJC_PERS,
  45. PRJC_PRES_TEL,
  46. CENTER_X,
  47. CENTER_Y,
  48. GD_X,
  49. GD_Y,
  50. INTM,
  51. UPTM,
  52. DATA_STAT
  53. </sql>
  54. <sql id="entity_properties">
  55. #{id},
  56. #{nm},
  57. #{adCode},
  58. #{adName},
  59. #{loc},
  60. #{prjcType},
  61. #{cost},
  62. #{costYear},
  63. #{mgr},
  64. #{owner},
  65. #{quality},
  66. #{design},
  67. #{supervisor},
  68. #{build},
  69. #{prjcPers},
  70. #{prjcPresTel},
  71. #{centerX},
  72. #{centerY},
  73. #{gdX},
  74. #{gdY},
  75. #{intm},
  76. #{uptm},
  77. #{dataStat}
  78. </sql>
  79. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  80. <sql id="page_where">
  81. <trim prefix="where" prefixOverrides="and | or ">
  82. <if test="nm != null and nm != ''">
  83. and NM = #{nm}
  84. </if>
  85. <if test="adCode != null and adCode != ''">
  86. and AD_CODE = #{adCode}
  87. </if>
  88. <if test="adName != null and adName != ''">
  89. and AD_NAME = #{adName}
  90. </if>
  91. <if test="loc != null and loc != ''">
  92. and LOC = #{loc}
  93. </if>
  94. <if test="prjcType != null and prjcType != ''">
  95. and PRJC_TYPE = #{prjcType}
  96. </if>
  97. <if test="cost != null and cost != ''">
  98. and COST = #{cost}
  99. </if>
  100. <if test="costYear != null and costYear != ''">
  101. and COST_YEAR = #{costYear}
  102. </if>
  103. <if test="mgr != null and mgr != ''">
  104. and MGR = #{mgr}
  105. </if>
  106. <if test="owner != null and owner != ''">
  107. and OWNER = #{owner}
  108. </if>
  109. <if test="quality != null and quality != ''">
  110. and QUALITY = #{quality}
  111. </if>
  112. <if test="design != null and design != ''">
  113. and DESIGN = #{design}
  114. </if>
  115. <if test="supervisor != null and supervisor != ''">
  116. and SUPERVISOR = #{supervisor}
  117. </if>
  118. <if test="build != null and build != ''">
  119. and BUILD = #{build}
  120. </if>
  121. <if test="prjcPers != null and prjcPers != ''">
  122. and PRJC_PERS = #{prjcPers}
  123. </if>
  124. <if test="prjcPresTel != null and prjcPresTel != ''">
  125. and PRJC_PRES_TEL = #{prjcPresTel}
  126. </if>
  127. <if test="centerX != null and centerX != ''">
  128. and CENTER_X = #{centerX}
  129. </if>
  130. <if test="centerY != null and centerY != ''">
  131. and CENTER_Y = #{centerY}
  132. </if>
  133. <if test="gdX != null and gdX != ''">
  134. and GD_X = #{gdX}
  135. </if>
  136. <if test="gdY != null and gdY != ''">
  137. and GD_Y = #{gdY}
  138. </if>
  139. <if test="intm != null">
  140. and INTM = #{intm}
  141. </if>
  142. <if test="uptm != null">
  143. and UPTM = #{uptm}
  144. </if>
  145. <if test="dataStat != null and dataStat != ''">
  146. and DATA_STAT = #{dataStat}
  147. </if>
  148. and DATA_STAT='0'
  149. </trim>
  150. </sql>
  151. <select id="get" resultMap="attStstnBaseResultMap" parameterType="String">
  152. select
  153. <include refid="table_columns"/>
  154. from ATT_STSTN_BASE where ID = #{id}
  155. </select>
  156. <select id="getBy" resultMap="attStstnBaseResultMap">
  157. select
  158. <include refid="table_columns"/>
  159. from ATT_STSTN_BASE
  160. <include refid="page_where"/>
  161. </select>
  162. <select id="findAll" resultMap="attStstnBaseResultMap">
  163. select
  164. <include refid="table_columns"/>
  165. from ATT_STSTN_BASE
  166. </select>
  167. <select id="findList" resultMap="attStstnBaseResultMap">
  168. select
  169. <include refid="table_columns"/>
  170. from ATT_STSTN_BASE
  171. <include refid="page_where"/>
  172. </select>
  173. <select id="selectCount" resultType="int">
  174. select count(ID) from ATT_STSTN_BASE
  175. <include refid="page_where"/>
  176. </select>
  177. <select id="getObjId" resultType="cn.com.goldenwater.dcproj.model.AttStstnBase">
  178. SELECT
  179. <include refid="table_columns" />
  180. FROM ATT_STSTN_BASE
  181. WHERE ID = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  182. </select>
  183. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttStstnBase">
  184. insert into ATT_STSTN_BASE(
  185. <include refid="table_columns"/>
  186. )
  187. values (
  188. <include refid="entity_properties"/>
  189. )
  190. </insert>
  191. <delete id="delete" parameterType="java.lang.String">
  192. update ATT_STSTN_BASE set DATA_STAT='9' where ID = #{id}
  193. </delete>
  194. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttStstnBase">
  195. update ATT_STSTN_BASE set DATA_STAT='9'
  196. <include refid="page_where"/>
  197. </delete>
  198. <update id="deleteInFlag" parameterType="java.lang.String">
  199. update ATT_STSTN_BASE set DATA_STAT = '9' where ID = #{id}
  200. </update>
  201. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttStstnBase">
  202. update ATT_STSTN_BASE
  203. <trim prefix="set" suffixOverrides=",">
  204. <if test="nm != null and nm != ''">NM
  205. = #{nm},
  206. </if>
  207. <if test="adCode != null and adCode != ''">AD_CODE
  208. = #{adCode},
  209. </if>
  210. <if test="adName != null and adName != ''">AD_NAME
  211. = #{adName},
  212. </if>
  213. <if test="loc != null and loc != ''">LOC
  214. = #{loc},
  215. </if>
  216. <if test="prjcType != null and prjcType != ''">PRJC_TYPE
  217. = #{prjcType},
  218. </if>
  219. <if test="cost != null and cost != ''">COST
  220. = #{cost},
  221. </if>
  222. <if test="costYear != null and costYear != ''">COST_YEAR
  223. = #{costYear},
  224. </if>
  225. <if test="mgr != null and mgr != ''">MGR
  226. = #{mgr},
  227. </if>
  228. <if test="owner != null and owner != ''">OWNER
  229. = #{owner},
  230. </if>
  231. <if test="quality != null and quality != ''">QUALITY
  232. = #{quality},
  233. </if>
  234. <if test="design != null and design != ''">DESIGN
  235. = #{design},
  236. </if>
  237. <if test="supervisor != null and supervisor != ''">SUPERVISOR
  238. = #{supervisor},
  239. </if>
  240. <if test="build != null and build != ''">BUILD
  241. = #{build},
  242. </if>
  243. <if test="prjcPers != null and prjcPers != ''">PRJC_PERS
  244. = #{prjcPers},
  245. </if>
  246. <if test="prjcPresTel != null and prjcPresTel != ''">PRJC_PRES_TEL
  247. = #{prjcPresTel},
  248. </if>
  249. <if test="centerX != null and centerX != ''">CENTER_X
  250. = #{centerX},
  251. </if>
  252. <if test="centerY != null and centerY != ''">CENTER_Y
  253. = #{centerY},
  254. </if>
  255. <if test="gdX != null and gdX != ''">GD_X
  256. = #{gdX},
  257. </if>
  258. <if test="gdY != null and gdY != ''">GD_Y
  259. = #{gdY},
  260. </if>
  261. <if test="intm != null">INTM
  262. = #{intm},
  263. </if>
  264. <if test="uptm != null">UPTM
  265. = #{uptm},
  266. </if>
  267. <if test="dataStat != null and dataStat != ''">DATA_STAT
  268. = #{dataStat},
  269. </if>
  270. </trim>
  271. <where>ID = #{id}</where>
  272. </update>
  273. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttStstnBase">
  274. update ATT_STSTN_BASE
  275. <trim prefix="set" suffixOverrides=",">
  276. <if test="nm != null and nm != ''">NM
  277. = #{nm},
  278. </if>
  279. <if test="adCode != null and adCode != ''">AD_CODE
  280. = #{adCode},
  281. </if>
  282. <if test="adName != null and adName != ''">AD_NAME
  283. = #{adName},
  284. </if>
  285. <if test="loc != null and loc != ''">LOC
  286. = #{loc},
  287. </if>
  288. <if test="prjcType != null and prjcType != ''">PRJC_TYPE
  289. = #{prjcType},
  290. </if>
  291. <if test="cost != null and cost != ''">COST
  292. = #{cost},
  293. </if>
  294. <if test="costYear != null and costYear != ''">COST_YEAR
  295. = #{costYear},
  296. </if>
  297. <if test="mgr != null and mgr != ''">MGR
  298. = #{mgr},
  299. </if>
  300. <if test="owner != null and owner != ''">OWNER
  301. = #{owner},
  302. </if>
  303. <if test="quality != null and quality != ''">QUALITY
  304. = #{quality},
  305. </if>
  306. <if test="design != null and design != ''">DESIGN
  307. = #{design},
  308. </if>
  309. <if test="supervisor != null and supervisor != ''">SUPERVISOR
  310. = #{supervisor},
  311. </if>
  312. <if test="build != null and build != ''">BUILD
  313. = #{build},
  314. </if>
  315. <if test="prjcPers != null and prjcPers != ''">PRJC_PERS
  316. = #{prjcPers},
  317. </if>
  318. <if test="prjcPresTel != null and prjcPresTel != ''">PRJC_PRES_TEL
  319. = #{prjcPresTel},
  320. </if>
  321. <if test="centerX != null and centerX != ''">CENTER_X
  322. = #{centerX},
  323. </if>
  324. <if test="centerY != null and centerY != ''">CENTER_Y
  325. = #{centerY},
  326. </if>
  327. <if test="gdX != null and gdX != ''">GD_X
  328. = #{gdX},
  329. </if>
  330. <if test="gdY != null and gdY != ''">GD_Y
  331. = #{gdY},
  332. </if>
  333. <if test="intm != null">INTM
  334. = #{intm},
  335. </if>
  336. <if test="uptm != null">UPTM
  337. = #{uptm},
  338. </if>
  339. <if test="dataStat != null and dataStat != ''">DATA_STAT
  340. = #{dataStat},
  341. </if>
  342. </trim>
  343. <include refid="page_where"/>
  344. </update>
  345. <!-- 其他自定义SQL -->
  346. </mapper>