BusJcbDmcgyqMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  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.BusJcbDmcgyqMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcbDmcgyq">
  6. <result column="id" property="id"/>
  7. <result column="dept_id" property="deptId"/>
  8. <result column="dept_name" property="deptName"/>
  9. <result column="station_id" property="stationId"/>
  10. <result column="station_name" property="stationName"/>
  11. <result column="fenxiang" property="fenxiang"/>
  12. <result column="xingbie" property="xingbie"/>
  13. <result column="xingbie_text" property="xingbieText"/>
  14. <result column="pillar_area" property="pillarArea"/>
  15. <result column="tianqi" property="tianqi"/>
  16. <result column="temperature" property="temperature"/>
  17. <result column="check_date" property="checkDate"/>
  18. <result column="dgqwg_azlg" property="dgqwgAzlg"/>
  19. <result column="dgqwg_wzws" property="dgqwgWzws"/>
  20. <result column="dgqwg_bmqj" property="dgqwgBmqj"/>
  21. <result column="dgqwg_azlg_gzms" property="dgqwgAzlgGzms"/>
  22. <result column="dgqwg_wzws_gzms" property="dgqwgWzwsGzms"/>
  23. <result column="dgqwg_bmqj_gzms" property="dgqwgBmqjGzms"/>
  24. <result column="bspwg_bsqx" property="bspwgBsqx"/>
  25. <result column="bspwg_bsqx_gzms" property="bspwgBsqxGzms"/>
  26. <result column="bspwg_azlg" property="bspwgAzlg"/>
  27. <result column="bspwg_azlg_gzms" property="bspwgAzlgGzms"/>
  28. <result column="dgqcl_g1" property="dgqclG1"/>
  29. <result column="dgqcl_g2" property="dgqclG2"/>
  30. <result column="dgqcl_g3" property="dgqclG3"/>
  31. <result column="dgqcl_g4" property="dgqclG4"/>
  32. <result column="sbzt" property="sbzt"/>
  33. <result column="check_user" property="checkUser"/>
  34. <result column="confirm_user" property="confirmUser"/>
  35. <result column="czwt" property="czwt"/>
  36. <result column="submit_state" property="submitState"/>
  37. <result column="create_by" property="createBy"/>
  38. <result column="create_time" property="createTime"/>
  39. <result column="update_by" property="updateBy"/>
  40. <result column="update_time" property="updateTime"/>
  41. <result column="user_id" property="userId"/>
  42. </resultMap>
  43. <sql id="Base_Column_List">
  44. id,
  45. v.dept_id,
  46. v.dept_name,
  47. v.station_name as station_name,
  48. t.station_id,
  49. t.fenxiang,
  50. t.xingbie,
  51. t.pillar_area,
  52. t.tianqi,
  53. t.temperature,
  54. t.check_date,
  55. t.dgqwg_azlg,
  56. t.dgqwg_wzws,
  57. t.dgqwg_bmqj,
  58. t.dgqwg_azlg_gzms,
  59. t.dgqwg_wzws_gzms,
  60. t.dgqwg_bmqj_gzms,
  61. t.bspwg_bsqx,
  62. t.bspwg_bsqx_gzms,
  63. t.bspwg_azlg,
  64. t.bspwg_azlg_gzms,
  65. t.dgqcl_g1,
  66. t.dgqcl_g2,
  67. t.dgqcl_g3,
  68. t.dgqcl_g4,
  69. t.sbzt,
  70. t.check_user,
  71. t.confirm_user,
  72. t.czwt,
  73. t.submit_state,
  74. t.create_by,
  75. t.create_time,
  76. t.update_by,
  77. t.update_time,
  78. t.user_id
  79. </sql>
  80. <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcbDmcgyq">
  81. INSERT INTO bus_jcb_dmcgyq
  82. <trim prefix="(" suffix=")" suffixOverrides=",">
  83. <if test='null != stationId'>
  84. station_id,
  85. </if>
  86. <if test='null != fenxiang'>
  87. fenxiang,
  88. </if>
  89. <if test='null != xingbie'>
  90. xingbie,
  91. </if>
  92. <if test='null != pillarArea'>
  93. pillar_area,
  94. </if>
  95. <if test='null != tianqi'>
  96. tianqi,
  97. </if>
  98. <if test='null != temperature'>
  99. temperature,
  100. </if>
  101. <if test='null != checkDate'>
  102. check_date,
  103. </if>
  104. <if test='null != dgqwgAzlg'>
  105. dgqwg_azlg,
  106. </if>
  107. <if test='null != dgqwgWzws'>
  108. dgqwg_wzws,
  109. </if>
  110. <if test='null != dgqwgBmqj'>
  111. dgqwg_bmqj,
  112. </if>
  113. <if test='null != dgqwgAzlgGzms'>
  114. dgqwg_azlg_gzms,
  115. </if>
  116. <if test='null != dgqwgWzwsGzms'>
  117. dgqwg_wzws_gzms,
  118. </if>
  119. <if test='null != dgqwgBmqjGzms'>
  120. dgqwg_bmqj_gzms,
  121. </if>
  122. <if test='null != bspwgBsqx'>
  123. bspwg_bsqx,
  124. </if>
  125. <if test='null != bspwgBsqxGzms'>
  126. bspwg_bsqx_gzms,
  127. </if>
  128. <if test='null != bspwgAzlg'>
  129. bspwg_azlg,
  130. </if>
  131. <if test='null != bspwgAzlgGzms'>
  132. bspwg_azlg_gzms,
  133. </if>
  134. <if test='null != dgqclG1'>
  135. dgqcl_g1,
  136. </if>
  137. <if test='null != dgqclG2'>
  138. dgqcl_g2,
  139. </if>
  140. <if test='null != dgqclG3'>
  141. dgqcl_g3,
  142. </if>
  143. <if test='null != dgqclG4'>
  144. dgqcl_g4,
  145. </if>
  146. <if test='null != sbzt'>
  147. sbzt,
  148. </if>
  149. <if test='null != checkUser'>
  150. check_user,
  151. </if>
  152. <if test='null != czwt'>
  153. czwt,
  154. </if>
  155. <if test='null != submitState'>
  156. submit_state,
  157. </if>
  158. <if test='null != createBy'>
  159. create_by,
  160. </if>
  161. <if test='null != createTime'>
  162. create_time,
  163. </if>
  164. <if test='null != updateBy'>
  165. update_by,
  166. </if>
  167. <if test='null != updateTime'>
  168. update_time,
  169. </if>
  170. <if test='null != userId'>
  171. user_id
  172. </if>
  173. </trim>
  174. <trim prefix="values (" suffix=")" suffixOverrides=",">
  175. <if test='null != stationId'>
  176. #{stationId},
  177. </if>
  178. <if test='null != fenxiang'>
  179. #{fenxiang},
  180. </if>
  181. <if test='null != xingbie'>
  182. #{xingbie},
  183. </if>
  184. <if test='null != pillarArea'>
  185. #{pillarArea},
  186. </if>
  187. <if test='null != tianqi'>
  188. #{tianqi},
  189. </if>
  190. <if test='null != temperature'>
  191. #{temperature},
  192. </if>
  193. <if test='null != checkDate'>
  194. #{checkDate},
  195. </if>
  196. <if test='null != dgqwgAzlg'>
  197. #{dgqwgAzlg},
  198. </if>
  199. <if test='null != dgqwgWzws'>
  200. #{dgqwgWzws},
  201. </if>
  202. <if test='null != dgqwgBmqj'>
  203. #{dgqwgBmqj},
  204. </if>
  205. <if test='null != dgqwgAzlgGzms'>
  206. #{dgqwgAzlgGzms},
  207. </if>
  208. <if test='null != dgqwgWzwsGzms'>
  209. #{dgqwgWzwsGzms},
  210. </if>
  211. <if test='null != dgqwgBmqjGzms'>
  212. #{dgqwgBmqjGzms},
  213. </if>
  214. <if test='null != bspwgBsqx'>
  215. #{bspwgBsqx},
  216. </if>
  217. <if test='null != bspwgBsqxGzms'>
  218. #{bspwgBsqxGzms},
  219. </if>
  220. <if test='null != bspwgAzlg'>
  221. #{bspwgAzlg},
  222. </if>
  223. <if test='null != bspwgAzlgGzms'>
  224. #{bspwgAzlgGzms},
  225. </if>
  226. <if test='null != dgqclG1'>
  227. #{dgqclG1},
  228. </if>
  229. <if test='null != dgqclG2'>
  230. #{dgqclG2},
  231. </if>
  232. <if test='null != dgqclG3'>
  233. #{dgqclG3},
  234. </if>
  235. <if test='null != dgqclG4'>
  236. #{dgqclG4},
  237. </if>
  238. <if test='null != sbzt'>
  239. #{sbzt},
  240. </if>
  241. <if test='null != checkUser'>
  242. #{checkUser},
  243. </if>
  244. <if test='null != czwt'>
  245. #{czwt},
  246. </if>
  247. <if test='null != submitState'>
  248. #{submitState},
  249. </if>
  250. <if test='null != createBy'>
  251. #{createBy},
  252. </if>
  253. <if test='null != createTime'>
  254. #{createTime},
  255. </if>
  256. <if test='null != updateBy'>
  257. #{updateBy},
  258. </if>
  259. <if test='null != updateTime'>
  260. #{updateTime},
  261. </if>
  262. <if test='null != userId'>
  263. #{userId}
  264. </if>
  265. </trim>
  266. </insert>
  267. <delete id="delete">
  268. UPDATE bus_jcb_dmcgyq
  269. set del_flag='1'
  270. WHERE id = #{id}
  271. </delete>
  272. <update id="update" parameterType="com.railway.business.catenary.domain.BusJcbDmcgyq">
  273. UPDATE bus_jcb_dmcgyq
  274. <set>
  275. <if test='null != stationId'>station_id = #{stationId},</if>
  276. <if test='null != fenxiang'>fenxiang = #{fenxiang},</if>
  277. <if test='null != xingbie'>xingbie = #{xingbie},</if>
  278. <if test='null != pillarArea'>pillar_area = #{pillarArea},</if>
  279. <if test='null != tianqi'>tianqi = #{tianqi},</if>
  280. <if test='null != temperature'>temperature = #{temperature},</if>
  281. <if test='null != checkDate'>check_date = #{checkDate},</if>
  282. <if test='null != dgqwgAzlg'>dgqwg_azlg = #{dgqwgAzlg},</if>
  283. <if test='null != dgqwgWzws'>dgqwg_wzws = #{dgqwgWzws},</if>
  284. <if test='null != dgqwgBmqj'>dgqwg_bmqj = #{dgqwgBmqj},</if>
  285. <if test='null != dgqwgAzlgGzms'>dgqwg_azlg_gzms = #{dgqwgAzlgGzms},</if>
  286. <if test='null != dgqwgWzwsGzms'>dgqwg_wzws_gzms = #{dgqwgWzwsGzms},</if>
  287. <if test='null != dgqwgBmqjGzms'>dgqwg_bmqj_gzms = #{dgqwgBmqjGzms},</if>
  288. <if test='null != bspwgBsqx'>bspwg_bsqx = #{bspwgBsqx},</if>
  289. <if test='null != bspwgBsqxGzms'>bspwg_bsqx_gzms = #{bspwgBsqxGzms},</if>
  290. <if test='null != bspwgAzlg'>bspwg_azlg = #{bspwgAzlg},</if>
  291. <if test='null != bspwgAzlgGzms'>bspwg_azlg_gzms = #{bspwgAzlgGzms},</if>
  292. <if test='null != dgqclG1'>dgqcl_g1 = #{dgqclG1},</if>
  293. <if test='null != dgqclG2'>dgqcl_g2 = #{dgqclG2},</if>
  294. <if test='null != dgqclG3'>dgqcl_g3 = #{dgqclG3},</if>
  295. <if test='null != dgqclG4'>dgqcl_g4 = #{dgqclG4},</if>
  296. <if test='null != sbzt'>sbzt = #{sbzt},</if>
  297. <if test='null != checkUser'>check_user = #{checkUser},</if>
  298. <if test='null != czwt'>czwt = #{czwt},</if>
  299. <if test='null != submitState'>submit_state = #{submitState},</if>
  300. <if test='null != updateBy'>update_by = #{updateBy},</if>
  301. <if test='null != updateTime'>update_time = #{updateTime},</if>
  302. <if test='null != userId'>user_id = #{userId}</if>
  303. </set>
  304. WHERE id = #{id}
  305. </update>
  306. <select id="getInfo" resultMap="BaseResultMap">
  307. SELECT
  308. <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
  309. FROM bus_jcb_dmcgyq t
  310. LEFT JOIN v_station v on t.station_id = v.dept_station_id
  311. LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
  312. WHERE t.del_flag='0' and t.id = #{id}
  313. </select>
  314. <select id="getLastRecord" resultMap="BaseResultMap">
  315. SELECT
  316. a.DGQCL_G1, a.DGQCL_G2, a.DGQCL_G3, a.DGQCL_G4
  317. FROM bus_jcb_dmcgyq a,
  318. (
  319. select max(update_time) as lastTime
  320. from bus_jcb_dmcgyq
  321. WHERE user_id = #{user_id}
  322. and submit_state != '0'
  323. ) b
  324. WHERE a.update_time = b.lastTime
  325. </select>
  326. <select id="getList" resultMap="BaseResultMap">
  327. SELECT
  328. <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
  329. FROM bus_jcb_dmcgyq t
  330. LEFT JOIN v_station v on t.station_id = v.dept_station_id
  331. LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
  332. <where>
  333. t.del_flag='0'
  334. <if test="stationId!=null and stationId!=''">
  335. and t.station_id=#{stationId}
  336. </if>
  337. <if test="fenxiang!=null and fenxiang!=''">
  338. and t.fenxiang=#{fenxiang}
  339. </if>
  340. <if test="xingbie!=null and xingbie!=''">
  341. and t.xingbie=#{xingbie}
  342. </if>
  343. <if test="pillarArea!=null and pillarArea!=''">
  344. and t.pillar_area=#{pillarArea}
  345. </if>
  346. <if test="tianqi!=null and tianqi!=''">
  347. and t.tianqi=#{tianqi}
  348. </if>
  349. <if test="temperature!=null and temperature!=''">
  350. and t.temperature=#{temperature}
  351. </if>
  352. <if test="checkDate!=null and checkDate!=''">
  353. and t.check_date=#{checkDate}
  354. </if>
  355. <if test="dgqwgAzlg!=null and dgqwgAzlg!=''">
  356. and t.dgqwg_azlg=#{dgqwgAzlg}
  357. </if>
  358. <if test="dgqwgWzws!=null and dgqwgWzws!=''">
  359. and t.dgqwg_wzws=#{dgqwgWzws}
  360. </if>
  361. <if test="dgqwgBmqj!=null and dgqwgBmqj!=''">
  362. and t.dgqwg_bmqj=#{dgqwgBmqj}
  363. </if>
  364. <if test="dgqwgAzlgGzms!=null and dgqwgAzlgGzms!=''">
  365. and t.dgqwg_azlg_gzms=#{dgqwgAzlgGzms}
  366. </if>
  367. <if test="dgqwgWzwsGzms!=null and dgqwgWzwsGzms!=''">
  368. and t.dgqwg_wzws_gzms=#{dgqwgWzwsGzms}
  369. </if>
  370. <if test="dgqwgBmqjGzms!=null and dgqwgBmqjGzms!=''">
  371. and t.dgqwg_bmqj_gzms=#{dgqwgBmqjGzms}
  372. </if>
  373. <if test="bspwgBsqx!=null and bspwgBsqx!=''">
  374. and t.bspwg_bsqx=#{bspwgBsqx}
  375. </if>
  376. <if test="bspwgBsqxGzms!=null and bspwgBsqxGzms!=''">
  377. and t.bspwg_bsqx_gzms=#{bspwgBsqxGzms}
  378. </if>
  379. <if test="bspwgAzlg!=null and bspwgAzlg!=''">
  380. and t.bspwg_azlg=#{bspwgAzlg}
  381. </if>
  382. <if test="bspwgAzlgGzms!=null and bspwgAzlgGzms!=''">
  383. and t.bspwg_azlg_gzms=#{bspwgAzlgGzms}
  384. </if>
  385. <if test="dgqclG1!=null and dgqclG1!=''">
  386. and t.dgqcl_g1=#{dgqclG1}
  387. </if>
  388. <if test="dgqclG2!=null and dgqclG2!=''">
  389. and t.dgqcl_g2=#{dgqclG2}
  390. </if>
  391. <if test="dgqclG3!=null and dgqclG3!=''">
  392. and t.dgqcl_g3=#{dgqclG3}
  393. </if>
  394. <if test="dgqclG4!=null and dgqclG4!=''">
  395. and t.dgqcl_g4=#{dgqclG4}
  396. </if>
  397. <if test="sbzt!=null and sbzt!=''">
  398. and t.sbzt=#{sbzt}
  399. </if>
  400. <if test="checkUser!=null and checkUser!=''">
  401. and t.check_user=#{checkUser}
  402. </if>
  403. <if test="czwt!=null and czwt!=''">
  404. and t.czwt=#{czwt}
  405. </if>
  406. <if test="submitState!=null and submitState!=''">
  407. and t.submit_state=#{submitState}
  408. </if>
  409. <if test="createBy!=null and createBy!=''">
  410. and t.create_by=#{createBy}
  411. </if>
  412. <if test="createTime!=null and createTime!=''">
  413. and t.create_time=#{createTime}
  414. </if>
  415. <if test="updateBy!=null and updateBy!=''">
  416. and t.update_by=#{updateBy}
  417. </if>
  418. <if test="updateTime!=null and updateTime!=''">
  419. and t.update_time=#{updateTime}
  420. </if>
  421. <if test="userId!=null and userId!=''">
  422. and t.user_id=#{userId}
  423. </if>
  424. </where>
  425. <if test="orderBy!=null and orderBy!=''">
  426. order by t.${orderBy}
  427. </if>
  428. <if test="isAsc!=null and isAsc!=''">
  429. <if test="isAsc == '1'.toString()">
  430. asc
  431. </if>
  432. <if test="isAsc == '0'.toString()">
  433. desc
  434. </if>
  435. </if>
  436. </select>
  437. </mapper>