AttHystpBaseDao.xml 13 KB

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