RmsLineNodePointMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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.steerinfo.dil.mapper.RmsLineNodePointMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsLineNodePoint">
  5. <id column="LINE_NODE_ID" jdbcType="DECIMAL" property="lineNodeId" />
  6. <result column="TRANS_RANGE_ID" jdbcType="DECIMAL" property="transRangeId" />
  7. <result column="LOAD_POINT_NAME" jdbcType="VARCHAR" property="loadPointName" />
  8. <result column="UNLOAD_POINT_NAME" jdbcType="VARCHAR" property="unloadPointName" />
  9. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  10. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  11. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  12. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  13. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  14. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  15. </resultMap>
  16. <sql id="columns">
  17. LINE_NODE_ID, TRANS_RANGE_ID, LOAD_POINT_NAME, UNLOAD_POINT_NAME, INSERT_USERNAME,
  18. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
  19. </sql>
  20. <sql id="columns_alias">
  21. t.LINE_NODE_ID, t.TRANS_RANGE_ID, t.LOAD_POINT_NAME, t.UNLOAD_POINT_NAME, t.INSERT_USERNAME,
  22. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED
  23. </sql>
  24. <sql id="select">
  25. SELECT <include refid="columns" /> FROM RMS_LINE_NODE_POINT
  26. </sql>
  27. <sql id="select_alias">
  28. SELECT <include refid="columns_alias" /> FROM RMS_LINE_NODE_POINT t
  29. </sql>
  30. <sql id="where">
  31. <where>
  32. <if test="lineNodeId != null">
  33. and LINE_NODE_ID = #{lineNodeId}
  34. </if>
  35. <if test="transRangeId != null">
  36. and TRANS_RANGE_ID = #{transRangeId}
  37. </if>
  38. <if test="loadPointName != null and loadPointName != ''">
  39. and LOAD_POINT_NAME = #{loadPointName}
  40. </if>
  41. <if test="unloadPointName != null and unloadPointName != ''">
  42. and UNLOAD_POINT_NAME = #{unloadPointName}
  43. </if>
  44. <if test="insertUsername != null and insertUsername != ''">
  45. and INSERT_USERNAME = #{insertUsername}
  46. </if>
  47. <if test="insertTime != null">
  48. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  49. </if>
  50. <if test="updateUsername != null and updateUsername != ''">
  51. and UPDATE_USERNAME = #{updateUsername}
  52. </if>
  53. <if test="updateTime != null">
  54. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  55. </if>
  56. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  57. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  58. </if>
  59. <if test="deleted != null">
  60. and DELETED = #{deleted}
  61. </if>
  62. </where>
  63. </sql>
  64. <sql id="whereLike">
  65. <where>
  66. <if test="lineNodeId != null">
  67. and LINE_NODE_ID = #{lineNodeId}
  68. </if>
  69. <if test="transRangeId != null">
  70. and TRANS_RANGE_ID = #{transRangeId}
  71. </if>
  72. <if test="loadPointName != null and loadPointName != ''">
  73. and LOAD_POINT_NAME LIKE '%${loadPointName}%'
  74. </if>
  75. <if test="unloadPointName != null and unloadPointName != ''">
  76. and UNLOAD_POINT_NAME LIKE '%${unloadPointName}%'
  77. </if>
  78. <if test="insertUsername != null and insertUsername != ''">
  79. and INSERT_USERNAME LIKE '%${insertUsername}%'
  80. </if>
  81. <if test="insertTime != null">
  82. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  83. </if>
  84. <if test="updateUsername != null and updateUsername != ''">
  85. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  86. </if>
  87. <if test="updateTime != null">
  88. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  89. </if>
  90. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  91. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  92. </if>
  93. <if test="deleted != null">
  94. and DELETED = #{deleted}
  95. </if>
  96. </where>
  97. </sql>
  98. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  99. delete from RMS_LINE_NODE_POINT
  100. where LINE_NODE_ID = #{lineNodeId,jdbcType=DECIMAL}
  101. </delete>
  102. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  103. delete from RMS_LINE_NODE_POINT
  104. where 1!=1
  105. <if test="transRangeId != null">
  106. or TRANS_RANGE_ID = #{transRangeId}
  107. </if>
  108. <if test="loadPointName != null and loadPointName != ''">
  109. or LOAD_POINT_NAME = #{loadPointName}
  110. </if>
  111. <if test="unloadPointName != null and unloadPointName != ''">
  112. or UNLOAD_POINT_NAME = #{unloadPointName}
  113. </if>
  114. <if test="insertUsername != null and insertUsername != ''">
  115. or INSERT_USERNAME = #{insertUsername}
  116. </if>
  117. <if test="insertTime != null">
  118. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  119. </if>
  120. <if test="updateUsername != null and updateUsername != ''">
  121. or UPDATE_USERNAME = #{updateUsername}
  122. </if>
  123. <if test="updateTime != null">
  124. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  125. </if>
  126. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  127. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  128. </if>
  129. <if test="deleted != null">
  130. or DELETED = #{deleted}
  131. </if>
  132. </delete>
  133. <insert id="insert" parameterType="com.steerinfo.dil.model.RmsLineNodePoint">
  134. insert into RMS_LINE_NODE_POINT (LINE_NODE_ID, TRANS_RANGE_ID, LOAD_POINT_NAME,
  135. UNLOAD_POINT_NAME, INSERT_USERNAME, INSERT_TIME,
  136. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  137. DELETED)
  138. values (#{lineNodeId,jdbcType=DECIMAL}, #{transRangeId,jdbcType=DECIMAL}, #{loadPointName,jdbcType=VARCHAR},
  139. #{unloadPointName,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  140. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  141. #{deleted,jdbcType=DECIMAL})
  142. </insert>
  143. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsLineNodePoint">
  144. insert into RMS_LINE_NODE_POINT
  145. <trim prefix="(" suffix=")" suffixOverrides=",">
  146. <if test="lineNodeId != null">
  147. LINE_NODE_ID,
  148. </if>
  149. <if test="transRangeId != null">
  150. TRANS_RANGE_ID,
  151. </if>
  152. <if test="loadPointName != null">
  153. LOAD_POINT_NAME,
  154. </if>
  155. <if test="unloadPointName != null">
  156. UNLOAD_POINT_NAME,
  157. </if>
  158. <if test="insertUsername != null">
  159. INSERT_USERNAME,
  160. </if>
  161. <if test="insertTime != null">
  162. INSERT_TIME,
  163. </if>
  164. <if test="updateUsername != null">
  165. UPDATE_USERNAME,
  166. </if>
  167. <if test="updateTime != null">
  168. UPDATE_TIME,
  169. </if>
  170. <if test="insertUpdateRemark != null">
  171. INSERT_UPDATE_REMARK,
  172. </if>
  173. <if test="deleted != null">
  174. DELETED,
  175. </if>
  176. </trim>
  177. <trim prefix="values (" suffix=")" suffixOverrides=",">
  178. <if test="lineNodeId != null">
  179. #{lineNodeId,jdbcType=DECIMAL},
  180. </if>
  181. <if test="transRangeId != null">
  182. #{transRangeId,jdbcType=DECIMAL},
  183. </if>
  184. <if test="loadPointName != null">
  185. #{loadPointName,jdbcType=VARCHAR},
  186. </if>
  187. <if test="unloadPointName != null">
  188. #{unloadPointName,jdbcType=VARCHAR},
  189. </if>
  190. <if test="insertUsername != null">
  191. #{insertUsername,jdbcType=VARCHAR},
  192. </if>
  193. <if test="insertTime != null">
  194. #{insertTime,jdbcType=TIMESTAMP},
  195. </if>
  196. <if test="updateUsername != null">
  197. #{updateUsername,jdbcType=VARCHAR},
  198. </if>
  199. <if test="updateTime != null">
  200. #{updateTime,jdbcType=TIMESTAMP},
  201. </if>
  202. <if test="insertUpdateRemark != null">
  203. #{insertUpdateRemark,jdbcType=VARCHAR},
  204. </if>
  205. <if test="deleted != null">
  206. #{deleted,jdbcType=DECIMAL},
  207. </if>
  208. </trim>
  209. </insert>
  210. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsLineNodePoint">
  211. update RMS_LINE_NODE_POINT
  212. set TRANS_RANGE_ID = #{transRangeId,jdbcType=DECIMAL},
  213. LOAD_POINT_NAME = #{loadPointName,jdbcType=VARCHAR},
  214. UNLOAD_POINT_NAME = #{unloadPointName,jdbcType=VARCHAR},
  215. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  216. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  217. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  218. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  219. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  220. DELETED = #{deleted,jdbcType=DECIMAL}
  221. where LINE_NODE_ID = #{lineNodeId,jdbcType=DECIMAL}
  222. </update>
  223. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsLineNodePoint">
  224. update RMS_LINE_NODE_POINT
  225. <set>
  226. <if test="transRangeId != null">
  227. TRANS_RANGE_ID = #{transRangeId,jdbcType=DECIMAL},
  228. </if>
  229. <if test="loadPointName != null">
  230. LOAD_POINT_NAME = #{loadPointName,jdbcType=VARCHAR},
  231. </if>
  232. <if test="unloadPointName != null">
  233. UNLOAD_POINT_NAME = #{unloadPointName,jdbcType=VARCHAR},
  234. </if>
  235. <if test="insertUsername != null">
  236. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  237. </if>
  238. <if test="insertTime != null">
  239. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  240. </if>
  241. <if test="updateUsername != null">
  242. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  243. </if>
  244. <if test="updateTime != null">
  245. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  246. </if>
  247. <if test="insertUpdateRemark != null">
  248. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  249. </if>
  250. <if test="deleted != null">
  251. DELETED = #{deleted,jdbcType=DECIMAL},
  252. </if>
  253. </set>
  254. where LINE_NODE_ID = #{lineNodeId,jdbcType=DECIMAL}
  255. </update>
  256. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  257. <include refid="select" />
  258. where LINE_NODE_ID = #{lineNodeId,jdbcType=DECIMAL}
  259. </select>
  260. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  261. <include refid="select" />
  262. <include refid="where" />
  263. </select>
  264. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  265. <include refid="select" />
  266. <include refid="whereLike" />
  267. </select>
  268. <insert id="batchInsert" parameterType="java.util.List">
  269. insert into RMS_LINE_NODE_POINT
  270. (LINE_NODE_ID,
  271. TRANS_RANGE_ID, LOAD_POINT_NAME,
  272. UNLOAD_POINT_NAME, INSERT_USERNAME,
  273. INSERT_TIME, UPDATE_USERNAME,
  274. UPDATE_TIME, INSERT_UPDATE_REMARK,
  275. DELETED)
  276. ( <foreach collection="list" item="item" separator="union all">
  277. select
  278. #{item.lineNodeId,jdbcType=DECIMAL},
  279. #{item.transRangeId,jdbcType=DECIMAL}, #{item.loadPointName,jdbcType=VARCHAR},
  280. #{item.unloadPointName,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
  281. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  282. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  283. #{item.deleted,jdbcType=DECIMAL} from dual
  284. </foreach> )
  285. </insert>
  286. <update id="batchUpdate" parameterType="java.util.List">
  287. update RMS_LINE_NODE_POINT
  288. set
  289. LINE_NODE_ID=
  290. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  291. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.lineNodeId,jdbcType=DECIMAL}
  292. </foreach>
  293. ,TRANS_RANGE_ID=
  294. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  295. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.transRangeId,jdbcType=DECIMAL}
  296. </foreach>
  297. ,LOAD_POINT_NAME=
  298. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  299. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.loadPointName,jdbcType=VARCHAR}
  300. </foreach>
  301. ,UNLOAD_POINT_NAME=
  302. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  303. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.unloadPointName,jdbcType=VARCHAR}
  304. </foreach>
  305. ,INSERT_USERNAME=
  306. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  307. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  308. </foreach>
  309. ,INSERT_TIME=
  310. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  311. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  312. </foreach>
  313. ,UPDATE_USERNAME=
  314. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  315. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  316. </foreach>
  317. ,UPDATE_TIME=
  318. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  319. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  320. </foreach>
  321. ,INSERT_UPDATE_REMARK=
  322. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  323. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  324. </foreach>
  325. ,DELETED=
  326. <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
  327. when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  328. </foreach>
  329. where LINE_NODE_ID in
  330. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  331. #{item.lineNodeId,jdbcType=DECIMAL}
  332. </foreach>
  333. </update>
  334. <delete id="batchDelete" parameterType="java.util.List">
  335. delete from RMS_LINE_NODE_POINT
  336. where LINE_NODE_ID in
  337. <foreach close=")" collection="list" item="id" open="(" separator=",">
  338. #{id}
  339. </foreach>
  340. </delete>
  341. <!-- 友情提示!!!-->
  342. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  343. </mapper>