fbdedf1e1e43ae8257fd5d7e0bb6340d5ff75fb4.svn-base 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.BisInspWagaSapRgstrBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstrBase" id="bisInspWagaSapRgstrBaseResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="rgstrId" column="RGSTR_ID"/>
  7. <result property="sapName" column="SAP_NAME"/>
  8. <result property="sapLen" column="SAP_LEN"/>
  9. <result property="dikeGrad" column="DIKE_GRAD"/>
  10. <result property="planFlSta" column="PLAN_FL_STA"/>
  11. <result property="riverBank" column="RIVER_BANK"/>
  12. <result property="lake" column="LAKE"/>
  13. <result property="coast" column="COAST"/>
  14. <result property="compUnit" column="COMP_UNIT"/>
  15. <result property="mampu" column="MAMPU"/>
  16. <result property="mampuAttn" column="MAMPU_ATTN"/>
  17. <result property="mampuAttnTel" column="MAMPU_ATTN_TEL"/>
  18. <result property="recPersId" column="REC_PERS_ID"/>
  19. <result property="intm" column="INTM"/>
  20. <result property="uptm" column="UPTM"/>
  21. <result property="status" column="STATUS"/>
  22. </resultMap>
  23. <sql id="table_columns">
  24. ID,
  25. RGSTR_ID,
  26. SAP_NAME,
  27. SAP_LEN,
  28. DIKE_GRAD,
  29. PLAN_FL_STA,
  30. RIVER_BANK,
  31. LAKE,
  32. COAST,
  33. COMP_UNIT,
  34. MAMPU,
  35. MAMPU_ATTN,
  36. MAMPU_ATTN_TEL,
  37. REC_PERS_ID,
  38. INTM,
  39. UPTM,
  40. STATUS
  41. </sql>
  42. <sql id="entity_properties">
  43. #{id},
  44. #{rgstrId},
  45. #{sapName},
  46. #{sapLen},
  47. #{dikeGrad},
  48. #{planFlSta},
  49. #{riverBank},
  50. #{lake},
  51. #{coast},
  52. #{compUnit},
  53. #{mampu},
  54. #{mampuAttn},
  55. #{mampuAttnTel},
  56. #{recPersId},
  57. #{intm},
  58. #{uptm},
  59. #{status}
  60. </sql>
  61. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  62. <sql id="page_where">
  63. <trim prefix="where" prefixOverrides="and | or ">
  64. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  65. <if test="sapName != null and sapName != ''">and SAP_NAME = #{sapName}</if>
  66. <if test="sapLen != null and sapLen != ''">and SAP_LEN = #{sapLen}</if>
  67. <if test="dikeGrad != null and dikeGrad != ''">and DIKE_GRAD = #{dikeGrad}</if>
  68. <if test="planFlSta != null and planFlSta != ''">and PLAN_FL_STA = #{planFlSta}</if>
  69. <if test="riverBank != null and riverBank != ''">and RIVER_BANK = #{riverBank}</if>
  70. <if test="lake != null and lake != ''">and LAKE = #{lake}</if>
  71. <if test="coast != null and coast != ''">and COAST = #{coast}</if>
  72. <if test="compUnit != null and compUnit != ''">and COMP_UNIT = #{compUnit}</if>
  73. <if test="mampu != null and mampu != ''">and MAMPU = #{mampu}</if>
  74. <if test="mampuAttn != null and mampuAttn != ''">and MAMPU_ATTN = #{mampuAttn}</if>
  75. <if test="mampuAttnTel != null and mampuAttnTel != ''">and MAMPU_ATTN_TEL = #{mampuAttnTel}</if>
  76. <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
  77. <if test="intm != null">and INTM = #{intm}</if>
  78. <if test="uptm != null">and UPTM = #{uptm}</if>
  79. <if test="status != null and status != ''">and STATUS = #{status}</if>
  80. </trim>
  81. </sql>
  82. <select id="get" resultMap="bisInspWagaSapRgstrBaseResultMap" parameterType="String" >
  83. select <include refid="table_columns" /> from BIS_INSP_WAGA_SAP_RGSTR_BASE where ID = #{id}
  84. </select>
  85. <select id="getBy" resultMap="bisInspWagaSapRgstrBaseResultMap">
  86. select <include refid="table_columns" /> from BIS_INSP_WAGA_SAP_RGSTR_BASE <include refid="page_where" />
  87. </select>
  88. <select id="findAll" resultMap="bisInspWagaSapRgstrBaseResultMap">
  89. select <include refid="table_columns" /> from BIS_INSP_WAGA_SAP_RGSTR_BASE
  90. </select>
  91. <select id="findList" resultMap="bisInspWagaSapRgstrBaseResultMap">
  92. select <include refid="table_columns" /> from BIS_INSP_WAGA_SAP_RGSTR_BASE <include refid="page_where" />
  93. </select>
  94. <select id="selectCount" resultType="int" >
  95. select count(ID) from BIS_INSP_WAGA_SAP_RGSTR_BASE <include refid="page_where" />
  96. </select>
  97. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstrBase">
  98. insert into BIS_INSP_WAGA_SAP_RGSTR_BASE( <include refid="table_columns" /> )
  99. values ( <include refid="entity_properties" /> )
  100. </insert>
  101. <delete id="delete" parameterType="java.lang.String">
  102. delete from BIS_INSP_WAGA_SAP_RGSTR_BASE where ID = #{id}
  103. </delete>
  104. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstrBase">
  105. delete from BIS_INSP_WAGA_SAP_RGSTR_BASE <include refid="page_where" />
  106. </delete>
  107. <update id="deleteInFlag" parameterType="java.lang.String">
  108. update BIS_INSP_WAGA_SAP_RGSTR_BASE set flag_valid = 0 where ID = #{id}
  109. </update>
  110. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstrBase">
  111. update BIS_INSP_WAGA_SAP_RGSTR_BASE
  112. <trim prefix="set" suffixOverrides=",">
  113. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  114. <if test="sapName != null and sapName != ''">SAP_NAME = #{sapName},</if>
  115. <if test="sapLen != null and sapLen != ''">SAP_LEN = #{sapLen},</if>
  116. <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
  117. <if test="planFlSta != null and planFlSta != ''">PLAN_FL_STA = #{planFlSta},</if>
  118. <if test="riverBank != null and riverBank != ''">RIVER_BANK = #{riverBank},</if>
  119. <if test="lake != null and lake != ''">LAKE = #{lake},</if>
  120. <if test="coast != null and coast != ''">COAST = #{coast},</if>
  121. <if test="compUnit != null and compUnit != ''">COMP_UNIT = #{compUnit},</if>
  122. <if test="mampu != null and mampu != ''">MAMPU = #{mampu},</if>
  123. <if test="mampuAttn != null and mampuAttn != ''">MAMPU_ATTN = #{mampuAttn},</if>
  124. <if test="mampuAttnTel != null and mampuAttnTel != ''">MAMPU_ATTN_TEL = #{mampuAttnTel},</if>
  125. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  126. <if test="intm != null">INTM = #{intm},</if>
  127. <if test="uptm != null">UPTM = #{uptm},</if>
  128. <if test="status != null and status != ''">STATUS = #{status},</if>
  129. </trim>
  130. <where>ID = #{id}</where>
  131. </update>
  132. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWagaSapRgstrBase">
  133. update BIS_INSP_WAGA_SAP_RGSTR_BASE
  134. <trim prefix="set" suffixOverrides=",">
  135. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  136. <if test="sapName != null and sapName != ''">SAP_NAME = #{sapName},</if>
  137. <if test="sapLen != null and sapLen != ''">SAP_LEN = #{sapLen},</if>
  138. <if test="dikeGrad != null and dikeGrad != ''">DIKE_GRAD = #{dikeGrad},</if>
  139. <if test="planFlSta != null and planFlSta != ''">PLAN_FL_STA = #{planFlSta},</if>
  140. <if test="riverBank != null and riverBank != ''">RIVER_BANK = #{riverBank},</if>
  141. <if test="lake != null and lake != ''">LAKE = #{lake},</if>
  142. <if test="coast != null and coast != ''">COAST = #{coast},</if>
  143. <if test="compUnit != null and compUnit != ''">COMP_UNIT = #{compUnit},</if>
  144. <if test="mampu != null and mampu != ''">MAMPU = #{mampu},</if>
  145. <if test="mampuAttn != null and mampuAttn != ''">MAMPU_ATTN = #{mampuAttn},</if>
  146. <if test="mampuAttnTel != null and mampuAttnTel != ''">MAMPU_ATTN_TEL = #{mampuAttnTel},</if>
  147. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  148. <if test="intm != null">INTM = #{intm},</if>
  149. <if test="uptm != null">UPTM = #{uptm},</if>
  150. <if test="status != null and status != ''">STATUS = #{status},</if>
  151. </trim>
  152. <include refid="page_where" />
  153. </update>
  154. <!-- 其他自定义SQL -->
  155. <delete id="deleteByRgstrId">
  156. delete from BIS_INSP_WAGA_SAP_RGSTR_BASE where RGSTR_ID = #{rgstrId}
  157. </delete>
  158. <select id="getWagaSapRgstrBaseByRgstrId" resultMap="bisInspWagaSapRgstrBaseResultMap">
  159. select
  160. <include refid="table_columns"/>
  161. from BIS_INSP_WAGA_SAP_RGSTR_BASE where RGSTR_ID = #{rgstrId}
  162. </select>
  163. </mapper>