AttSwhsjsBaseDao.xml 11 KB

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