BusJcebFzswjfxcMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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.BusJcebFzswjfxcMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcebFzswjfxc">
  6. <result column="id" property="id"/>
  7. <result column="station_id" property="stationId"/>
  8. <result column="station_name" property="stationName"/>
  9. <result column="dept_station_id" property="deptStationId"/>
  10. <result column="pillar_code" property="pillarCode"/>
  11. <result column="xch" property="xch"/>
  12. <result column="xc_id" property="xcId"/>
  13. <result column="operation_date" property="operationDate"/>
  14. <result column="zxzlcz" property="zxzlcz"/>
  15. <result column="fxzlcz_xdzg" property="fxzlczXdzg"/>
  16. <result column="fxzlcz_xdqg" property="fxzlczXdqg"/>
  17. <result column="cxzlcz" property="cxzlcz"/>
  18. <result column="zxzdg" property="zxzdg"/>
  19. <result column="fxzdg_xdzg" property="fxzdgXdzg"/>
  20. <result column="fxzdg_xdqg" property="fxzdgXdqg"/>
  21. <result column="cxzdg" property="cxzdg"/>
  22. <result column="zxzxdzxdg" property="zxzxdzxdg"/>
  23. <result column="zxzxdzxlcz" property="zxzxdzxlcz"/>
  24. <result column="cxzxdzxdg" property="cxzxdzxdg"/>
  25. <result column="cxzxdzxlcz" property="cxzxdzxlcz"/>
  26. <result column="operator" property="operator"/>
  27. <result column="remark" property="remark"/>
  28. <result column="submit_state" property="submitState"/>
  29. <result column="del_flag" property="delFlag"/>
  30. <result column="create_by" property="createBy"/>
  31. <result column="create_time" property="createTime"/>
  32. <result column="update_by" property="updateBy"/>
  33. <result column="update_time" property="updateTime"/>
  34. </resultMap>
  35. <sql id="Base_Column_List">
  36. t.id,
  37. v.station_id,
  38. t.dept_station_id,
  39. v.station_name,
  40. t.pillar_code,
  41. t.xch,
  42. t.xc_id,
  43. t.operation_date,
  44. t.zxzlcz,
  45. t.fxzlcz_xdzg,
  46. t.fxzlcz_xdqg,
  47. t.cxzlcz,
  48. t.zxzdg,
  49. t.fxzdg_xdzg,
  50. t.fxzdg_xdqg,
  51. t.cxzdg,
  52. t.zxzxdzxdg,
  53. t.zxzxdzxlcz,
  54. t.cxzxdzxdg,
  55. t.cxzxdzxlcz,
  56. t.operator,
  57. t.remark,
  58. t.submit_state,
  59. t.del_flag,
  60. t.create_by,
  61. t.create_time,
  62. t.update_by,
  63. t.update_time
  64. </sql>
  65. <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcebFzswjfxc">
  66. <selectKey keyProperty="id" order="AFTER" resultType="Long">
  67. select @@IDENTITY as id
  68. </selectKey>
  69. INSERT INTO bus_jceb_fzswjfxc
  70. <trim prefix="(" suffix=")" suffixOverrides=",">
  71. <if test='null != deptStationId'>
  72. dept_station_id,
  73. </if>
  74. <if test='null != pillarCode'>
  75. pillar_code,
  76. </if>
  77. <if test='null != xch'>
  78. xch,
  79. </if>
  80. <if test='null != xcId'>
  81. xc_id,
  82. </if>
  83. <if test='null != operationDate'>
  84. operation_date,
  85. </if>
  86. <if test='null != zxzlcz'>
  87. zxzlcz,
  88. </if>
  89. <if test='null != fxzlczXdzg'>
  90. fxzlcz_xdzg,
  91. </if>
  92. <if test='null != fxzlczXdqg'>
  93. fxzlcz_xdqg,
  94. </if>
  95. <if test='null != cxzlcz'>
  96. cxzlcz,
  97. </if>
  98. <if test='null != zxzdg'>
  99. zxzdg,
  100. </if>
  101. <if test='null != fxzdgXdzg'>
  102. fxzdg_xdzg,
  103. </if>
  104. <if test='null != fxzdgXdqg'>
  105. fxzdg_xdqg,
  106. </if>
  107. <if test='null != cxzdg'>
  108. cxzdg,
  109. </if>
  110. <if test='null != zxzxdzxdg'>
  111. zxzxdzxdg,
  112. </if>
  113. <if test='null != zxzxdzxlcz'>
  114. zxzxdzxlcz,
  115. </if>
  116. <if test='null != cxzxdzxdg'>
  117. cxzxdzxdg,
  118. </if>
  119. <if test='null != cxzxdzxlcz'>
  120. cxzxdzxlcz,
  121. </if>
  122. <if test='null != operator'>
  123. operator,
  124. </if>
  125. <if test='null != remark'>
  126. remark,
  127. </if>
  128. <if test='null != submitState'>
  129. submit_state,
  130. </if>
  131. <if test='null != delFlag'>
  132. del_flag,
  133. </if>
  134. <if test='null != createBy'>
  135. create_by,
  136. </if>
  137. <if test='null != createTime'>
  138. create_time,
  139. </if>
  140. <if test='null != updateBy'>
  141. update_by,
  142. </if>
  143. <if test='null != updateTime'>
  144. update_time
  145. </if>
  146. </trim>
  147. <trim prefix="values (" suffix=")" suffixOverrides=",">
  148. <if test='null != deptStationId'>
  149. #{deptStationId},
  150. </if>
  151. <if test='null != pillarCode'>
  152. #{pillarCode},
  153. </if>
  154. <if test='null != xch'>
  155. #{xch},
  156. </if>
  157. <if test='null != xcId'>
  158. #{xcId},
  159. </if>
  160. <if test='null != operationDate'>
  161. #{operationDate},
  162. </if>
  163. <if test='null != zxzlcz'>
  164. #{zxzlcz},
  165. </if>
  166. <if test='null != fxzlczXdzg'>
  167. #{fxzlczXdzg},
  168. </if>
  169. <if test='null != fxzlczXdqg'>
  170. #{fxzlczXdqg},
  171. </if>
  172. <if test='null != cxzlcz'>
  173. #{cxzlcz},
  174. </if>
  175. <if test='null != zxzdg'>
  176. #{zxzdg},
  177. </if>
  178. <if test='null != fxzdgXdzg'>
  179. #{fxzdgXdzg},
  180. </if>
  181. <if test='null != fxzdgXdqg'>
  182. #{fxzdgXdqg},
  183. </if>
  184. <if test='null != cxzdg'>
  185. #{cxzdg},
  186. </if>
  187. <if test='null != zxzxdzxdg'>
  188. #{zxzxdzxdg},
  189. </if>
  190. <if test='null != zxzxdzxlcz'>
  191. #{zxzxdzxlcz},
  192. </if>
  193. <if test='null != cxzxdzxdg'>
  194. #{cxzxdzxdg},
  195. </if>
  196. <if test='null != cxzxdzxlcz'>
  197. #{cxzxdzxlcz},
  198. </if>
  199. <if test='null != operator'>
  200. #{operator},
  201. </if>
  202. <if test='null != remark'>
  203. #{remark},
  204. </if>
  205. <if test='null != submitState'>
  206. #{submitState},
  207. </if>
  208. <if test='null != delFlag'>
  209. #{delFlag},
  210. </if>
  211. <if test='null != createBy'>
  212. #{createBy},
  213. </if>
  214. <if test='null != createTime'>
  215. #{createTime},
  216. </if>
  217. <if test='null != updateBy'>
  218. #{updateBy},
  219. </if>
  220. <if test='null != updateTime'>
  221. #{updateTime}
  222. </if>
  223. </trim>
  224. </insert>
  225. <delete id="delete">
  226. UPDATE bus_jceb_fzswjfxc
  227. set del_flag='1'
  228. WHERE id = #{id}
  229. </delete>
  230. <update id="update" parameterType="com.railway.business.catenary.domain.BusJcebFzswjfxc">
  231. UPDATE bus_jceb_fzswjfxc
  232. <set>
  233. <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
  234. <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
  235. <if test='null != xch'>xch = #{xch},</if>
  236. <if test='null != xcId'>xc_id = #{xcId},</if>
  237. <if test='null != operationDate'>operation_date = #{operationDate},</if>
  238. <if test='null != zxzlcz'>zxzlcz = #{zxzlcz},</if>
  239. <if test='null != fxzlczXdzg'>fxzlcz_xdzg = #{fxzlczXdzg},</if>
  240. <if test='null != fxzlczXdqg'>fxzlcz_xdqg = #{fxzlczXdqg},</if>
  241. <if test='null != cxzlcz'>cxzlcz = #{cxzlcz},</if>
  242. <if test='null != zxzdg'>zxzdg = #{zxzdg},</if>
  243. <if test='null != fxzdgXdzg'>fxzdg_xdzg = #{fxzdgXdzg},</if>
  244. <if test='null != fxzdgXdqg'>fxzdg_xdqg = #{fxzdgXdqg},</if>
  245. <if test='null != cxzdg'>cxzdg = #{cxzdg},</if>
  246. <if test='null != zxzxdzxdg'>zxzxdzxdg = #{zxzxdzxdg},</if>
  247. <if test='null != zxzxdzxlcz'>zxzxdzxlcz = #{zxzxdzxlcz},</if>
  248. <if test='null != cxzxdzxdg'>cxzxdzxdg = #{cxzxdzxdg},</if>
  249. <if test='null != cxzxdzxlcz'>cxzxdzxlcz = #{cxzxdzxlcz},</if>
  250. <if test='null != operator'>operator = #{operator},</if>
  251. <if test='null != remark'>remark = #{remark},</if>
  252. <if test='null != submitState'>submit_state = #{submitState},</if>
  253. <if test='null != delFlag'>del_flag = #{delFlag},</if>
  254. <if test='null != createBy'>create_by = #{createBy},</if>
  255. <if test='null != createTime'>create_time = #{createTime},</if>
  256. <if test='null != updateBy'>update_by = #{updateBy},</if>
  257. <if test='null != updateTime'>update_time = #{updateTime}</if>
  258. </set>
  259. WHERE id = #{id}
  260. </update>
  261. <select id="getInfo" resultMap="BaseResultMap">
  262. SELECT
  263. <include refid="Base_Column_List"/>
  264. FROM bus_jceb_fzswjfxc t
  265. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  266. WHERE t.del_flag='0' and t.id = #{id}
  267. </select>
  268. <select id="getList" resultMap="BaseResultMap">
  269. SELECT
  270. <include refid="Base_Column_List"/>
  271. FROM bus_jceb_fzswjfxc t
  272. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  273. <where>
  274. t.del_flag='0'
  275. <if test="deptId!=null and deptId!=''">
  276. and v.dept_id=#{deptId}
  277. </if>
  278. <if test="stationId!=null and stationId!=''">
  279. and v.station_id=#{stationId}
  280. </if>
  281. <if test="stationIds!=null and stationIds.length > 0">
  282. and v.station_id in
  283. <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
  284. #{stationId}
  285. </foreach>
  286. </if>
  287. <if test="pillarCode!=null and pillarCode!=''">
  288. and t.pillar_code=#{pillarCode}
  289. </if>
  290. <if test="xch!=null and xch!=''">
  291. and t.xch=#{xch}
  292. </if>
  293. <if test="xcId!=null and xcId!=''">
  294. and t.xc_id=#{xcId}
  295. </if>
  296. <if test="operationDate!=null and operationDate!=''">
  297. and t.operation_date=#{operationDate}
  298. </if>
  299. <if test="zxzlcz!=null and zxzlcz!=''">
  300. and t.zxzlcz=#{zxzlcz}
  301. </if>
  302. <if test="fxzlczXdzg!=null and fxzlczXdzg!=''">
  303. and t.fxzlcz_xdzg=#{fxzlczXdzg}
  304. </if>
  305. <if test="fxzlczXdqg!=null and fxzlczXdqg!=''">
  306. and t.fxzlcz_xdqg=#{fxzlczXdqg}
  307. </if>
  308. <if test="cxzlcz!=null and cxzlcz!=''">
  309. and t.cxzlcz=#{cxzlcz}
  310. </if>
  311. <if test="zxzdg!=null and zxzdg!=''">
  312. and t.zxzdg=#{zxzdg}
  313. </if>
  314. <if test="fxzdgXdzg!=null and fxzdgXdzg!=''">
  315. and t.fxzdg_xdzg=#{fxzdgXdzg}
  316. </if>
  317. <if test="fxzdgXdqg!=null and fxzdgXdqg!=''">
  318. and t.fxzdg_xdqg=#{fxzdgXdqg}
  319. </if>
  320. <if test="cxzdg!=null and cxzdg!=''">
  321. and t.cxzdg=#{cxzdg}
  322. </if>
  323. <if test="zxzxdzxdg!=null and zxzxdzxdg!=''">
  324. and t.zxzxdzxdg=#{zxzxdzxdg}
  325. </if>
  326. <if test="zxzxdzxlcz!=null and zxzxdzxlcz!=''">
  327. and t.zxzxdzxlcz=#{zxzxdzxlcz}
  328. </if>
  329. <if test="cxzxdzxdg!=null and cxzxdzxdg!=''">
  330. and t.cxzxdzxdg=#{cxzxdzxdg}
  331. </if>
  332. <if test="cxzxdzxlcz!=null and cxzxdzxlcz!=''">
  333. and t.cxzxdzxlcz=#{cxzxdzxlcz}
  334. </if>
  335. <if test="operator!=null and operator!=''">
  336. and t.operator like concat('%', #{operator}, '%')
  337. </if>
  338. <if test="submitState!=null and submitState!=''">
  339. and t.submit_state <![CDATA[ >= ]]> #{submitState}
  340. </if>
  341. <if test="createBy!=null and createBy!=''">
  342. and t.create_by=#{createBy}
  343. </if>
  344. <if test="createTime!=null">
  345. and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
  346. </if>
  347. </where>
  348. <if test="orderBy!=null and orderBy!=''">
  349. order by t.${orderBy}
  350. </if>
  351. <if test="isAsc!=null and isAsc!=''">
  352. <if test="isAsc == '1'.toString()">
  353. asc
  354. </if>
  355. <if test="isAsc == '0'.toString()">
  356. desc
  357. </if>
  358. </if>
  359. </select>
  360. <select id="getJcebList" resultMap="BaseResultMap">
  361. SELECT
  362. <include refid="Base_Column_List"/>
  363. FROM bus_jceb_fzswjfxc t
  364. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  365. <where>
  366. t.del_flag='0'
  367. <if test="submitState!=null and submitState!=''">
  368. and t.submit_state <![CDATA[ >= ]]> #{submitState}
  369. </if>
  370. <if test="deptId!=null and deptId!=''">
  371. and v.dept_id=#{deptId}
  372. </if>
  373. <if test="stationId!=null and stationId!=''">
  374. and v.station_id=#{stationId}
  375. </if>
  376. <if test="stationIds!=null and stationIds.length > 0">
  377. and v.station_id in
  378. <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
  379. #{stationId}
  380. </foreach>
  381. </if>
  382. <if test="pillarCode!=null and pillarCode!=''">
  383. and t.pillar_code=#{pillarCode}
  384. </if>
  385. <if test="operator!=null and operator!=''">
  386. and t.operator like concat('%', #{operator}, '%')
  387. </if>
  388. <if test="createBy!=null and createBy!=''">
  389. and t.create_by=#{createBy}
  390. </if>
  391. </where>
  392. </select>
  393. <resultMap id="JcebResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
  394. <result column="id" property="id"/>
  395. <result column="dept_name" property="deptName"/>
  396. <result column="station_name" property="stationName"/>
  397. <result column="operation_date" property="operationDate"/>
  398. <result column="operator" property="operator"/>
  399. <result column="jcebType" property="jcebType"/>
  400. </resultMap>
  401. <select id="getListByType" resultMap="JcebResultMap">
  402. SELECT t.id, v.dept_name, v.station_name, t.operation_date, t.operator, #{jcebType} as jcebType,
  403. #{jcebTypeText} as jcebTypeText
  404. FROM bus_jceb_fzswjfxc t
  405. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  406. <where>
  407. t.del_flag='0'
  408. <if test="submitState!=null and submitState!=''">
  409. and t.submit_state <![CDATA[ >= ]]> #{submitState}
  410. </if>
  411. <if test="deptId!=null and deptId!=''">
  412. and v.dept_id=#{deptId}
  413. </if>
  414. <if test="stationId!=null and stationId!=''">
  415. and v.station_id=#{stationId}
  416. </if>
  417. <if test="stationIds!=null and stationIds.length > 0">
  418. and v.station_id in
  419. <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
  420. #{stationId}
  421. </foreach>
  422. </if>
  423. <if test="pillarCode!=null and pillarCode!=''">
  424. and t.pillar_code=#{pillarCode}
  425. </if>
  426. <if test="operator!=null and operator!=''">
  427. and t.operator like concat('%', #{operator}, '%')
  428. </if>
  429. <if test="createBy!=null and createBy!=''">
  430. and t.create_by=#{createBy}
  431. </if>
  432. </where>
  433. </select>
  434. <resultMap id="JcebCountResultMap" type="com.railway.business.catenary.domain.vo.JcebCountVo">
  435. <result column="c" property="count"/>
  436. <result column="operation_date" property="operationDate"/>
  437. </resultMap>
  438. <select id="getCountByType" resultMap="JcebCountResultMap">
  439. SELECT count(*) c, max(t.operation_date) as operation_date
  440. FROM bus_jceb_fzswjfxc t
  441. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  442. <where>
  443. t.del_flag='0'
  444. <if test="submitState!=null and submitState!=''">
  445. and t.submit_state <![CDATA[ >= ]]> #{submitState}
  446. </if>
  447. <if test="deptId!=null and deptId!=''">
  448. and v.dept_id=#{deptId}
  449. </if>
  450. <if test="stationId!=null and stationId!=''">
  451. and v.station_id=#{stationId}
  452. </if>
  453. <if test="pillarCode!=null and pillarCode!=''">
  454. and t.pillar_code=#{pillarCode}
  455. </if>
  456. <if test="operator!=null and operator!=''">
  457. and t.operator like concat('%', #{operator}, '%')
  458. </if>
  459. <if test="createBy!=null and createBy!=''">
  460. and t.create_by=#{createBy}
  461. </if>
  462. </where>
  463. </select>
  464. </mapper>