BusLineMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.railway.business.catenary.mapper.BusLineMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusLine">
  6. <result column="line_id" property="lineId"/>
  7. <result column="dept_id" property="deptId"/>
  8. <result column="dept_name" property="deptName"/>
  9. <result column="line_name" property="lineName"/>
  10. <result column="line_sddj" property="lineSddj"/>
  11. <result column="line_type" property="lineType"/>
  12. <result column="line_dj" property="lineDj"/>
  13. <result column="line_ktrq" property="lineKtrq"/>
  14. <result column="line_yylc" property="lineYylc"/>
  15. <result column="line_start_marker" property="lineStartMarker"/>
  16. <result column="line_end_marker" property="lineEndMarker"/>
  17. <result column="up_start_marker" property="upStartMarker"/>
  18. <result column="up_end_marker" property="upEndMarker"/>
  19. <result column="down_start_marker" property="downStartMarker"/>
  20. <result column="down_end_marker" property="downEndMarker"/>
  21. <result column="line_gdfs" property="lineGdfs"/>
  22. <result column="line_xglx" property="lineXglx"/>
  23. <result column="line_qt" property="lineQt"/>
  24. <result column="line_sjbh" property="lineSjbh"/>
  25. <result column="order_num" property="orderNum"/>
  26. <result column="status" property="status"/>
  27. <result column="del_flag" property="delFlag"/>
  28. <result column="create_by" property="createBy"/>
  29. <result column="create_time" property="createTime"/>
  30. <result column="update_by" property="updateBy"/>
  31. <result column="update_time" property="updateTime"/>
  32. </resultMap>
  33. <sql id="Base_Column_List">
  34. line_id,
  35. dept_id,
  36. dept_name,
  37. line_name,
  38. line_sddj,
  39. line_type,
  40. line_dj,
  41. line_ktrq,
  42. line_yylc,
  43. line_start_marker,
  44. line_end_marker,
  45. up_start_marker,
  46. up_end_marker,
  47. down_start_marker,
  48. down_end_marker,
  49. line_gdfs,
  50. line_xglx,
  51. line_qt,
  52. line_sjbh,
  53. order_num,
  54. status,
  55. del_flag,
  56. create_by,
  57. create_time,
  58. update_by,
  59. update_time
  60. </sql>
  61. <insert id="insert" parameterType="com.railway.business.catenary.domain.BusLine">
  62. <selectKey keyProperty="lineId" order="BEFORE" resultType="String">
  63. select replace(uuid(), '-', '') from dual
  64. </selectKey>
  65. INSERT INTO bus_line
  66. <trim prefix="(" suffix=")" suffixOverrides=",">
  67. <if test='null != deptId'>
  68. dept_id,
  69. </if>
  70. <if test='null != deptName'>
  71. dept_name,
  72. </if>
  73. <if test='null != lineName'>
  74. line_name,
  75. </if>
  76. <if test='null != lineSddj'>
  77. line_sddj,
  78. </if>
  79. <if test='null != lineType'>
  80. line_type,
  81. </if>
  82. <if test='null != lineDj'>
  83. line_dj,
  84. </if>
  85. <if test='null != lineKtrq'>
  86. line_ktrq,
  87. </if>
  88. <if test='null != lineYylc'>
  89. line_yylc,
  90. </if>
  91. <if test='null != lineStartMarker'>
  92. line_start_marker,
  93. </if>
  94. <if test='null != lineEndMarker'>
  95. line_end_marker,
  96. </if>
  97. <if test='null != upStartMarker'>
  98. up_start_marker,
  99. </if>
  100. <if test='null != upEndMarker'>
  101. up_end_marker,
  102. </if>
  103. <if test='null != downStartMarker'>
  104. down_start_marker,
  105. </if>
  106. <if test='null != downEndMarker'>
  107. down_end_marker,
  108. </if>
  109. <if test='null != lineGdfs'>
  110. line_gdfs,
  111. </if>
  112. <if test='null != lineXglx'>
  113. line_xglx,
  114. </if>
  115. <if test='null != lineQt'>
  116. line_qt,
  117. </if>
  118. <if test='null != lineSjbh'>
  119. line_sjbh,
  120. </if>
  121. <if test='null != orderNum'>
  122. order_num,
  123. </if>
  124. <if test='null != status'>
  125. status,
  126. </if>
  127. <if test='null != delFlag'>
  128. del_flag,
  129. </if>
  130. <if test='null != createBy'>
  131. create_by,
  132. </if>
  133. <if test='null != createTime'>
  134. create_time,
  135. </if>
  136. <if test='null != updateBy'>
  137. update_by,
  138. </if>
  139. <if test='null != updateTime'>
  140. update_time
  141. </if>
  142. </trim>
  143. <trim prefix="values (" suffix=")" suffixOverrides=",">
  144. <if test='null != deptId'>
  145. #{deptId},
  146. </if>
  147. <if test='null != deptName'>
  148. #{deptName},
  149. </if>
  150. <if test='null != lineName'>
  151. #{lineName},
  152. </if>
  153. <if test='null != lineSddj'>
  154. #{lineSddj},
  155. </if>
  156. <if test='null != lineType'>
  157. #{lineType},
  158. </if>
  159. <if test='null != lineDj'>
  160. #{lineDj},
  161. </if>
  162. <if test='null != lineKtrq'>
  163. #{lineKtrq},
  164. </if>
  165. <if test='null != lineYylc'>
  166. #{lineYylc},
  167. </if>
  168. <if test='null != lineStartMarker'>
  169. #{lineStartMarker},
  170. </if>
  171. <if test='null != lineEndMarker'>
  172. #{lineEndMarker},
  173. </if>
  174. <if test='null != upStartMarker'>
  175. #{upStartMarker},
  176. </if>
  177. <if test='null != upEndMarker'>
  178. #{upEndMarker},
  179. </if>
  180. <if test='null != downStartMarker'>
  181. #{downStartMarker},
  182. </if>
  183. <if test='null != downEndMarker'>
  184. #{downEndMarker},
  185. </if>
  186. <if test='null != lineGdfs'>
  187. #{lineGdfs},
  188. </if>
  189. <if test='null != lineXglx'>
  190. #{lineXglx},
  191. </if>
  192. <if test='null != lineQt'>
  193. #{lineQt},
  194. </if>
  195. <if test='null != lineSjbh'>
  196. #{lineSjbh},
  197. </if>
  198. <if test='null != orderNum'>
  199. #{orderNum},
  200. </if>
  201. <if test='null != status'>
  202. #{status},
  203. </if>
  204. <if test='null != delFlag'>
  205. #{delFlag},
  206. </if>
  207. <if test='null != createBy'>
  208. #{createBy},
  209. </if>
  210. <if test='null != createTime'>
  211. #{createTime},
  212. </if>
  213. <if test='null != updateBy'>
  214. #{updateBy},
  215. </if>
  216. <if test='null != updateTime'>
  217. #{updateTime}
  218. </if>
  219. </trim>
  220. </insert>
  221. <delete id="delete">
  222. UPDATE bus_line
  223. set del_flag='1'
  224. WHERE line_id = #{lineId}
  225. </delete>
  226. <update id="update" parameterType="com.railway.business.catenary.domain.BusLine">
  227. UPDATE bus_line
  228. <set>
  229. <if test='null != deptId'>dept_id = #{deptId},</if>
  230. <if test='null != deptName'>dept_name = #{deptName},</if>
  231. <if test='null != lineName'>line_name = #{lineName},</if>
  232. <if test='null != lineSddj'>line_sddj = #{lineSddj},</if>
  233. <if test='null != lineType'>line_type = #{lineType},</if>
  234. <if test='null != lineDj'>line_dj = #{lineDj},</if>
  235. <if test='null != lineKtrq'>line_ktrq = #{lineKtrq},</if>
  236. <if test='null != lineYylc'>line_yylc = #{lineYylc},</if>
  237. <if test='null != lineStartMarker'>line_start_marker = #{lineStartMarker},</if>
  238. <if test='null != lineEndMarker'>line_end_marker = #{lineEndMarker},</if>
  239. <if test='null != upStartMarker'>up_start_marker = #{upStartMarker},</if>
  240. <if test='null != upEndMarker'>up_end_marker = #{upEndMarker},</if>
  241. <if test='null != downStartMarker'>down_start_marker = #{downStartMarker},</if>
  242. <if test='null != downEndMarker'>down_end_marker = #{downEndMarker},</if>
  243. <if test='null != lineGdfs'>line_gdfs = #{lineGdfs},</if>
  244. <if test='null != lineXglx'>line_xglx = #{lineXglx},</if>
  245. <if test='null != lineQt'>line_qt = #{lineQt},</if>
  246. <if test='null != lineSjbh'>line_sjbh = #{lineSjbh},</if>
  247. <if test='null != orderNum'>order_num = #{orderNum},</if>
  248. <if test='null != status'>status = #{status},</if>
  249. <if test='null != delFlag'>del_flag = #{delFlag},</if>
  250. <if test='null != createBy'>create_by = #{createBy},</if>
  251. <if test='null != createTime'>create_time = #{createTime},</if>
  252. <if test='null != updateBy'>update_by = #{updateBy},</if>
  253. <if test='null != updateTime'>update_time = #{updateTime}</if>
  254. </set>
  255. WHERE line_id = #{lineId}
  256. </update>
  257. <select id="getInfo" resultMap="BaseResultMap">
  258. SELECT
  259. <include refid="Base_Column_List"/>
  260. FROM bus_line
  261. WHERE del_flag='0' and line_id = #{lineId}
  262. </select>
  263. <select id="getList" resultMap="BaseResultMap">
  264. SELECT
  265. <include refid="Base_Column_List"/>
  266. FROM bus_line
  267. <where>
  268. del_flag='0'
  269. <if test="deptId!=null and deptId!=''">
  270. and dept_id=#{deptId}
  271. </if>
  272. <if test="deptName!=null and deptName!=''">
  273. and dept_name=#{deptName}
  274. </if>
  275. <if test="lineName!=null and lineName!=''">
  276. and line_name=#{lineName}
  277. </if>
  278. <if test="lineSddj!=null and lineSddj!=''">
  279. and line_sddj=#{lineSddj}
  280. </if>
  281. <if test="lineType!=null and lineType!=''">
  282. and line_type=#{lineType}
  283. </if>
  284. <if test="lineDj!=null and lineDj!=''">
  285. and line_dj=#{lineDj}
  286. </if>
  287. <if test="lineKtrq!=null and lineKtrq!=''">
  288. and line_ktrq=#{lineKtrq}
  289. </if>
  290. <if test="lineYylc!=null and lineYylc!=''">
  291. and line_yylc=#{lineYylc}
  292. </if>
  293. <if test="lineStartMarker!=null and lineStartMarker!=''">
  294. and line_start_marker=#{lineStartMarker}
  295. </if>
  296. <if test="lineEndMarker!=null and lineEndMarker!=''">
  297. and line_end_marker=#{lineEndMarker}
  298. </if>
  299. <if test="upStartMarker!=null and upStartMarker!=''">
  300. and up_start_marker=#{upStartMarker}
  301. </if>
  302. <if test="upEndMarker!=null and upEndMarker!=''">
  303. and up_end_marker=#{upEndMarker}
  304. </if>
  305. <if test="downStartMarker!=null and downStartMarker!=''">
  306. and down_start_marker=#{downStartMarker}
  307. </if>
  308. <if test="downEndMarker!=null and downEndMarker!=''">
  309. and down_end_marker=#{downEndMarker}
  310. </if>
  311. <if test="lineGdfs!=null and lineGdfs!=''">
  312. and line_gdfs=#{lineGdfs}
  313. </if>
  314. <if test="lineXglx!=null and lineXglx!=''">
  315. and line_xglx=#{lineXglx}
  316. </if>
  317. <if test="lineQt!=null and lineQt!=''">
  318. and line_qt=#{lineQt}
  319. </if>
  320. <if test="lineSjbh!=null and lineSjbh!=''">
  321. and line_sjbh=#{lineSjbh}
  322. </if>
  323. <if test="orderNum!=null and orderNum!=''">
  324. and order_num=#{orderNum}
  325. </if>
  326. <if test="status!=null and status!=''">
  327. and status=#{status}
  328. </if>
  329. <if test="delFlag!=null and delFlag!=''">
  330. and del_flag=#{delFlag}
  331. </if>
  332. <if test="createBy!=null and createBy!=''">
  333. and create_by=#{createBy}
  334. </if>
  335. <if test="createTime!=null and createTime!=''">
  336. and create_time=#{createTime}
  337. </if>
  338. <if test="updateBy!=null and updateBy!=''">
  339. and update_by=#{updateBy}
  340. </if>
  341. <if test="updateTime!=null and updateTime!=''">
  342. and update_time=#{updateTime}
  343. </if>
  344. </where>
  345. </select>
  346. </mapper>