AttUnwtBaseDao.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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.AttUnwtBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttUnwtBase" id="attUnwtBaseResultMap">
  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="centerX" column="CENTER_X"/>
  11. <result property="centerY" column="CENTER_Y"/>
  12. <result property="gdX" column="GD_X"/>
  13. <result property="gdY" column="GD_Y"/>
  14. <result property="intm" column="INTM"/>
  15. <result property="uptm" column="UPTM"/>
  16. <result property="dataStat" column="DATA_STAT"/>
  17. </resultMap>
  18. <sql id="table_columns">
  19. ID,
  20. NM,
  21. AD_CODE,
  22. AD_NAME,
  23. LOC,
  24. CENTER_X,
  25. CENTER_Y,
  26. GD_X,
  27. GD_Y,
  28. INTM,
  29. UPTM,
  30. DATA_STAT
  31. </sql>
  32. <sql id="entity_properties">
  33. #{id},
  34. #{nm},
  35. #{adCode},
  36. #{adName},
  37. #{loc},
  38. #{centerX},
  39. #{centerY},
  40. #{gdX},
  41. #{gdY},
  42. #{intm},
  43. #{uptm},
  44. #{dataStat}
  45. </sql>
  46. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  47. <sql id="page_where">
  48. <trim prefix="where" prefixOverrides="and | or ">
  49. <if test="nm != null and nm != ''">
  50. and NM = #{nm}
  51. </if>
  52. <if test="adCode != null and adCode != ''">
  53. and AD_CODE = #{adCode}
  54. </if>
  55. <if test="adName != null and adName != ''">
  56. and AD_NAME = #{adName}
  57. </if>
  58. <if test="loc != null and loc != ''">
  59. and LOC = #{loc}
  60. </if>
  61. <if test="centerX != null and centerX != ''">
  62. and CENTER_X = #{centerX}
  63. </if>
  64. <if test="centerY != null and centerY != ''">
  65. and CENTER_Y = #{centerY}
  66. </if>
  67. <if test="gdX != null and gdX != ''">
  68. and GD_X = #{gdX}
  69. </if>
  70. <if test="gdY != null and gdY != ''">
  71. and GD_Y = #{gdY}
  72. </if>
  73. <if test="intm != null">
  74. and INTM = #{intm}
  75. </if>
  76. <if test="uptm != null">
  77. and UPTM = #{uptm}
  78. </if>
  79. <if test="dataStat != null and dataStat != ''">
  80. and DATA_STAT = #{dataStat}
  81. </if>
  82. and DATA_STAT='0'
  83. </trim>
  84. </sql>
  85. <select id="get" resultMap="attUnwtBaseResultMap" parameterType="String">
  86. select
  87. <include refid="table_columns"/>
  88. from ATT_UNWT_BASE where ID = #{id}
  89. </select>
  90. <select id="getBy" resultMap="attUnwtBaseResultMap">
  91. select
  92. <include refid="table_columns"/>
  93. from ATT_UNWT_BASE
  94. <include refid="page_where"/>
  95. </select>
  96. <select id="findAll" resultMap="attUnwtBaseResultMap">
  97. select
  98. <include refid="table_columns"/>
  99. from ATT_UNWT_BASE
  100. </select>
  101. <select id="findList" resultMap="attUnwtBaseResultMap">
  102. select
  103. <include refid="table_columns"/>
  104. from ATT_UNWT_BASE
  105. <include refid="page_where"/>
  106. </select>
  107. <select id="selectCount" resultType="int">
  108. select count(ID) from ATT_UNWT_BASE
  109. <include refid="page_where"/>
  110. </select>
  111. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttUnwtBase">
  112. insert into ATT_UNWT_BASE(
  113. <include refid="table_columns"/>
  114. )
  115. values (
  116. <include refid="entity_properties"/>
  117. )
  118. </insert>
  119. <delete id="delete" parameterType="java.lang.String">
  120. update ATT_UNWT_BASE set DATA_STAT='9' where ID = #{id}
  121. </delete>
  122. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttUnwtBase">
  123. update ATT_UNWT_BASE set DATA_STAT='9'
  124. <include refid="page_where"/>
  125. </delete>
  126. <update id="deleteInFlag" parameterType="java.lang.String">
  127. update ATT_UNWT_BASE set DATA_STAT = '9' where ID = #{id}
  128. </update>
  129. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttUnwtBase">
  130. update ATT_UNWT_BASE
  131. <trim prefix="set" suffixOverrides=",">
  132. <if test="nm != null and nm != ''">NM
  133. = #{nm},
  134. </if>
  135. <if test="adCode != null and adCode != ''">AD_CODE
  136. = #{adCode},
  137. </if>
  138. <if test="adName != null and adName != ''">AD_NAME
  139. = #{adName},
  140. </if>
  141. <if test="loc != null and loc != ''">LOC
  142. = #{loc},
  143. </if>
  144. <if test="centerX != null and centerX != ''">CENTER_X
  145. = #{centerX},
  146. </if>
  147. <if test="centerY != null and centerY != ''">CENTER_Y
  148. = #{centerY},
  149. </if>
  150. <if test="gdX != null and gdX != ''">GD_X
  151. = #{gdX},
  152. </if>
  153. <if test="gdY != null and gdY != ''">GD_Y
  154. = #{gdY},
  155. </if>
  156. <if test="intm != null">INTM
  157. = #{intm},
  158. </if>
  159. <if test="uptm != null">UPTM
  160. = #{uptm},
  161. </if>
  162. <if test="dataStat != null and dataStat != ''">DATA_STAT
  163. = #{dataStat},
  164. </if>
  165. </trim>
  166. <where>ID = #{id}</where>
  167. </update>
  168. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttUnwtBase">
  169. update ATT_UNWT_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="centerX != null and centerX != ''">CENTER_X
  184. = #{centerX},
  185. </if>
  186. <if test="centerY != null and centerY != ''">CENTER_Y
  187. = #{centerY},
  188. </if>
  189. <if test="gdX != null and gdX != ''">GD_X
  190. = #{gdX},
  191. </if>
  192. <if test="gdY != null and gdY != ''">GD_Y
  193. = #{gdY},
  194. </if>
  195. <if test="intm != null">INTM
  196. = #{intm},
  197. </if>
  198. <if test="uptm != null">UPTM
  199. = #{uptm},
  200. </if>
  201. <if test="dataStat != null and dataStat != ''">DATA_STAT
  202. = #{dataStat},
  203. </if>
  204. </trim>
  205. <include refid="page_where"/>
  206. </update>
  207. <!-- 其他自定义SQL -->
  208. <select id="getObjId" resultType="cn.com.goldenwater.dcproj.model.AttUnwtBase">
  209. SELECT
  210. <include refid="table_columns"/>
  211. FROM ATT_UNWT_BASE
  212. WHERE ID = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  213. </select>
  214. </mapper>