BusJcbBlqMapper.xml 22 KB

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