b82ee7b6b60c6e6dac7459d87c7d7bdc951c35bb.svn-base 12 KB

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