BusJcbBlqMapper.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  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.BusJcbBlqMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcbBlq">
  6. <result column="id" property="id"/>
  7. <result column="blq_id" property="blqId"/>
  8. <result column="dept_id" property="deptId"/>
  9. <result column="dept_name" property="deptName"/>
  10. <result column="station_id" property="stationId"/>
  11. <result column="station_name" property="stationName"/>
  12. <result column="dept_station_id" property="deptStationId"/>
  13. <result column="pillar_code" property="pillarCode"/>
  14. <result column="temperature" property="temperature"/>
  15. <result column="check_date" property="checkDate"/>
  16. <result column="pic_url" property="picUrl"/>
  17. <result column="tjwz_blqtjazsp" property="tjwzBlqtjazsp"/>
  18. <result column="tjwz_blqtjazsp_desc" property="tjwzBlqtjazspDesc"/>
  19. <result column="tjwz_wxs" property="tjwzWxs"/>
  20. <result column="tjwz_wxs_desc" property="tjwzWxsDesc"/>
  21. <result column="tjwz_gblsljjg" property="tjwzGblsljjg"/>
  22. <result column="tjwz_gblsljjg_desc" property="tjwzGblsljjgDesc"/>
  23. <result column="blqjyz_blqjzcjyzcszzt" property="blqjyzBlqjzcjyzcszzt"/>
  24. <result column="blqjyz_blqjzcjyzcszzt_desc" property="blqjyzBlqjzcjyzcszztDesc"/>
  25. <result column="blqjyz_bmqjazlg" property="blqjyzBmqjazlg"/>
  26. <result column="blqjyz_bmqjazlg_desc" property="blqjyzBmqjazlgDesc"/>
  27. <result column="blqyx_blqyxwssdg" property="blqyxBlqyxwssdg"/>
  28. <result column="blqyx_blqyxwssdg_desc" property="blqyxBlqyxwssdgDesc"/>
  29. <result column="blqyx_gycyxdjdtdtzxjl" property="blqyxGycyxdjdtdtzxjl"/>
  30. <result column="tlq_ztlhwpslh" property="tlqZtlhwpslh"/>
  31. <result column="tlq_ztlhwpslh_desc" property="tlqZtlhwpslhDesc"/>
  32. <result column="jsq_dzjs" property="jsqDzjs"/>
  33. <result column="blqjdzt_jddz" property="blqjdztJddz"/>
  34. <result column="sbzt" property="sbzt"/>
  35. <result column="sbzt_desc" property="sbztDesc"/>
  36. <result column="check_user" property="checkUser"/>
  37. <result column="confirm_user" property="confirmUser"/>
  38. <result column="czwt" property="czwt"/>
  39. <result column="create_by" property="createBy"/>
  40. <result column="create_time" property="createTime"/>
  41. <result column="update_by" property="updateBy"/>
  42. <result column="update_time" property="updateTime"/>
  43. <result column="submit_state" property="submitState"/>
  44. <result column="del_flag" property="delFlag"/>
  45. <result column="sccj" property="sccj"/>
  46. </resultMap>
  47. <sql id="Base_Column_List">
  48. t.id,
  49. t.blq_id,
  50. v.dept_id,
  51. v.dept_name,
  52. v.station_name,
  53. v.station_id,
  54. t.dept_station_id,
  55. t.pillar_code,
  56. t.temperature,
  57. t.check_date,
  58. t.pic_url,
  59. t.tjwz_blqtjazsp,
  60. t.tjwz_blqtjazsp_desc,
  61. t.tjwz_wxs,
  62. t.tjwz_wxs_desc,
  63. t.tjwz_gblsljjg,
  64. t.tjwz_gblsljjg_desc,
  65. t.blqjyz_blqjzcjyzcszzt,
  66. t.blqjyz_blqjzcjyzcszzt_desc,
  67. t.blqjyz_bmqjazlg,
  68. t.blqjyz_bmqjazlg_desc,
  69. t.blqyx_blqyxwssdg,
  70. t.blqyx_blqyxwssdg_desc,
  71. t.blqyx_gycyxdjdtdtzxjl,
  72. t.tlq_ztlhwpslh,
  73. t.tlq_ztlhwpslh_desc,
  74. t.jsq_dzjs,
  75. t.blqjdzt_jddz,
  76. t.sbzt,
  77. t.sbzt_desc,
  78. t.check_user,
  79. t.confirm_user,
  80. t.czwt,
  81. t.create_by,
  82. t.create_time,
  83. t.update_by,
  84. t.update_time,
  85. t.submit_state,
  86. t.del_flag
  87. </sql>
  88. <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcbBlq">
  89. <selectKey keyProperty="id" order="AFTER" resultType="Long">
  90. select @@IDENTITY as id
  91. </selectKey>
  92. INSERT INTO bus_jcb_blq
  93. <trim prefix="(" suffix=")" suffixOverrides=",">
  94. <if test='null != blqId'>
  95. blq_id,
  96. </if>
  97. <if test='null != deptStationId'>
  98. dept_station_id,
  99. </if>
  100. <if test='null != pillarCode'>
  101. pillar_code,
  102. </if>
  103. <if test='null != temperature'>
  104. temperature,
  105. </if>
  106. <if test='null != checkDate'>
  107. check_date,
  108. </if>
  109. <if test='null != picUrl'>
  110. pic_url,
  111. </if>
  112. <if test='null != tjwzBlqtjazsp'>
  113. tjwz_blqtjazsp,
  114. </if>
  115. <if test='null != tjwzBlqtjazspDesc'>
  116. tjwz_blqtjazsp_desc,
  117. </if>
  118. <if test='null != tjwzWxs'>
  119. tjwz_wxs,
  120. </if>
  121. <if test='null != tjwzWxsDesc'>
  122. tjwz_wxs_desc,
  123. </if>
  124. <if test='null != tjwzGblsljjg'>
  125. tjwz_gblsljjg,
  126. </if>
  127. <if test='null != tjwzGblsljjgDesc'>
  128. tjwz_gblsljjg_desc,
  129. </if>
  130. <if test='null != blqjyzBlqjzcjyzcszzt'>
  131. blqjyz_blqjzcjyzcszzt,
  132. </if>
  133. <if test='null != blqjyzBlqjzcjyzcszztDesc'>
  134. blqjyz_blqjzcjyzcszzt_desc,
  135. </if>
  136. <if test='null != blqjyzBmqjazlg'>
  137. blqjyz_bmqjazlg,
  138. </if>
  139. <if test='null != blqjyzBmqjazlgDesc'>
  140. blqjyz_bmqjazlg_desc,
  141. </if>
  142. <if test='null != blqyxBlqyxwssdg'>
  143. blqyx_blqyxwssdg,
  144. </if>
  145. <if test='null != blqyxBlqyxwssdgDesc'>
  146. blqyx_blqyxwssdg_desc,
  147. </if>
  148. <if test='null != blqyxGycyxdjdtdtzxjl'>
  149. blqyx_gycyxdjdtdtzxjl,
  150. </if>
  151. <if test='null != tlqZtlhwpslh'>
  152. tlq_ztlhwpslh,
  153. </if>
  154. <if test='null != tlqZtlhwpslhDesc'>
  155. tlq_ztlhwpslh_desc,
  156. </if>
  157. <if test='null != jsqDzjs'>
  158. jsq_dzjs,
  159. </if>
  160. <if test='null != blqjdztJddz'>
  161. blqjdzt_jddz,
  162. </if>
  163. <if test='null != sbzt'>
  164. sbzt,
  165. </if>
  166. <if test='null != sbztDesc'>
  167. sbzt_desc,
  168. </if>
  169. <if test='null != checkUser'>
  170. check_user,
  171. </if>
  172. <if test='null != confirmUser'>
  173. confirm_user,
  174. </if>
  175. <if test='null != czwt'>
  176. czwt,
  177. </if>
  178. <if test='null != createBy'>
  179. create_by,
  180. </if>
  181. <if test='null != createTime'>
  182. create_time,
  183. </if>
  184. <if test='null != updateBy'>
  185. update_by,
  186. </if>
  187. <if test='null != updateTime'>
  188. update_time,
  189. </if>
  190. <if test='null != submitState'>
  191. submit_state,
  192. </if>
  193. <if test='null != delFlag'>
  194. del_flag
  195. </if>
  196. </trim>
  197. <trim prefix="values (" suffix=")" suffixOverrides=",">
  198. <if test='null != blqId'>
  199. #{blqId},
  200. </if>
  201. <if test='null != deptStationId'>
  202. #{deptStationId},
  203. </if>
  204. <if test='null != pillarCode'>
  205. #{pillarCode},
  206. </if>
  207. <if test='null != temperature'>
  208. #{temperature},
  209. </if>
  210. <if test='null != checkDate'>
  211. #{checkDate},
  212. </if>
  213. <if test='null != picUrl'>
  214. #{picUrl},
  215. </if>
  216. <if test='null != tjwzBlqtjazsp'>
  217. #{tjwzBlqtjazsp},
  218. </if>
  219. <if test='null != tjwzBlqtjazspDesc'>
  220. #{tjwzBlqtjazspDesc},
  221. </if>
  222. <if test='null != tjwzWxs'>
  223. #{tjwzWxs},
  224. </if>
  225. <if test='null != tjwzWxsDesc'>
  226. #{tjwzWxsDesc},
  227. </if>
  228. <if test='null != tjwzGblsljjg'>
  229. #{tjwzGblsljjg},
  230. </if>
  231. <if test='null != tjwzGblsljjgDesc'>
  232. #{tjwzGblsljjgDesc},
  233. </if>
  234. <if test='null != blqjyzBlqjzcjyzcszzt'>
  235. #{blqjyzBlqjzcjyzcszzt},
  236. </if>
  237. <if test='null != blqjyzBlqjzcjyzcszztDesc'>
  238. #{blqjyzBlqjzcjyzcszztDesc},
  239. </if>
  240. <if test='null != blqjyzBmqjazlg'>
  241. #{blqjyzBmqjazlg},
  242. </if>
  243. <if test='null != blqjyzBmqjazlgDesc'>
  244. #{blqjyzBmqjazlgDesc},
  245. </if>
  246. <if test='null != blqyxBlqyxwssdg'>
  247. #{blqyxBlqyxwssdg},
  248. </if>
  249. <if test='null != blqyxBlqyxwssdgDesc'>
  250. #{blqyxBlqyxwssdgDesc},
  251. </if>
  252. <if test='null != blqyxGycyxdjdtdtzxjl'>
  253. #{blqyxGycyxdjdtdtzxjl},
  254. </if>
  255. <if test='null != tlqZtlhwpslh'>
  256. #{tlqZtlhwpslh},
  257. </if>
  258. <if test='null != tlqZtlhwpslhDesc'>
  259. #{tlqZtlhwpslhDesc},
  260. </if>
  261. <if test='null != jsqDzjs'>
  262. #{jsqDzjs},
  263. </if>
  264. <if test='null != blqjdztJddz'>
  265. #{blqjdztJddz},
  266. </if>
  267. <if test='null != sbzt'>
  268. #{sbzt},
  269. </if>
  270. <if test='null != sbztDesc'>
  271. #{sbztDesc},
  272. </if>
  273. <if test='null != checkUser'>
  274. #{checkUser},
  275. </if>
  276. <if test='null != confirmUser'>
  277. #{confirmUser},
  278. </if>
  279. <if test='null != czwt'>
  280. #{czwt},
  281. </if>
  282. <if test='null != createBy'>
  283. #{createBy},
  284. </if>
  285. <if test='null != createTime'>
  286. #{createTime},
  287. </if>
  288. <if test='null != updateBy'>
  289. #{updateBy},
  290. </if>
  291. <if test='null != updateTime'>
  292. #{updateTime},
  293. </if>
  294. <if test='null != submitState'>
  295. #{submitState},
  296. </if>
  297. <if test='null != delFlag'>
  298. #{delFlag}
  299. </if>
  300. </trim>
  301. </insert>
  302. <delete id="delete">
  303. UPDATE bus_jcb_blq
  304. set del_flag='1'
  305. WHERE id = #{id}
  306. </delete>
  307. <update id="update" parameterType="com.railway.business.catenary.domain.BusJcbBlq">
  308. UPDATE bus_jcb_blq
  309. <set>
  310. <if test='null != blqId'>blq_id = #{blqId},</if>
  311. <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
  312. <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
  313. <if test='null != temperature'>temperature = #{temperature},</if>
  314. <if test='null != checkDate'>check_date = #{checkDate},</if>
  315. <if test='null != picUrl'>pic_url = #{picUrl},</if>
  316. <if test='null != tjwzBlqtjazsp'>tjwz_blqtjazsp = #{tjwzBlqtjazsp},</if>
  317. <if test='null != tjwzBlqtjazspDesc'>tjwz_blqtjazsp_desc = #{tjwzBlqtjazspDesc},</if>
  318. <if test='null != tjwzWxs'>tjwz_wxs = #{tjwzWxs},</if>
  319. <if test='null != tjwzWxsDesc'>tjwz_wxs_desc = #{tjwzWxsDesc},</if>
  320. <if test='null != tjwzGblsljjg'>tjwz_gblsljjg = #{tjwzGblsljjg},</if>
  321. <if test='null != tjwzGblsljjgDesc'>tjwz_gblsljjg_desc = #{tjwzGblsljjgDesc},</if>
  322. <if test='null != blqjyzBlqjzcjyzcszzt'>blqjyz_blqjzcjyzcszzt = #{blqjyzBlqjzcjyzcszzt},</if>
  323. <if test='null != blqjyzBlqjzcjyzcszztDesc'>blqjyz_blqjzcjyzcszzt_desc = #{blqjyzBlqjzcjyzcszztDesc},</if>
  324. <if test='null != blqjyzBmqjazlg'>blqjyz_bmqjazlg = #{blqjyzBmqjazlg},</if>
  325. <if test='null != blqjyzBmqjazlgDesc'>blqjyz_bmqjazlg_desc = #{blqjyzBmqjazlgDesc},</if>
  326. <if test='null != blqyxBlqyxwssdg'>blqyx_blqyxwssdg = #{blqyxBlqyxwssdg},</if>
  327. <if test='null != blqyxBlqyxwssdgDesc'>blqyx_blqyxwssdg_desc = #{blqyxBlqyxwssdgDesc},</if>
  328. <if test='null != blqyxGycyxdjdtdtzxjl'>blqyx_gycyxdjdtdtzxjl = #{blqyxGycyxdjdtdtzxjl},</if>
  329. <if test='null != tlqZtlhwpslh'>tlq_ztlhwpslh = #{tlqZtlhwpslh},</if>
  330. <if test='null != tlqZtlhwpslhDesc'>tlq_ztlhwpslh_desc = #{tlqZtlhwpslhDesc},</if>
  331. <if test='null != jsqDzjs'>jsq_dzjs = #{jsqDzjs},</if>
  332. <if test='null != blqjdztJddz'>blqjdzt_jddz = #{blqjdztJddz},</if>
  333. <if test='null != sbzt'>sbzt = #{sbzt},</if>
  334. <if test='null != sbztDesc'>sbzt_desc = #{sbztDesc},</if>
  335. <if test='null != checkUser'>check_user = #{checkUser},</if>
  336. <if test='null != confirmUser'>confirm_user = #{confirmUser},</if>
  337. <if test='null != czwt'>czwt = #{czwt},</if>
  338. <if test='null != updateBy'>update_by = #{updateBy},</if>
  339. <if test='null != updateTime'>update_time = #{updateTime},</if>
  340. <if test='null != submitState'>submit_state = #{submitState},</if>
  341. <if test='null != delFlag'>del_flag = #{delFlag}</if>
  342. </set>
  343. WHERE id = #{id}
  344. </update>
  345. <select id="getInfo" resultMap="BaseResultMap">
  346. SELECT
  347. <include refid="Base_Column_List"/>
  348. FROM bus_jcb_blq t
  349. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  350. WHERE t.del_flag='0' and t.id = #{id}
  351. </select>
  352. <select id="getList" resultMap="BaseResultMap">
  353. SELECT
  354. <include refid="Base_Column_List"/>
  355. FROM bus_jcb_blq t
  356. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  357. <where>
  358. t.del_flag='0'
  359. <if test="blqId!=null and blqId!=''">
  360. and t.blq_id=#{blqId}
  361. </if>
  362. <if test="deptId!=null and deptId!=''">
  363. and v.dept_id=#{deptId}
  364. </if>
  365. <if test="stationId!=null and stationId!=''">
  366. and v.station_id=#{stationId}
  367. </if>
  368. <if test="stationIds!=null and stationIds.length > 0">
  369. and v.station_id in (#{stationIds}
  370. </if>
  371. <if test="pillarCode!=null and pillarCode!=''">
  372. and t.pillar_code=#{pillarCode}
  373. </if>
  374. <if test="temperature!=null and temperature!=''">
  375. and t.temperature=#{temperature}
  376. </if>
  377. <if test="checkDate!=null">
  378. and t.check_date=#{checkDate}
  379. </if>
  380. <if test="picUrl!=null and picUrl!=''">
  381. and t.pic_url=#{picUrl}
  382. </if>
  383. <if test="tjwzBlqtjazsp!=null and tjwzBlqtjazsp!=''">
  384. and t.tjwz_blqtjazsp=#{tjwzBlqtjazsp}
  385. </if>
  386. <if test="tjwzBlqtjazspDesc!=null and tjwzBlqtjazspDesc!=''">
  387. and t.tjwz_blqtjazsp_desc=#{tjwzBlqtjazspDesc}
  388. </if>
  389. <if test="tjwzWxs!=null and tjwzWxs!=''">
  390. and t.tjwz_wxs=#{tjwzWxs}
  391. </if>
  392. <if test="tjwzWxsDesc!=null and tjwzWxsDesc!=''">
  393. and t.tjwz_wxs_desc=#{tjwzWxsDesc}
  394. </if>
  395. <if test="tjwzGblsljjg!=null and tjwzGblsljjg!=''">
  396. and t.tjwz_gblsljjg=#{tjwzGblsljjg}
  397. </if>
  398. <if test="tjwzGblsljjgDesc!=null and tjwzGblsljjgDesc!=''">
  399. and t.tjwz_gblsljjg_desc=#{tjwzGblsljjgDesc}
  400. </if>
  401. <if test="blqjyzBlqjzcjyzcszzt!=null and blqjyzBlqjzcjyzcszzt!=''">
  402. and t.blqjyz_blqjzcjyzcszzt=#{blqjyzBlqjzcjyzcszzt}
  403. </if>
  404. <if test="blqjyzBlqjzcjyzcszztDesc!=null and blqjyzBlqjzcjyzcszztDesc!=''">
  405. and t.blqjyz_blqjzcjyzcszzt_desc=#{blqjyzBlqjzcjyzcszztDesc}
  406. </if>
  407. <if test="blqjyzBmqjazlg!=null and blqjyzBmqjazlg!=''">
  408. and t.blqjyz_bmqjazlg=#{blqjyzBmqjazlg}
  409. </if>
  410. <if test="blqjyzBmqjazlgDesc!=null and blqjyzBmqjazlgDesc!=''">
  411. and t.blqjyz_bmqjazlg_desc=#{blqjyzBmqjazlgDesc}
  412. </if>
  413. <if test="blqyxBlqyxwssdg!=null and blqyxBlqyxwssdg!=''">
  414. and t.blqyx_blqyxwssdg=#{blqyxBlqyxwssdg}
  415. </if>
  416. <if test="blqyxBlqyxwssdgDesc!=null and blqyxBlqyxwssdgDesc!=''">
  417. and t.blqyx_blqyxwssdg_desc=#{blqyxBlqyxwssdgDesc}
  418. </if>
  419. <if test="blqyxGycyxdjdtdtzxjl!=null and blqyxGycyxdjdtdtzxjl!=''">
  420. and t.blqyx_gycyxdjdtdtzxjl=#{blqyxGycyxdjdtdtzxjl}
  421. </if>
  422. <if test="tlqZtlhwpslh!=null and tlqZtlhwpslh!=''">
  423. and t.tlq_ztlhwpslh=#{tlqZtlhwpslh}
  424. </if>
  425. <if test="tlqZtlhwpslhDesc!=null and tlqZtlhwpslhDesc!=''">
  426. and t.tlq_ztlhwpslh_desc=#{tlqZtlhwpslhDesc}
  427. </if>
  428. <if test="jsqDzjs!=null and jsqDzjs!=''">
  429. and t.jsq_dzjs=#{jsqDzjs}
  430. </if>
  431. <if test="blqjdztJddz!=null and blqjdztJddz!=''">
  432. and t.blqjdzt_jddz=#{blqjdztJddz}
  433. </if>
  434. <if test="sbzt!=null and sbzt!=''">
  435. and t.sbzt=#{sbzt}
  436. </if>
  437. <if test="sbztDesc!=null and sbztDesc!=''">
  438. and t.sbzt_desc=#{sbztDesc}
  439. </if>
  440. <if test="checkUser!=null and checkUser!=''">
  441. and t.check_user=#{checkUser}
  442. </if>
  443. <if test="confirmUser!=null and confirmUser!=''">
  444. and t.confirm_user=#{confirmUser}
  445. </if>
  446. <if test="czwt!=null and czwt!=''">
  447. and t.czwt=#{czwt}
  448. </if>
  449. <if test="createBy!=null and createBy!=''">
  450. and t.create_by=#{createBy}
  451. </if>
  452. <if test="createTime!=null">
  453. and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
  454. </if>
  455. <if test="updateBy!=null and updateBy!=''">
  456. and t.update_by=#{updateBy}
  457. </if>
  458. <if test="updateTime!=null">
  459. and DATE_FORMAT(t.update_time, '%Y-%m-%d') = #{updateTime}
  460. </if>
  461. <if test="submitState!=null and submitState!=''">
  462. and t.submit_state <![CDATA[ >= ]]> #{submitState}
  463. </if>
  464. </where>
  465. <if test="orderBy!=null and orderBy!=''">
  466. order by t.${orderBy}
  467. </if>
  468. <if test="isAsc!=null and isAsc!=''">
  469. <if test="isAsc == '1'.toString()">
  470. asc
  471. </if>
  472. <if test="isAsc == '0'.toString()">
  473. desc
  474. </if>
  475. </if>
  476. </select>
  477. <select id="getLastOne" resultMap="BaseResultMap">
  478. SELECT
  479. <include refid="Base_Column_List"/>
  480. FROM
  481. bus_jcb_blq t
  482. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  483. WHERE
  484. t.submit_state = '1'and t.del_flag = '0'
  485. <if test="stationId!=null and stationId!=''">
  486. and v.station_id=#{stationId}
  487. </if>
  488. <if test="deptId!=null and deptId!=''">
  489. and v.dept_id=#{deptId}
  490. </if>
  491. <if test="pillarCode!=null and pillarCode!=''">
  492. and t.pillar_code=#{pillarCode}
  493. </if>
  494. <if test="blqId!=null and blqId!=''">
  495. and t.blq_id=#{blqId}
  496. </if>
  497. ORDER BY
  498. update_time DESC
  499. LIMIT 1
  500. </select>
  501. <select id="getJcebList" resultMap="BaseResultMap">
  502. SELECT
  503. <include refid="Base_Column_List"/>,base.sccj
  504. FROM bus_jcb_blq t
  505. LEFT JOIN base_blq base on t.pillar_code = base.pillar_code
  506. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  507. <where>
  508. t.del_flag='0'
  509. <if test="submitState!=null and submitState!=''">
  510. and t.submit_state <![CDATA[ >= ]]> #{submitState}
  511. </if>
  512. <if test="deptId!=null and deptId!=''">
  513. and v.dept_id=#{deptId}
  514. </if>
  515. <if test="stationId!=null and stationId!=''">
  516. and v.station_id=#{stationId}
  517. </if>
  518. <if test="stationIds!=null and stationIds.length > 0">
  519. and v.station_id in (#{stationIds}
  520. </if>
  521. <if test="pillarCode!=null and pillarCode!=''">
  522. and t.pillar_code=#{pillarCode}
  523. </if>
  524. <if test="operator!=null and operator!=''">
  525. and t.check_user like concat('%', #{operator}, '%')
  526. </if>
  527. <if test="createBy!=null and createBy!=''">
  528. and t.create_by=#{createBy}
  529. </if>
  530. <if test="operationDate!=null">
  531. and t.check_date=#{operationDate}
  532. </if>
  533. </where>
  534. </select>
  535. <resultMap id="JcabResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
  536. <result column="id" property="id"/>
  537. <result column="dept_name" property="deptName"/>
  538. <result column="station_name" property="stationName"/>
  539. <result column="check_date" property="operationDate"/>
  540. <result column="check_user" property="operator"/>
  541. <result column="jcebType" property="jcebType"/>
  542. </resultMap>
  543. <select id="getListByType" resultMap="JcabResultMap">
  544. SELECT t.id, v.dept_name, v.station_name, t.check_date, t.check_user, #{jcebType} as jcebType
  545. FROM bus_jcb_blq t
  546. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  547. <where>
  548. t.del_flag='0'
  549. <if test="submitState!=null and submitState!=''">
  550. and t.submit_state <![CDATA[ >= ]]> #{submitState}
  551. </if>
  552. <if test="deptId!=null and deptId!=''">
  553. and v.dept_id=#{deptId}
  554. </if>
  555. <if test="stationId!=null and stationId!=''">
  556. and v.station_id=#{stationId}
  557. </if>
  558. <if test="stationIds!=null and stationIds.length > 0">
  559. and v.station_id in (#{stationIds}
  560. </if>
  561. <if test="pillarCode!=null and pillarCode!=''">
  562. and t.pillar_code=#{pillarCode}
  563. </if>
  564. <if test="operator!=null and operator!=''">
  565. and t.check_user like concat('%', #{operator}, '%')
  566. </if>
  567. <if test="createBy!=null and createBy!=''">
  568. and t.create_by=#{createBy}
  569. </if>
  570. <if test="operationDate!=null">
  571. and t.check_date=#{operationDate}
  572. </if>
  573. </where>
  574. </select>
  575. <resultMap id="JcabCountResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
  576. <result column="c" property="count"/>
  577. <result column="check_date" property="operationDate"/>
  578. </resultMap>
  579. <select id="getCountByType" resultMap="JcabCountResultMap">
  580. SELECT count(*) c, max(t.check_date) as check_date
  581. FROM bus_jcb_blq t
  582. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  583. <where>
  584. t.del_flag='0'
  585. <if test="submitState!=null and submitState!=''">
  586. and t.submit_state <![CDATA[ >= ]]> #{submitState}
  587. </if>
  588. <if test="deptId!=null and deptId!=''">
  589. and v.dept_id=#{deptId}
  590. </if>
  591. <if test="stationId!=null and stationId!=''">
  592. and v.station_id=#{stationId}
  593. </if>
  594. <if test="pillarCode!=null and pillarCode!=''">
  595. and t.pillar_code=#{pillarCode}
  596. </if>
  597. <if test="operator!=null and operator!=''">
  598. and t.check_user like concat('%', #{operator}, '%')
  599. </if>
  600. <if test="createBy!=null and createBy!=''">
  601. and t.create_by=#{createBy}
  602. </if>
  603. <if test="operationDate!=null">
  604. and t.check_date=#{operationDate}
  605. </if>
  606. </where>
  607. </select>
  608. </mapper>