AttXjcwsBaseDao.xml 12 KB

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