AttWtprjBaseDao.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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.AttWtprjBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttWtprjBase" id="attWtprjBaseResultMap">
  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="prjType" column="PRJ_TYPE"/>
  11. <result property="prjCtgy" column="PRJ_CTGY"/>
  12. <result property="prjRisk" column="PRJ_RISK"/>
  13. <result property="centerX" column="CENTER_X"/>
  14. <result property="centerY" column="CENTER_Y"/>
  15. <result property="gdX" column="GD_X"/>
  16. <result property="gdY" column="GD_Y"/>
  17. <result property="intm" column="INTM"/>
  18. <result property="uptm" column="UPTM"/>
  19. <result property="note" column="NOTE"/>
  20. <result property="dataStat" column="DATA_STAT"/>
  21. </resultMap>
  22. <sql id="table_columns">
  23. ID,
  24. NM,
  25. AD_CODE,
  26. AD_NAME,
  27. LOC,
  28. PRJ_TYPE,
  29. PRJ_CTGY,
  30. PRJ_RISK,
  31. CENTER_X,
  32. CENTER_Y,
  33. GD_X,
  34. GD_Y,
  35. INTM,
  36. UPTM,
  37. NOTE,
  38. DATA_STAT
  39. </sql>
  40. <sql id="entity_properties">
  41. #{id},
  42. #{nm},
  43. #{adCode},
  44. #{adName},
  45. #{loc},
  46. #{prjType},
  47. #{prjCtgy},
  48. #{prjRisk},
  49. #{centerX},
  50. #{centerY},
  51. #{gdX},
  52. #{gdY},
  53. #{intm},
  54. #{uptm},
  55. #{note},
  56. #{dataStat}
  57. </sql>
  58. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  59. <sql id="page_where">
  60. <trim prefix="where" prefixOverrides="and | or ">
  61. <if test="nm != null and nm != ''">
  62. and NM = #{nm}
  63. </if>
  64. <if test="adCode != null and adCode != ''">
  65. and AD_CODE = #{adCode}
  66. </if>
  67. <if test="adName != null and adName != ''">
  68. and AD_NAME = #{adName}
  69. </if>
  70. <if test="loc != null and loc != ''">
  71. and LOC = #{loc}
  72. </if>
  73. <if test="prjType != null and prjType != ''">
  74. and PRJ_TYPE = #{prjType}
  75. </if>
  76. <if test="prjCtgy != null and prjCtgy != ''">
  77. and PRJ_CTGY = #{prjCtgy}
  78. </if>
  79. <if test="prjRisk != null and prjRisk != ''">
  80. and PRJ_RISK = #{prjRisk}
  81. </if>
  82. <if test="centerX != null and centerX != ''">
  83. and CENTER_X = #{centerX}
  84. </if>
  85. <if test="centerY != null and centerY != ''">
  86. and CENTER_Y = #{centerY}
  87. </if>
  88. <if test="gdX != null and gdX != ''">
  89. and GD_X = #{gdX}
  90. </if>
  91. <if test="gdY != null and gdY != ''">
  92. and GD_Y = #{gdY}
  93. </if>
  94. <if test="intm != null">
  95. and INTM = #{intm}
  96. </if>
  97. <if test="uptm != null">
  98. and UPTM = #{uptm}
  99. </if>
  100. <if test="note != null and note != ''">
  101. and NOTE = #{note}
  102. </if>
  103. <if test="dataStat != null and dataStat != ''">
  104. and DATA_STAT = #{dataStat}
  105. </if>
  106. and DATA_STAT='0'
  107. </trim>
  108. </sql>
  109. <select id="get" resultMap="attWtprjBaseResultMap" parameterType="String">
  110. select
  111. <include refid="table_columns"/>
  112. from ATT_WTPRJ_BASE where ID = #{id}
  113. </select>
  114. <select id="getBy" resultMap="attWtprjBaseResultMap">
  115. select
  116. <include refid="table_columns"/>
  117. from ATT_WTPRJ_BASE
  118. <include refid="page_where"/>
  119. </select>
  120. <select id="findAll" resultMap="attWtprjBaseResultMap">
  121. select
  122. <include refid="table_columns"/>
  123. from ATT_WTPRJ_BASE
  124. </select>
  125. <select id="findList" resultMap="attWtprjBaseResultMap">
  126. select
  127. <include refid="table_columns"/>
  128. from ATT_WTPRJ_BASE
  129. <include refid="page_where"/>
  130. </select>
  131. <select id="selectCount" resultType="int">
  132. select count(ID) from ATT_WTPRJ_BASE
  133. <include refid="page_where"/>
  134. </select>
  135. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttWtprjBase">
  136. insert into ATT_WTPRJ_BASE(
  137. <include refid="table_columns"/>
  138. )
  139. values (
  140. <include refid="entity_properties"/>
  141. )
  142. </insert>
  143. <delete id="delete" parameterType="java.lang.String">
  144. update ATT_WTPRJ_BASE set DATA_STAT='9' where ID = #{id}
  145. </delete>
  146. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttWtprjBase">
  147. update ATT_WTPRJ_BASE set DATA_STAT='9'
  148. <include refid="page_where"/>
  149. </delete>
  150. <update id="deleteInFlag" parameterType="java.lang.String">
  151. update ATT_WTPRJ_BASE set DATA_STAT = '9' where ID = #{id}
  152. </update>
  153. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttWtprjBase">
  154. update ATT_WTPRJ_BASE
  155. <trim prefix="set" suffixOverrides=",">
  156. <if test="nm != null and nm != ''">NM
  157. = #{nm},
  158. </if>
  159. <if test="adCode != null and adCode != ''">AD_CODE
  160. = #{adCode},
  161. </if>
  162. <if test="adName != null and adName != ''">AD_NAME
  163. = #{adName},
  164. </if>
  165. <if test="loc != null and loc != ''">LOC
  166. = #{loc},
  167. </if>
  168. <if test="prjType != null and prjType != ''">PRJ_TYPE
  169. = #{prjType},
  170. </if>
  171. <if test="prjCtgy != null and prjCtgy != ''">PRJ_CTGY
  172. = #{prjCtgy},
  173. </if>
  174. <if test="prjRisk != null and prjRisk != ''">PRJ_RISK
  175. = #{prjRisk},
  176. </if>
  177. <if test="centerX != null and centerX != ''">CENTER_X
  178. = #{centerX},
  179. </if>
  180. <if test="centerY != null and centerY != ''">CENTER_Y
  181. = #{centerY},
  182. </if>
  183. <if test="gdX != null and gdX != ''">GD_X
  184. = #{gdX},
  185. </if>
  186. <if test="gdY != null and gdY != ''">GD_Y
  187. = #{gdY},
  188. </if>
  189. <if test="intm != null">INTM
  190. = #{intm},
  191. </if>
  192. <if test="uptm != null">UPTM
  193. = #{uptm},
  194. </if>
  195. <if test="note != null and note != ''">NOTE
  196. = #{note},
  197. </if>
  198. <if test="dataStat != null and dataStat != ''">DATA_STAT
  199. = #{dataStat},
  200. </if>
  201. </trim>
  202. <where>ID = #{id}</where>
  203. </update>
  204. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttWtprjBase">
  205. update ATT_WTPRJ_BASE
  206. <trim prefix="set" suffixOverrides=",">
  207. <if test="nm != null and nm != ''">NM
  208. = #{nm},
  209. </if>
  210. <if test="adCode != null and adCode != ''">AD_CODE
  211. = #{adCode},
  212. </if>
  213. <if test="adName != null and adName != ''">AD_NAME
  214. = #{adName},
  215. </if>
  216. <if test="loc != null and loc != ''">LOC
  217. = #{loc},
  218. </if>
  219. <if test="prjType != null and prjType != ''">PRJ_TYPE
  220. = #{prjType},
  221. </if>
  222. <if test="prjCtgy != null and prjCtgy != ''">PRJ_CTGY
  223. = #{prjCtgy},
  224. </if>
  225. <if test="prjRisk != null and prjRisk != ''">PRJ_RISK
  226. = #{prjRisk},
  227. </if>
  228. <if test="centerX != null and centerX != ''">CENTER_X
  229. = #{centerX},
  230. </if>
  231. <if test="centerY != null and centerY != ''">CENTER_Y
  232. = #{centerY},
  233. </if>
  234. <if test="gdX != null and gdX != ''">GD_X
  235. = #{gdX},
  236. </if>
  237. <if test="gdY != null and gdY != ''">GD_Y
  238. = #{gdY},
  239. </if>
  240. <if test="intm != null">INTM
  241. = #{intm},
  242. </if>
  243. <if test="uptm != null">UPTM
  244. = #{uptm},
  245. </if>
  246. <if test="note != null and note != ''">NOTE
  247. = #{note},
  248. </if>
  249. <if test="dataStat != null and dataStat != ''">DATA_STAT
  250. = #{dataStat},
  251. </if>
  252. </trim>
  253. <include refid="page_where"/>
  254. </update>
  255. <!-- 其他自定义SQL -->
  256. <select id="getObjId" resultType="cn.com.goldenwater.dcproj.model.AttWtprjBase">
  257. SELECT
  258. <include refid="table_columns"/>
  259. FROM ATT_WTPRJ_BASE
  260. WHERE ID = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  261. </select>
  262. </mapper>