BisInspBaseNewDao.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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.BisInspBaseNewDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspBaseNew" id="bisInspBaseNewResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="objType" column="OBJ_TYPE"/>
  7. <result property="engrType" column="ENGR_TYPE"/>
  8. <result property="code" column="CODE"/>
  9. <result property="nm" column="NM"/>
  10. <result property="adCode" column="AD_CODE"/>
  11. <result property="adName" column="AD_NAME"/>
  12. <result property="loc" column="LOC"/>
  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="intm" column="INTM"/>
  19. <result property="uptm" column="UPTM"/>
  20. <result property="dataStat" column="DATA_STAT"/>
  21. <result property="sectName" column="SECT_NAME"/>
  22. </resultMap>
  23. <sql id="table_columns">
  24. ID,
  25. OBJ_TYPE,
  26. ENGR_TYPE,
  27. CODE,
  28. NM,
  29. AD_CODE,
  30. AD_NAME,
  31. LOC,
  32. NOTE,
  33. CENTER_X,
  34. CENTER_Y,
  35. GD_X,
  36. GD_Y,
  37. INTM,
  38. UPTM,
  39. DATA_STAT,
  40. SECT_NAME
  41. </sql>
  42. <sql id="entity_properties">
  43. #{id}
  44. ,
  45. #{objType},
  46. #{engrType},
  47. #{code},
  48. #{nm},
  49. #{adCode},
  50. #{adName},
  51. #{loc},
  52. #{note},
  53. #{centerX},
  54. #{centerY},
  55. #{gdX},
  56. #{gdY},
  57. #{intm},
  58. #{uptm},
  59. #{dataStat},
  60. #{sectName}
  61. </sql>
  62. <sql id="page_where">
  63. <trim prefix="where" prefixOverrides="and | or ">
  64. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  65. <if test="engrType != null and engrType != ''">and ENGR_TYPE = #{engrType}</if>
  66. <if test="code != null and code != ''">and CODE = #{code}</if>
  67. <if test="nm != null and nm != ''">and NM like '%${nm}%'</if>
  68. <if test="adCode != null and adCode != ''">and AD_CODE like '${adCode}%'</if>
  69. <if test="loc != null and loc != ''">and LOC = #{loc}</if>
  70. <if test="note != null and note != ''">and NOTE = #{note}</if>
  71. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  72. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  73. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  74. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  75. <if test="intm != null">and INTM = #{intm}</if>
  76. <if test="uptm != null">and UPTM = #{uptm}</if>
  77. <if test="sectName != null and sectName != ''">and SECT_NAME = #{sectName}</if>
  78. and DATA_STAT='0'
  79. </trim>
  80. </sql>
  81. <select id="get" resultMap="bisInspBaseNewResultMap" parameterType="String">
  82. select
  83. <include refid="table_columns"/>
  84. from BIS_INSP_BASE_NEW where ID = #{id}
  85. </select>
  86. <select id="getBy" resultMap="bisInspBaseNewResultMap">
  87. select
  88. <include refid="table_columns"/>
  89. from BIS_INSP_BASE_NEW
  90. <trim prefix="where" prefixOverrides="and | or ">
  91. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  92. <if test="engrType != null and engrType != ''">and ENGR_TYPE = #{engrType}</if>
  93. <if test="code != null and code != ''">and CODE = #{code}</if>
  94. <if test="nm != null and nm != ''">and NM = #{nm}</if>
  95. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  96. <if test="adName != null and adName != ''">and AD_NAME like '%${adName}%'</if>
  97. <if test="loc != null and loc != ''">and LOC = #{loc}</if>
  98. <if test="note != null and note != ''">and NOTE = #{note}</if>
  99. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  100. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  101. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  102. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  103. <if test="intm != null">and INTM = #{intm}</if>
  104. <if test="uptm != null">and UPTM = #{uptm}</if>
  105. <if test="sectName != null and sectName != ''">and SECT_NAME = #{sectName}</if>
  106. and DATA_STAT='0'
  107. </trim>
  108. </select>
  109. <select id="findAll" resultMap="bisInspBaseNewResultMap">
  110. select
  111. <include refid="table_columns"/>
  112. from BIS_INSP_BASE_NEW
  113. </select>
  114. <select id="findList" resultMap="bisInspBaseNewResultMap">
  115. select
  116. <include refid="table_columns"/>
  117. from BIS_INSP_BASE_NEW
  118. <include refid="page_where"/>
  119. </select>
  120. <select id="selectCount" resultType="int">
  121. select count(ID) from BIS_INSP_BASE_NEW
  122. <include refid="page_where"/>
  123. </select>
  124. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspBaseNew">
  125. insert into BIS_INSP_BASE_NEW(
  126. <include refid="table_columns"/>
  127. )
  128. values (
  129. <include refid="entity_properties"/>
  130. )
  131. </insert>
  132. <delete id="delete" parameterType="java.lang.String">
  133. update BIS_INSP_BASE_NEW
  134. set DATA_STAT='9'
  135. where ID = #{id}
  136. </delete>
  137. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspBaseNew">
  138. update BIS_INSP_BASE_NEW set DATA_STAT='9'
  139. <include refid="page_where"/>
  140. </delete>
  141. <update id="deleteInFlag" parameterType="java.lang.String">
  142. update BIS_INSP_BASE_NEW
  143. set DATA_STAT = '9'
  144. where ID = #{id}
  145. </update>
  146. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspBaseNew">
  147. update BIS_INSP_BASE_NEW
  148. <trim prefix="set" suffixOverrides=",">
  149. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  150. <if test="engrType != null and engrType != ''">ENGR_TYPE = #{engrType},</if>
  151. <if test="code != null and code != ''">CODE = #{code},</if>
  152. <if test="nm != null and nm != ''">NM = #{nm},</if>
  153. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  154. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  155. <if test="loc != null and loc != ''">LOC = #{loc},</if>
  156. <if test="note != null and note != ''">NOTE = #{note},</if>
  157. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  158. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  159. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  160. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  161. <if test="intm != null">INTM = #{intm},</if>
  162. <if test="uptm != null">UPTM = #{uptm},</if>
  163. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  164. <if test="sectName != null and sectName != ''">SECT_NAME = #{sectName},</if>
  165. </trim>
  166. <where>ID = #{id}</where>
  167. </update>
  168. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspBaseNew">
  169. update BIS_INSP_BASE_NEW
  170. <trim prefix="set" suffixOverrides=",">
  171. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  172. <if test="engrType != null and engrType != ''">ENGR_TYPE = #{engrType},</if>
  173. <if test="code != null and code != ''">CODE = #{code},</if>
  174. <if test="nm != null and nm != ''">NM = #{nm},</if>
  175. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  176. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  177. <if test="loc != null and loc != ''">LOC = #{loc},</if>
  178. <if test="note != null and note != ''">NOTE = #{note},</if>
  179. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  180. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  181. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  182. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  183. <if test="intm != null">INTM = #{intm},</if>
  184. <if test="uptm != null">UPTM = #{uptm},</if>
  185. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  186. <if test="sectName != null and sectName != ''">SECT_NAME = #{sectName},</if>
  187. </trim>
  188. <include refid="page_where"/>
  189. </update>
  190. <!-- 其他自定义SQL -->
  191. <select id="getTypes" resultType="string">
  192. select DISTINCT OBJ_TYPE
  193. from BIS_INSP_BASE_NEW
  194. where DATA_STAT = '0'
  195. </select>
  196. <select id="getByRgstrId" resultMap="bisInspBaseNewResultMap">
  197. select A.*
  198. from BIS_INSP_BASE_NEW A
  199. JOIN BIS_INSP_ALL_OBJ B ON A.ID = B.CODE
  200. JOIN BIS_INSP_GENRL_RGSTR C ON B.OBJ_ID = C.OBJ_ID
  201. WHERE A.DATA_STAT = '0'
  202. <if test="rgstrId != null and rgstrId != ''">AND C.ID = #{rgstrId}</if>
  203. </select>
  204. </mapper>