AttFundBaseDao.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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.AttFundBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttFundBase" id="attFundBaseResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="projCode" column="PROJ_CODE"/>
  7. <result property="projName" column="PROJ_NAME"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="adName" column="AD_NAME"/>
  10. <result property="constractUnit" column="CONSTRACT_UNIT"/>
  11. <result property="projType" column="PROJ_TYPE"/>
  12. <result property="planYear" column="PLAN_YEAR"/>
  13. <result property="planFunds" column="PLAN_FUNDS"/>
  14. <result property="remarks" column="REMARKS"/>
  15. <result property="centerX" column="CENTER_X"/>
  16. <result property="centerY" column="CENTER_Y"/>
  17. <result property="gdX" column="GD_X"/>
  18. <result property="gdY" column="GD_Y"/>
  19. <result property="persId" column="PERS_ID"/>
  20. <result property="intm" column="INTM"/>
  21. <result property="uptm" column="UPTM"/>
  22. <result property="dataStat" column="DATA_STAT"/>
  23. </resultMap>
  24. <sql id="table_columns">
  25. ID,
  26. PROJ_CODE,
  27. PROJ_NAME,
  28. AD_CODE,
  29. AD_NAME,
  30. CONSTRACT_UNIT,
  31. PROJ_TYPE,
  32. PLAN_YEAR,
  33. PLAN_FUNDS,
  34. REMARKS,
  35. CENTER_X,
  36. CENTER_Y,
  37. GD_X,
  38. GD_Y,
  39. PERS_ID,
  40. INTM,
  41. UPTM,
  42. DATA_STAT
  43. </sql>
  44. <sql id="entity_properties">
  45. #{id},
  46. #{projCode},
  47. #{projName},
  48. #{adCode},
  49. #{adName},
  50. #{constractUnit},
  51. #{projType},
  52. #{planYear},
  53. #{planFunds},
  54. #{remarks},
  55. #{centerX},
  56. #{centerY},
  57. #{gdX},
  58. #{gdY},
  59. #{persId},
  60. #{intm},
  61. #{uptm},
  62. #{dataStat}
  63. </sql>
  64. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  65. <sql id="page_where">
  66. <trim prefix="where" prefixOverrides="and | or ">
  67. <if test="projCode != null and projCode != ''">and PROJ_CODE = #{projCode}</if>
  68. <if test="projName != null and projName != ''">and PROJ_NAME = #{projName}</if>
  69. <if test="adCode != null and adCode != ''">and AD_CODE like concat(#{adCode},'%')</if>
  70. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  71. <if test="constractUnit != null and constractUnit != ''">and CONSTRACT_UNIT = #{constractUnit}</if>
  72. <if test="projType != null and projType != ''">and PROJ_TYPE = #{projType}</if>
  73. <if test="planYear != null and planYear != ''">and PLAN_YEAR = #{planYear}</if>
  74. <if test="planFunds != null and planFunds != ''">and PLAN_FUNDS = #{planFunds}</if>
  75. <if test="remarks != null and remarks != ''">and REMARKS = #{remarks}</if>
  76. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  77. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  78. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  79. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  80. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  81. <if test="intm != null">and INTM = #{intm}</if>
  82. <if test="uptm != null">and UPTM = #{uptm}</if>
  83. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  84. </trim>
  85. </sql>
  86. <select id="get" resultMap="attFundBaseResultMap" parameterType="String" >
  87. select <include refid="table_columns" /> from ATT_FUND_BASE where ID = #{id}
  88. </select>
  89. <select id="getBy" resultMap="attFundBaseResultMap">
  90. select <include refid="table_columns" /> from ATT_FUND_BASE <include refid="page_where" />
  91. </select>
  92. <select id="findAll" resultMap="attFundBaseResultMap">
  93. select <include refid="table_columns" /> from ATT_FUND_BASE
  94. </select>
  95. <select id="findList" resultMap="attFundBaseResultMap">
  96. select <include refid="table_columns" /> from ATT_FUND_BASE <include refid="page_where" />
  97. </select>
  98. <select id="selectCount" resultType="int" >
  99. select count(ID) from ATT_FUND_BASE <include refid="page_where" />
  100. </select>
  101. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttFundBase">
  102. insert into ATT_FUND_BASE( <include refid="table_columns" /> )
  103. values ( <include refid="entity_properties" /> )
  104. </insert>
  105. <delete id="delete" parameterType="java.lang.String">
  106. update ATT_FUND_BASE set DATA_STAT='9' where ID = #{id}
  107. </delete>
  108. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttFundBase">
  109. delete from ATT_FUND_BASE <include refid="page_where" />
  110. </delete>
  111. <update id="deleteInFlag" parameterType="java.lang.String">
  112. update ATT_FUND_BASE set flag_valid = 0 where ID = #{id}
  113. </update>
  114. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttFundBase">
  115. update ATT_FUND_BASE
  116. <trim prefix="set" suffixOverrides=",">
  117. <if test="projCode != null and projCode != ''">PROJ_CODE = #{projCode},</if>
  118. <if test="projName != null and projName != ''">PROJ_NAME = #{projName},</if>
  119. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  120. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  121. <if test="constractUnit != null and constractUnit != ''">CONSTRACT_UNIT = #{constractUnit},</if>
  122. <if test="projType != null and projType != ''">PROJ_TYPE = #{projType},</if>
  123. <if test="planYear != null and planYear != ''">PLAN_YEAR = #{planYear},</if>
  124. <if test="planFunds != null and planFunds != ''">PLAN_FUNDS = #{planFunds},</if>
  125. <if test="remarks != null and remarks != ''">REMARKS = #{remarks},</if>
  126. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  127. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  128. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  129. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  130. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  131. <if test="intm != null">INTM = #{intm},</if>
  132. <if test="uptm != null">UPTM = #{uptm},</if>
  133. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  134. </trim>
  135. <where>ID = #{id}</where>
  136. </update>
  137. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttFundBase">
  138. update ATT_FUND_BASE
  139. <trim prefix="set" suffixOverrides=",">
  140. <if test="projCode != null and projCode != ''">PROJ_CODE = #{projCode},</if>
  141. <if test="projName != null and projName != ''">PROJ_NAME = #{projName},</if>
  142. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  143. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  144. <if test="constractUnit != null and constractUnit != ''">CONSTRACT_UNIT = #{constractUnit},</if>
  145. <if test="projType != null and projType != ''">PROJ_TYPE = #{projType},</if>
  146. <if test="planYear != null and planYear != ''">PLAN_YEAR = #{planYear},</if>
  147. <if test="planFunds != null and planFunds != ''">PLAN_FUNDS = #{planFunds},</if>
  148. <if test="remarks != null and remarks != ''">REMARKS = #{remarks},</if>
  149. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  150. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  151. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  152. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  153. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  154. <if test="intm != null">INTM = #{intm},</if>
  155. <if test="uptm != null">UPTM = #{uptm},</if>
  156. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  157. </trim>
  158. <include refid="page_where" />
  159. </update>
  160. <!-- 其他自定义SQL -->
  161. <select id="getObjId" resultMap="attFundBaseResultMap">
  162. SELECT
  163. <include refid="table_columns" />
  164. FROM ATT_FUND_BASE
  165. WHERE ID = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  166. </select>
  167. <!-- 其他自定义SQL -->
  168. <update id="updateList" parameterType="java.util.List">
  169. <foreach collection="list" index="index" item="item" open="begin" close=";end;" separator=";">
  170. UPDATE ATT_FUND_BASE
  171. <set>
  172. GD_X = #{item.gdX},
  173. GD_Y = #{item.gdY}
  174. </set>
  175. <where>
  176. ID = #{item.id}
  177. </where>
  178. </foreach>
  179. </update>
  180. </mapper>