FactDwrPcProWellVolDMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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="com.bowintek.practice.mapper.FactDwrPcProWellVolDMapper">
  4. <resultMap id="BaseResultMap" type="com.bowintek.practice.model.FactDwrPcProWellVolD">
  5. <result column="well_id" jdbcType="VARCHAR" property="well_id" />
  6. <result column="well_common_name" jdbcType="VARCHAR" property="well_common_name" />
  7. <result column="prod_time" jdbcType="DATE" property="prod_time" />
  8. <result column="oil_prod_daily" jdbcType="NUMERIC" property="oil_prod_daily" />
  9. <result column="water_prod_daily" jdbcType="NUMERIC" property="water_prod_daily" />
  10. <result column="gas_prod_daily" jdbcType="NUMERIC" property="gas_prod_daily" />
  11. <result column="water_cut" jdbcType="NUMERIC" property="water_cut" />
  12. <result column="sand_content_ratio" jdbcType="NUMERIC" property="sand_content_ratio" />
  13. <result column="oil_prod_begin_date" jdbcType="DATE" property="oil_prod_begin_date" />
  14. <result column="oil_prod_recent_date" jdbcType="DATE" property="oil_prod_recent_date" />
  15. <result column="well_type" jdbcType="VARCHAR" property="well_type" />
  16. <result column="spud_date" jdbcType="DATE" property="spud_date" />
  17. <result column="end_drilling_date" jdbcType="DATE" property="end_drilling_date" />
  18. <result column="budgeted_md" jdbcType="NUMERIC" property="budgeted_md" />
  19. <result column="completion_date" jdbcType="DATE" property="completion_date" />
  20. <result column="current_state" jdbcType="VARCHAR" property="current_state" />
  21. <result column="oil_prod_latest_monthly" jdbcType="NUMERIC" property="oil_prod_latest_monthly" />
  22. <result column="gas_prod_cum" jdbcType="NUMERIC" property="gas_prod_cum" />
  23. <result column="water_prod_cum" jdbcType="NUMERIC" property="water_prod_cum" />
  24. <result column="oil_prod_cum" jdbcType="NUMERIC" property="oil_prod_cum" />
  25. <result column="fluid_prod_daily" jdbcType="NUMERIC" property="fluid_prod_daily" />
  26. </resultMap>
  27. <sql id="Example_Where_Clause">
  28. <where>
  29. <foreach collection="oredCriteria" item="criteria" separator="or">
  30. <if test="criteria.valid">
  31. <trim prefix="(" prefixOverrides="and" suffix=")">
  32. <foreach collection="criteria.criteria" item="criterion">
  33. <choose>
  34. <when test="criterion.noValue">
  35. and ${criterion.condition}
  36. </when>
  37. <when test="criterion.singleValue">
  38. and ${criterion.condition} #{criterion.value}
  39. </when>
  40. <when test="criterion.betweenValue">
  41. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  42. </when>
  43. <when test="criterion.listValue">
  44. and ${criterion.condition}
  45. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  46. #{listItem}
  47. </foreach>
  48. </when>
  49. </choose>
  50. </foreach>
  51. </trim>
  52. </if>
  53. </foreach>
  54. </where>
  55. </sql>
  56. <sql id="Update_By_Example_Where_Clause">
  57. <where>
  58. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  59. <if test="criteria.valid">
  60. <trim prefix="(" prefixOverrides="and" suffix=")">
  61. <foreach collection="criteria.criteria" item="criterion">
  62. <choose>
  63. <when test="criterion.noValue">
  64. and ${criterion.condition}
  65. </when>
  66. <when test="criterion.singleValue">
  67. and ${criterion.condition} #{criterion.value}
  68. </when>
  69. <when test="criterion.betweenValue">
  70. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  71. </when>
  72. <when test="criterion.listValue">
  73. and ${criterion.condition}
  74. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  75. #{listItem}
  76. </foreach>
  77. </when>
  78. </choose>
  79. </foreach>
  80. </trim>
  81. </if>
  82. </foreach>
  83. </where>
  84. </sql>
  85. <sql id="Base_Column_List">
  86. well_id, well_common_name, prod_time, oil_prod_daily, water_prod_daily, gas_prod_daily,
  87. water_cut, sand_content_ratio, oil_prod_begin_date, oil_prod_recent_date, well_type,
  88. spud_date, end_drilling_date, budgeted_md, completion_date, current_state, oil_prod_latest_monthly,
  89. gas_prod_cum, water_prod_cum, oil_prod_cum, fluid_prod_daily
  90. </sql>
  91. <select id="selectByExample" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolDExample" resultMap="BaseResultMap">
  92. select
  93. <if test="distinct">
  94. distinct
  95. </if>
  96. <include refid="Base_Column_List" />
  97. from fact_dwr_pc_pro_well_vol_d
  98. <if test="_parameter != null">
  99. <include refid="Example_Where_Clause" />
  100. </if>
  101. <if test="orderByClause != null">
  102. order by ${orderByClause}
  103. </if>
  104. </select>
  105. <delete id="deleteByExample" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolDExample">
  106. delete from fact_dwr_pc_pro_well_vol_d
  107. <if test="_parameter != null">
  108. <include refid="Example_Where_Clause" />
  109. </if>
  110. </delete>
  111. <insert id="insert" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolD">
  112. insert into fact_dwr_pc_pro_well_vol_d (well_id, well_common_name, prod_time,
  113. oil_prod_daily, water_prod_daily, gas_prod_daily,
  114. water_cut, sand_content_ratio, oil_prod_begin_date,
  115. oil_prod_recent_date, well_type, spud_date,
  116. end_drilling_date, budgeted_md, completion_date,
  117. current_state, oil_prod_latest_monthly,
  118. gas_prod_cum, water_prod_cum, oil_prod_cum,
  119. fluid_prod_daily)
  120. values (#{well_id,jdbcType=VARCHAR}, #{well_common_name,jdbcType=VARCHAR}, #{prod_time,jdbcType=DATE},
  121. #{oil_prod_daily,jdbcType=NUMERIC}, #{water_prod_daily,jdbcType=NUMERIC}, #{gas_prod_daily,jdbcType=NUMERIC},
  122. #{water_cut,jdbcType=NUMERIC}, #{sand_content_ratio,jdbcType=NUMERIC}, #{oil_prod_begin_date,jdbcType=DATE},
  123. #{oil_prod_recent_date,jdbcType=DATE}, #{well_type,jdbcType=VARCHAR}, #{spud_date,jdbcType=DATE},
  124. #{end_drilling_date,jdbcType=DATE}, #{budgeted_md,jdbcType=NUMERIC}, #{completion_date,jdbcType=DATE},
  125. #{current_state,jdbcType=VARCHAR}, #{oil_prod_latest_monthly,jdbcType=NUMERIC},
  126. #{gas_prod_cum,jdbcType=NUMERIC}, #{water_prod_cum,jdbcType=NUMERIC}, #{oil_prod_cum,jdbcType=NUMERIC},
  127. #{fluid_prod_daily,jdbcType=NUMERIC})
  128. </insert>
  129. <insert id="insertSelective" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolD">
  130. insert into fact_dwr_pc_pro_well_vol_d
  131. <trim prefix="(" suffix=")" suffixOverrides=",">
  132. <if test="well_id != null">
  133. well_id,
  134. </if>
  135. <if test="well_common_name != null">
  136. well_common_name,
  137. </if>
  138. <if test="prod_time != null">
  139. prod_time,
  140. </if>
  141. <if test="oil_prod_daily != null">
  142. oil_prod_daily,
  143. </if>
  144. <if test="water_prod_daily != null">
  145. water_prod_daily,
  146. </if>
  147. <if test="gas_prod_daily != null">
  148. gas_prod_daily,
  149. </if>
  150. <if test="water_cut != null">
  151. water_cut,
  152. </if>
  153. <if test="sand_content_ratio != null">
  154. sand_content_ratio,
  155. </if>
  156. <if test="oil_prod_begin_date != null">
  157. oil_prod_begin_date,
  158. </if>
  159. <if test="oil_prod_recent_date != null">
  160. oil_prod_recent_date,
  161. </if>
  162. <if test="well_type != null">
  163. well_type,
  164. </if>
  165. <if test="spud_date != null">
  166. spud_date,
  167. </if>
  168. <if test="end_drilling_date != null">
  169. end_drilling_date,
  170. </if>
  171. <if test="budgeted_md != null">
  172. budgeted_md,
  173. </if>
  174. <if test="completion_date != null">
  175. completion_date,
  176. </if>
  177. <if test="current_state != null">
  178. current_state,
  179. </if>
  180. <if test="oil_prod_latest_monthly != null">
  181. oil_prod_latest_monthly,
  182. </if>
  183. <if test="gas_prod_cum != null">
  184. gas_prod_cum,
  185. </if>
  186. <if test="water_prod_cum != null">
  187. water_prod_cum,
  188. </if>
  189. <if test="oil_prod_cum != null">
  190. oil_prod_cum,
  191. </if>
  192. <if test="fluid_prod_daily != null">
  193. fluid_prod_daily,
  194. </if>
  195. </trim>
  196. <trim prefix="values (" suffix=")" suffixOverrides=",">
  197. <if test="well_id != null">
  198. #{well_id,jdbcType=VARCHAR},
  199. </if>
  200. <if test="well_common_name != null">
  201. #{well_common_name,jdbcType=VARCHAR},
  202. </if>
  203. <if test="prod_time != null">
  204. #{prod_time,jdbcType=DATE},
  205. </if>
  206. <if test="oil_prod_daily != null">
  207. #{oil_prod_daily,jdbcType=NUMERIC},
  208. </if>
  209. <if test="water_prod_daily != null">
  210. #{water_prod_daily,jdbcType=NUMERIC},
  211. </if>
  212. <if test="gas_prod_daily != null">
  213. #{gas_prod_daily,jdbcType=NUMERIC},
  214. </if>
  215. <if test="water_cut != null">
  216. #{water_cut,jdbcType=NUMERIC},
  217. </if>
  218. <if test="sand_content_ratio != null">
  219. #{sand_content_ratio,jdbcType=NUMERIC},
  220. </if>
  221. <if test="oil_prod_begin_date != null">
  222. #{oil_prod_begin_date,jdbcType=DATE},
  223. </if>
  224. <if test="oil_prod_recent_date != null">
  225. #{oil_prod_recent_date,jdbcType=DATE},
  226. </if>
  227. <if test="well_type != null">
  228. #{well_type,jdbcType=VARCHAR},
  229. </if>
  230. <if test="spud_date != null">
  231. #{spud_date,jdbcType=DATE},
  232. </if>
  233. <if test="end_drilling_date != null">
  234. #{end_drilling_date,jdbcType=DATE},
  235. </if>
  236. <if test="budgeted_md != null">
  237. #{budgeted_md,jdbcType=NUMERIC},
  238. </if>
  239. <if test="completion_date != null">
  240. #{completion_date,jdbcType=DATE},
  241. </if>
  242. <if test="current_state != null">
  243. #{current_state,jdbcType=VARCHAR},
  244. </if>
  245. <if test="oil_prod_latest_monthly != null">
  246. #{oil_prod_latest_monthly,jdbcType=NUMERIC},
  247. </if>
  248. <if test="gas_prod_cum != null">
  249. #{gas_prod_cum,jdbcType=NUMERIC},
  250. </if>
  251. <if test="water_prod_cum != null">
  252. #{water_prod_cum,jdbcType=NUMERIC},
  253. </if>
  254. <if test="oil_prod_cum != null">
  255. #{oil_prod_cum,jdbcType=NUMERIC},
  256. </if>
  257. <if test="fluid_prod_daily != null">
  258. #{fluid_prod_daily,jdbcType=NUMERIC},
  259. </if>
  260. </trim>
  261. </insert>
  262. <select id="countByExample" parameterType="com.bowintek.practice.model.FactDwrPcProWellVolDExample" resultType="java.lang.Long">
  263. select count(*) from fact_dwr_pc_pro_well_vol_d
  264. <if test="_parameter != null">
  265. <include refid="Example_Where_Clause" />
  266. </if>
  267. </select>
  268. <update id="updateByExampleSelective" parameterType="map">
  269. update fact_dwr_pc_pro_well_vol_d
  270. <set>
  271. <if test="row.well_id != null">
  272. well_id = #{row.well_id,jdbcType=VARCHAR},
  273. </if>
  274. <if test="row.well_common_name != null">
  275. well_common_name = #{row.well_common_name,jdbcType=VARCHAR},
  276. </if>
  277. <if test="row.prod_time != null">
  278. prod_time = #{row.prod_time,jdbcType=DATE},
  279. </if>
  280. <if test="row.oil_prod_daily != null">
  281. oil_prod_daily = #{row.oil_prod_daily,jdbcType=NUMERIC},
  282. </if>
  283. <if test="row.water_prod_daily != null">
  284. water_prod_daily = #{row.water_prod_daily,jdbcType=NUMERIC},
  285. </if>
  286. <if test="row.gas_prod_daily != null">
  287. gas_prod_daily = #{row.gas_prod_daily,jdbcType=NUMERIC},
  288. </if>
  289. <if test="row.water_cut != null">
  290. water_cut = #{row.water_cut,jdbcType=NUMERIC},
  291. </if>
  292. <if test="row.sand_content_ratio != null">
  293. sand_content_ratio = #{row.sand_content_ratio,jdbcType=NUMERIC},
  294. </if>
  295. <if test="row.oil_prod_begin_date != null">
  296. oil_prod_begin_date = #{row.oil_prod_begin_date,jdbcType=DATE},
  297. </if>
  298. <if test="row.oil_prod_recent_date != null">
  299. oil_prod_recent_date = #{row.oil_prod_recent_date,jdbcType=DATE},
  300. </if>
  301. <if test="row.well_type != null">
  302. well_type = #{row.well_type,jdbcType=VARCHAR},
  303. </if>
  304. <if test="row.spud_date != null">
  305. spud_date = #{row.spud_date,jdbcType=DATE},
  306. </if>
  307. <if test="row.end_drilling_date != null">
  308. end_drilling_date = #{row.end_drilling_date,jdbcType=DATE},
  309. </if>
  310. <if test="row.budgeted_md != null">
  311. budgeted_md = #{row.budgeted_md,jdbcType=NUMERIC},
  312. </if>
  313. <if test="row.completion_date != null">
  314. completion_date = #{row.completion_date,jdbcType=DATE},
  315. </if>
  316. <if test="row.current_state != null">
  317. current_state = #{row.current_state,jdbcType=VARCHAR},
  318. </if>
  319. <if test="row.oil_prod_latest_monthly != null">
  320. oil_prod_latest_monthly = #{row.oil_prod_latest_monthly,jdbcType=NUMERIC},
  321. </if>
  322. <if test="row.gas_prod_cum != null">
  323. gas_prod_cum = #{row.gas_prod_cum,jdbcType=NUMERIC},
  324. </if>
  325. <if test="row.water_prod_cum != null">
  326. water_prod_cum = #{row.water_prod_cum,jdbcType=NUMERIC},
  327. </if>
  328. <if test="row.oil_prod_cum != null">
  329. oil_prod_cum = #{row.oil_prod_cum,jdbcType=NUMERIC},
  330. </if>
  331. <if test="row.fluid_prod_daily != null">
  332. fluid_prod_daily = #{row.fluid_prod_daily,jdbcType=NUMERIC},
  333. </if>
  334. </set>
  335. <if test="example != null">
  336. <include refid="Update_By_Example_Where_Clause" />
  337. </if>
  338. </update>
  339. <update id="updateByExample" parameterType="map">
  340. update fact_dwr_pc_pro_well_vol_d
  341. set well_id = #{row.well_id,jdbcType=VARCHAR},
  342. well_common_name = #{row.well_common_name,jdbcType=VARCHAR},
  343. prod_time = #{row.prod_time,jdbcType=DATE},
  344. oil_prod_daily = #{row.oil_prod_daily,jdbcType=NUMERIC},
  345. water_prod_daily = #{row.water_prod_daily,jdbcType=NUMERIC},
  346. gas_prod_daily = #{row.gas_prod_daily,jdbcType=NUMERIC},
  347. water_cut = #{row.water_cut,jdbcType=NUMERIC},
  348. sand_content_ratio = #{row.sand_content_ratio,jdbcType=NUMERIC},
  349. oil_prod_begin_date = #{row.oil_prod_begin_date,jdbcType=DATE},
  350. oil_prod_recent_date = #{row.oil_prod_recent_date,jdbcType=DATE},
  351. well_type = #{row.well_type,jdbcType=VARCHAR},
  352. spud_date = #{row.spud_date,jdbcType=DATE},
  353. end_drilling_date = #{row.end_drilling_date,jdbcType=DATE},
  354. budgeted_md = #{row.budgeted_md,jdbcType=NUMERIC},
  355. completion_date = #{row.completion_date,jdbcType=DATE},
  356. current_state = #{row.current_state,jdbcType=VARCHAR},
  357. oil_prod_latest_monthly = #{row.oil_prod_latest_monthly,jdbcType=NUMERIC},
  358. gas_prod_cum = #{row.gas_prod_cum,jdbcType=NUMERIC},
  359. water_prod_cum = #{row.water_prod_cum,jdbcType=NUMERIC},
  360. oil_prod_cum = #{row.oil_prod_cum,jdbcType=NUMERIC},
  361. fluid_prod_daily = #{row.fluid_prod_daily,jdbcType=NUMERIC}
  362. <if test="example != null">
  363. <include refid="Update_By_Example_Where_Clause" />
  364. </if>
  365. </update>
  366. </mapper>