BusZzdzxxMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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.baseinfo.mapper.BusZzdzxxMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.baseinfo.domain.BusZzdzxx">
  6. <result column="id" property="id"/>
  7. <result column="dept_id" property="deptId"/>
  8. <result column="dept_name" property="deptName"/>
  9. <result column="line_id" property="lineId"/>
  10. <result column="line_name" property="lineName"/>
  11. <result column="station_id" property="stationId"/>
  12. <result column="station_name" property="stationName"/>
  13. <result column="dept_station_id" property="deptStationId"/>
  14. <result column="xingbie" property="xingbie"/>
  15. <result column="xingbie_text" property="xingbieText"/>
  16. <result column="pillar_code" property="pillarCode"/>
  17. <result column="station_track" property="stationTrack"/>
  18. <result column="gxms" property="gxms"/>
  19. <result column="jbdydm" property="jbdydm"/>
  20. <result column="sd" property="sd"/>
  21. <result column="marker" property="marker"/>
  22. <result column="jcxgmdh" property="jcxgmdh"/>
  23. <result column="jcxgazth" property="jcxgazth"/>
  24. <result column="fjxgazth" property="fjxgazth"/>
  25. <result column="zzlx" property="zzlx"/>
  26. <result column="zzxh" property="zzxh"/>
  27. <result column="zzyt" property="zzyt"/>
  28. <result column="cz" property="cz"/>
  29. <result column="zxqwqn" property="zxqwqn"/>
  30. <result column="kj" property="kj"/>
  31. <result column="qxbj" property="qxbj"/>
  32. <result column="dg" property="dg"/>
  33. <result column="lcz" property="lcz"/>
  34. <result column="gmbg_scz" property="gmbgScz"/>
  35. <result column="gmbg_bzz" property="gmbgBzz"/>
  36. <result column="cmxj_scz" property="cmxjScz"/>
  37. <result column="cmxj_bzz" property="cmxjBzz"/>
  38. <result column="wgcg_scz" property="wgcgScz"/>
  39. <result column="wgcg_bzz" property="wgcgBzz"/>
  40. <result column="zzzt" property="zzzt"/>
  41. <result column="sccj" property="sccj"/>
  42. <result column="tyrq" property="tyrq"/>
  43. <result column="ccrq" property="ccrq"/>
  44. <result column="sjsm" property="sjsm"/>
  45. <result column="zzjczt" property="zzjczt"/>
  46. <result column="jclx" property="jclx"/>
  47. <result column="dxzt" property="dxzt"/>
  48. <result column="jxzq" property="jxzq"/>
  49. <result column="sf_sfpwjjdm" property="sfSfpwjjdm"/>
  50. <result column="sf_bczz" property="sfBczz"/>
  51. <result column="sf_fdjyq" property="sfFdjyq"/>
  52. <result column="sf_fxjyq" property="sfFxjyq"/>
  53. <result column="sf_jcxc" property="sfJcxc"/>
  54. <result column="sf_lxwjcxc" property="sfLxwjcxc"/>
  55. <result column="sf_sxwjcxc" property="sfSxwjcxc"/>
  56. <result column="sf_mdgjzfx" property="sfMdgjzfx"/>
  57. <result column="sf_hkd" property="sfHkd"/>
  58. <result column="sf_dlj" property="sfDlj"/>
  59. <result column="sf_glkg" property="sfGlkg"/>
  60. <result column="sf_blq" property="sfBlq"/>
  61. <result column="sf_dcgyzz" property="sfDcgyzz"/>
  62. <result column="sf_xcbzp" property="sfXcbzp"/>
  63. <result column="sf_jdzz" property="sfJdzz"/>
  64. <result column="sf_xsx" property="sfXsx"/>
  65. <result column="sf_hlx" property="sfHlx"/>
  66. <result column="sf_gwx" property="sfGwx"/>
  67. <result column="sf_gdx" property="sfGdx"/>
  68. <result column="sf_pwx" property="sfPwx"/>
  69. <result column="sf_sfx" property="sfSfx"/>
  70. <result column="sf_jqx" property="sfJqx"/>
  71. <result column="sf_blx" property="sfBlx"/>
  72. <result column="sf_lx" property="sfLx"/>
  73. <result column="sf_zm" property="sfZm"/>
  74. <result column="qt" property="qt"/>
  75. <result column="fj" property="fj"/>
  76. <result column="sl" property="sl"/>
  77. <result column="dw" property="dw"/>
  78. <result column="sjbh" property="sjbh"/>
  79. <result column="del_flag" property="delFlag"/>
  80. <result column="create_by" property="createBy"/>
  81. <result column="create_time" property="createTime"/>
  82. <result column="update_by" property="updateBy"/>
  83. <result column="update_time" property="updateTime"/>
  84. </resultMap>
  85. <sql id="Base_Column_List">
  86. t.id,
  87. v.dept_id,
  88. v.dept_name,
  89. v.line_id,
  90. v.line_name,
  91. v.station_name as station_name,
  92. v.station_id,
  93. t.dept_station_id,
  94. t.xingbie,
  95. t.pillar_code,
  96. t.station_track,
  97. t.sd,
  98. t.marker,
  99. t.jcxgmdh,
  100. t.zzlx,
  101. t.zzxh,
  102. t.zzyt,
  103. t.cz,
  104. t.zxqwqn,
  105. t.zzzt,
  106. t.tyrq,
  107. t.ccrq,
  108. t.jxzq,
  109. t.sjbh,
  110. t.del_flag,
  111. t.create_by,
  112. t.create_time,
  113. t.update_by,
  114. t.update_time
  115. </sql>
  116. <insert id="insert" parameterType="com.railway.business.baseinfo.domain.BusZzdzxx">
  117. INSERT INTO base_pillar
  118. <trim prefix="(" suffix=")" suffixOverrides=",">
  119. <if test='null != deptStationId'>
  120. dept_station_id,
  121. </if>
  122. <if test='null != xingbie'>
  123. xingbie,
  124. </if>
  125. <if test='null != pillarCode'>
  126. pillar_code,
  127. </if>
  128. <if test='null != stationTrack'>
  129. station_track,
  130. </if>
  131. <if test='null != sd'>
  132. sd,
  133. </if>
  134. <if test='null != marker'>
  135. marker,
  136. </if>
  137. <if test='null != jcxgmdh'>
  138. jcxgmdh,
  139. </if>
  140. <if test='null != zzlx'>
  141. zzlx,
  142. </if>
  143. <if test='null != zzxh'>
  144. zzxh,
  145. </if>
  146. <if test='null != zzyt'>
  147. zzyt,
  148. </if>
  149. <if test='null != cz'>
  150. cz,
  151. </if>
  152. <if test='null != zxqwqn'>
  153. zxqwqn,
  154. </if>
  155. <if test='null != zzzt'>
  156. zzzt,
  157. </if>
  158. <if test='null != tyrq'>
  159. tyrq,
  160. </if>
  161. <if test='null != ccrq'>
  162. ccrq,
  163. </if>
  164. <if test='null != jxzq'>
  165. jxzq,
  166. </if>
  167. <if test='null != sjbh'>
  168. sjbh,
  169. </if>
  170. <if test='null != delFlag'>
  171. del_flag,
  172. </if>
  173. <if test='null != createBy'>
  174. create_by,
  175. </if>
  176. <if test='null != createTime'>
  177. create_time,
  178. </if>
  179. </trim>
  180. <trim prefix="values (" suffix=")" suffixOverrides=",">
  181. <if test='null != deptStationId'>
  182. #{deptStationId},
  183. </if>
  184. <if test='null != xingbie'>
  185. #{xingbie},
  186. </if>
  187. <if test='null != pillarCode'>
  188. #{pillarCode},
  189. </if>
  190. <if test='null != stationTrack'>
  191. #{stationTrack},
  192. </if>
  193. <if test='null != sd'>
  194. #{sd},
  195. </if>
  196. <if test='null != marker'>
  197. #{marker},
  198. </if>
  199. <if test='null != jcxgmdh'>
  200. #{jcxgmdh},
  201. </if>
  202. <if test='null != zzlx'>
  203. #{zzlx},
  204. </if>
  205. <if test='null != zzxh'>
  206. #{zzxh},
  207. </if>
  208. <if test='null != zzyt'>
  209. #{zzyt},
  210. </if>
  211. <if test='null != cz'>
  212. #{cz},
  213. </if>
  214. <if test='null != zxqwqn'>
  215. #{zxqwqn},
  216. </if>
  217. <if test='null != zzzt'>
  218. #{zzzt},
  219. </if>
  220. <if test='null != tyrq'>
  221. #{tyrq},
  222. </if>
  223. <if test='null != ccrq'>
  224. #{ccrq},
  225. </if>
  226. <if test='null != jxzq'>
  227. #{jxzq},
  228. </if>
  229. <if test='null != sjbh'>
  230. #{sjbh},
  231. </if>
  232. <if test='null != delFlag'>
  233. #{delFlag},
  234. </if>
  235. <if test='null != createBy'>
  236. #{createBy},
  237. </if>
  238. <if test='null != createTime'>
  239. #{createTime},
  240. </if>
  241. </trim>
  242. </insert>
  243. <delete id="delete">
  244. UPDATE base_pillar
  245. set del_flag='1'
  246. WHERE id = #{id}
  247. </delete>
  248. <update id="update" parameterType="com.railway.business.baseinfo.domain.BusZzdzxx">
  249. UPDATE base_pillar
  250. <set>
  251. <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
  252. <if test='null != xingbie'>xingbie = #{xingbie},</if>
  253. <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
  254. <if test='null != stationTrack'>station_track = #{stationTrack},</if>
  255. <if test='null != sd'>sd = #{sd},</if>
  256. <if test='null != marker'>marker = #{marker},</if>
  257. <if test='null != jcxgmdh'>jcxgmdh = #{jcxgmdh},</if>
  258. <if test='null != zzlx'>zzlx = #{zzlx},</if>
  259. <if test='null != zzxh'>zzxh = #{zzxh},</if>
  260. <if test='null != zzyt'>zzyt = #{zzyt},</if>
  261. <if test='null != cz'>cz = #{cz},</if>
  262. <if test='null != zxqwqn'>zxqwqn = #{zxqwqn},</if>
  263. <if test='null != zzzt'>zzzt = #{zzzt},</if>
  264. <if test='null != sccj'>sccj = #{sccj},</if>
  265. <if test='null != tyrq'>tyrq = #{tyrq},</if>
  266. <if test='null != ccrq'>ccrq = #{ccrq},</if>
  267. <if test='null != jxzq'>jxzq = #{jxzq},</if>
  268. <if test='null != sjbh'>sjbh = #{sjbh},</if>
  269. <if test='null != delFlag'>del_flag = #{delFlag},</if>
  270. <if test='null != updateBy'>update_by = #{updateBy},</if>
  271. <if test='null != updateTime'>update_time = #{updateTime}</if>
  272. </set>
  273. WHERE id = #{id}
  274. </update>
  275. <select id="getInfo" resultMap="BaseResultMap">
  276. SELECT
  277. <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
  278. FROM base_pillar t
  279. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  280. LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
  281. WHERE t.del_flag='0' and t.id = #{id}
  282. and t.marker between v.up_start_marker and v.up_end_marker
  283. </select>
  284. <select id="getList" resultMap="BaseResultMap">
  285. SELECT
  286. <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
  287. FROM base_pillar t
  288. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  289. LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
  290. <where>
  291. t.del_flag='0'
  292. and t.marker between v.up_start_marker and v.up_end_marker
  293. <if test="stationId!=null and stationId!=''">
  294. and v.station_id=#{stationId}
  295. </if>
  296. <if test="deptId!=null and deptId!=''">
  297. and v.dept_id=#{deptId}
  298. </if>
  299. <if test="lineId!=null and lineId!=''">
  300. and v.line_id=#{lineId}
  301. </if>
  302. <if test="xingbie!=null and xingbie!=''">
  303. and t.xingbie=#{xingbie}
  304. </if>
  305. <if test="pillarCode!=null and pillarCode!=''">
  306. and t.pillar_code=#{pillarCode}
  307. </if>
  308. <if test="stationTrack!=null and stationTrack!=''">
  309. and t.station_track=#{stationTrack}
  310. </if>
  311. <if test="sd!=null and sd!=''">
  312. and t.sd=#{sd}
  313. </if>
  314. <if test="marker!=null and marker!=''">
  315. and t.marker=#{marker}
  316. </if>
  317. <if test="jcxgmdh!=null and jcxgmdh!=''">
  318. and t.jcxgmdh=#{jcxgmdh}
  319. </if>
  320. <if test="zzlx!=null and zzlx!=''">
  321. and t.zzlx=#{zzlx}
  322. </if>
  323. <if test="zzxh!=null and zzxh!=''">
  324. and t.zzxh=#{zzxh}
  325. </if>
  326. <if test="zzyt!=null and zzyt!=''">
  327. and t.zzyt=#{zzyt}
  328. </if>
  329. <if test="cz!=null and cz!=''">
  330. and t.cz=#{cz}
  331. </if>
  332. <if test="zxqwqn!=null and zxqwqn!=''">
  333. and t.zxqwqn=#{zxqwqn}
  334. </if>
  335. <if test="zzzt!=null and zzzt!=''">
  336. and t.zzzt=#{zzzt}
  337. </if>
  338. <if test="tyrq!=null and tyrq!=''">
  339. and t.tyrq=#{tyrq}
  340. </if>
  341. <if test="ccrq!=null and ccrq!=''">
  342. and t.ccrq=#{ccrq}
  343. </if>
  344. <if test="jxzq!=null and jxzq!=''">
  345. and t.jxzq=#{jxzq}
  346. </if>
  347. <if test="sjbh!=null and sjbh!=''">
  348. and t.sjbh=#{sjbh}
  349. </if>
  350. <if test="delFlag!=null and delFlag!=''">
  351. and t.del_flag=#{delFlag}
  352. </if>
  353. <if test="createBy!=null and createBy!=''">
  354. and t.create_by=#{createBy}
  355. </if>
  356. <if test="createTime!=null and createTime!=''">
  357. and t.create_time=#{createTime}
  358. </if>
  359. <if test="updateBy!=null and updateBy!=''">
  360. and t.update_by=#{updateBy}
  361. </if>
  362. <if test="updateTime!=null and updateTime!=''">
  363. and t.update_time=#{updateTime}
  364. </if>
  365. </where>
  366. </select>
  367. <select id="smartQuery" resultMap="BaseResultMap">
  368. SELECT
  369. <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
  370. FROM base_pillar t
  371. left join v_station v on t.dept_station_id = v.dept_station_id
  372. LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
  373. <where>
  374. t.del_flag='0'
  375. and t.marker between v.up_start_marker and v.up_end_marker
  376. <if test="stationId!=null and stationId!=''">
  377. and v.station_id=#{stationId}
  378. </if>
  379. <if test="deptId!=null and deptId!=''">
  380. and v.dept_id=#{deptId}
  381. </if>
  382. <if test="lineId!=null and lineId!=''">
  383. and v.line_id=#{lineId}
  384. </if>
  385. <if test="xingbie!=null and xingbie!=''">
  386. and t.xingbie=#{xingbie}
  387. </if>
  388. <if test="pillarCode!=null and pillarCode!=''">
  389. and t.pillar_code=#{pillarCode}
  390. </if>
  391. <if test="marker!=null and marker!=''">
  392. and abs(t.marker - ${marker})= (
  393. select min(abs(t.marker - ${marker})) FROM base_pillar t
  394. left join v_station v on t.dept_station_id = v.dept_station_id
  395. where 1=1
  396. and t.marker between v.up_start_marker and v.up_end_marker
  397. <if test="stationId!=null and stationId!=''">
  398. and v.station_id=#{stationId}
  399. </if>
  400. <if test="deptId!=null and deptId!=''">
  401. and v.dept_id=#{deptId}
  402. </if>
  403. <if test="lineId!=null and lineId!=''">
  404. and v.line_id=#{lineId}
  405. </if>
  406. <if test="xingbie!=null and xingbie!=''">
  407. and t.xingbie=#{xingbie}
  408. </if>
  409. )
  410. </if>
  411. </where>
  412. </select>
  413. </mapper>