AttDpgmBaseDao.xml 10 KB

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