BusJcebLbjghjlMapper.xml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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.BusJcebLbjghjlMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcebLbjghjl">
  6. <result column="id" property="id"/>
  7. <result column="station_id" property="stationId"/>
  8. <result column="station_name" property="stationName"/>
  9. <result column="dd" property="dd"/>
  10. <result column="ghq_mc" property="ghqMc"/>
  11. <result column="ghq_ggxh" property="ghqGgxh"/>
  12. <result column="ghq_sccj" property="ghqSccj"/>
  13. <result column="ghh_mc" property="ghhMc"/>
  14. <result column="ghh_ggxh" property="ghhGgxh"/>
  15. <result column="ghh_sccj" property="ghhSccj"/>
  16. <result column="ghyy" property="ghyy"/>
  17. <result column="operation_date" property="operationDate"/>
  18. <result column="operator" property="operator"/>
  19. <result column="remark" property="remark"/>
  20. <result column="submit_state" property="submitState"/>
  21. <result column="del_flag" property="delFlag"/>
  22. <result column="create_by" property="createBy"/>
  23. <result column="create_time" property="createTime"/>
  24. <result column="update_by" property="updateBy"/>
  25. <result column="update_time" property="updateTime"/>
  26. </resultMap>
  27. <sql id="Base_Column_List">
  28. id,
  29. station_id,
  30. station_name,
  31. dd,
  32. ghq_mc,
  33. ghq_ggxh,
  34. ghq_sccj,
  35. ghh_mc,
  36. ghh_ggxh,
  37. ghh_sccj,
  38. ghyy,
  39. operation_date,
  40. operator,
  41. remark,
  42. submit_state,
  43. del_flag,
  44. create_by,
  45. create_time,
  46. update_by,
  47. update_time
  48. </sql>
  49. <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcebLbjghjl">
  50. <selectKey keyProperty="id" order="BEFORE" resultType="String">
  51. select replace(uuid(), '-', '') from dual
  52. </selectKey>
  53. INSERT INTO bus_jceb_lbjghjl
  54. <trim prefix="(" suffix=")" suffixOverrides=",">
  55. <if test='null != stationId'>
  56. station_id,
  57. </if>
  58. <if test='null != dd'>
  59. dd,
  60. </if>
  61. <if test='null != ghqMc'>
  62. ghq_mc,
  63. </if>
  64. <if test='null != ghqGgxh'>
  65. ghq_ggxh,
  66. </if>
  67. <if test='null != ghqSccj'>
  68. ghq_sccj,
  69. </if>
  70. <if test='null != ghhMc'>
  71. ghh_mc,
  72. </if>
  73. <if test='null != ghhGgxh'>
  74. ghh_ggxh,
  75. </if>
  76. <if test='null != ghhSccj'>
  77. ghh_sccj,
  78. </if>
  79. <if test='null != ghyy'>
  80. ghyy,
  81. </if>
  82. <if test='null != operationDate'>
  83. operation_date,
  84. </if>
  85. <if test='null != operator'>
  86. operator,
  87. </if>
  88. <if test='null != remark'>
  89. remark,
  90. </if>
  91. <if test='null != submitState'>
  92. submit_state,
  93. </if>
  94. <if test='null != delFlag'>
  95. del_flag,
  96. </if>
  97. <if test='null != createBy'>
  98. create_by,
  99. </if>
  100. <if test='null != createTime'>
  101. create_time,
  102. </if>
  103. <if test='null != updateBy'>
  104. update_by,
  105. </if>
  106. <if test='null != updateTime'>
  107. update_time
  108. </if>
  109. </trim>
  110. <trim prefix="values (" suffix=")" suffixOverrides=",">
  111. <if test='null != stationId'>
  112. #{stationId},
  113. </if>
  114. <if test='null != dd'>
  115. #{dd},
  116. </if>
  117. <if test='null != ghqMc'>
  118. #{ghqMc},
  119. </if>
  120. <if test='null != ghqGgxh'>
  121. #{ghqGgxh},
  122. </if>
  123. <if test='null != ghqSccj'>
  124. #{ghqSccj},
  125. </if>
  126. <if test='null != ghhMc'>
  127. #{ghhMc},
  128. </if>
  129. <if test='null != ghhGgxh'>
  130. #{ghhGgxh},
  131. </if>
  132. <if test='null != ghhSccj'>
  133. #{ghhSccj},
  134. </if>
  135. <if test='null != ghyy'>
  136. #{ghyy},
  137. </if>
  138. <if test='null != operationDate'>
  139. #{operationDate},
  140. </if>
  141. <if test='null != operator'>
  142. #{operator},
  143. </if>
  144. <if test='null != remark'>
  145. #{remark},
  146. </if>
  147. <if test='null != submitState'>
  148. #{submitState},
  149. </if>
  150. <if test='null != delFlag'>
  151. #{delFlag},
  152. </if>
  153. <if test='null != createBy'>
  154. #{createBy},
  155. </if>
  156. <if test='null != createTime'>
  157. #{createTime},
  158. </if>
  159. <if test='null != updateBy'>
  160. #{updateBy},
  161. </if>
  162. <if test='null != updateTime'>
  163. #{updateTime}
  164. </if>
  165. </trim>
  166. </insert>
  167. <delete id="delete">
  168. UPDATE bus_jceb_lbjghjl
  169. set del_flag='1'
  170. WHERE id = #{id}
  171. </delete>
  172. <update id="update" parameterType="com.railway.business.catenary.domain.BusJcebLbjghjl">
  173. UPDATE bus_jceb_lbjghjl
  174. <set>
  175. <if test='null != stationId'>station_id = #{stationId},</if>
  176. <if test='null != dd'>dd = #{dd},</if>
  177. <if test='null != ghqMc'>ghq_mc = #{ghqMc},</if>
  178. <if test='null != ghqGgxh'>ghq_ggxh = #{ghqGgxh},</if>
  179. <if test='null != ghqSccj'>ghq_sccj = #{ghqSccj},</if>
  180. <if test='null != ghhMc'>ghh_mc = #{ghhMc},</if>
  181. <if test='null != ghhGgxh'>ghh_ggxh = #{ghhGgxh},</if>
  182. <if test='null != ghhSccj'>ghh_sccj = #{ghhSccj},</if>
  183. <if test='null != ghyy'>ghyy = #{ghyy},</if>
  184. <if test='null != operationDate'>operation_date = #{operationDate},</if>
  185. <if test='null != operator'>operator = #{operator},</if>
  186. <if test='null != remark'>remark = #{remark},</if>
  187. <if test='null != submitState'>submit_state = #{submitState},</if>
  188. <if test='null != delFlag'>del_flag = #{delFlag},</if>
  189. <if test='null != updateBy'>update_by = #{updateBy},</if>
  190. <if test='null != updateTime'>update_time = #{updateTime}</if>
  191. </set>
  192. WHERE id = #{id}
  193. </update>
  194. <select id="getInfo" resultMap="BaseResultMap">
  195. SELECT
  196. DISTINCT
  197. v.station_name,
  198. a.*
  199. FROM bus_jceb_lbjghjl a
  200. LEFT JOIN v_station v ON a.station_id = v.station_id
  201. WHERE
  202. a.del_flag = '0'
  203. AND s.del_flag = '0'
  204. AND a.id = #{id}
  205. </select>
  206. <select id="getList" resultMap="BaseResultMap">
  207. SELECT
  208. v.station_name,
  209. a.*
  210. FROM bus_jceb_lbjghjl a
  211. LEFT JOIN v_station v ON a.station_id = v.station_id
  212. <where>
  213. a.del_flag = '0'
  214. <if test="stationId!=null and stationId!=''">
  215. and a.station_id=#{stationId}
  216. </if>
  217. <if test="dd!=null and dd!=''">
  218. and a.dd=#{dd}
  219. </if>
  220. <if test="ghqMc!=null and ghqMc!=''">
  221. and a.ghq_mc=#{ghqMc}
  222. </if>
  223. <if test="ghqGgxh!=null and ghqGgxh!=''">
  224. and a.ghq_ggxh=#{ghqGgxh}
  225. </if>
  226. <if test="ghqSccj!=null and ghqSccj!=''">
  227. and a.ghq_sccj=#{ghqSccj}
  228. </if>
  229. <if test="ghhMc!=null and ghhMc!=''">
  230. and a.ghh_mc=#{ghhMc}
  231. </if>
  232. <if test="ghhGgxh!=null and ghhGgxh!=''">
  233. and a.ghh_ggxh=#{ghhGgxh}
  234. </if>
  235. <if test="ghhSccj!=null and ghhSccj!=''">
  236. and a.ghh_sccj=#{ghhSccj}
  237. </if>
  238. <if test="ghyy!=null and ghyy!=''">
  239. and a.ghyy=#{ghyy}
  240. </if>
  241. <if test="operationDate!=null and operationDate!=''">
  242. and a.operation_date=#{operationDate}
  243. </if>
  244. <if test="operator!=null and operator!=''">
  245. and a.operator=#{operator}
  246. </if>
  247. <if test="remark!=null and remark!=''">
  248. and a.remark=#{remark}
  249. </if>
  250. <if test="submitState!=null and submitState!=''">
  251. and a.submit_state=#{submitState}
  252. </if>
  253. <if test="delFlag!=null and delFlag!=''">
  254. and a.del_flag=#{delFlag}
  255. </if>
  256. <if test="createBy!=null and createBy!=''">
  257. and a.create_by=#{createBy}
  258. </if>
  259. <if test="createTime!=null and createTime!=''">
  260. and a.create_time=#{createTime}
  261. </if>
  262. <if test="updateBy!=null and updateBy!=''">
  263. and a.update_by=#{updateBy}
  264. </if>
  265. <if test="updateTime!=null and updateTime!=''">
  266. and a.update_time=#{updateTime}
  267. </if>
  268. </where>
  269. order by a.operation_date desc
  270. </select>
  271. <resultMap id="JcebResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
  272. <result column="dept_name" property="deptName"/>
  273. <result column="station_name" property="stationName"/>
  274. <result column="operation_date" property="operationDate"/>
  275. <result column="operator" property="operator"/>
  276. <result column="jcebType" property="jcebType"/>
  277. </resultMap>
  278. <select id="getListByType" resultMap="JcebResultMap">
  279. SELECT v.dept_name, v.station_name, t.operation_date, t.operator, #{jcebType} as jcebType
  280. FROM bus_jceb_lbjghjl t
  281. LEFT JOIN v_station v on t.station_id = v.station_id
  282. <where>
  283. t.del_flag='0'
  284. <if test="stationId!=null and stationId!=''">
  285. and t.station_id=#{stationId}
  286. </if>
  287. <if test="pillarCode!=null and pillarCode!=''">
  288. and t.pillar_start=#{pillarCode}
  289. </if>
  290. <if test="operator!=null and operator!=''">
  291. and t.operator=#{operator}
  292. </if>
  293. </where>
  294. </select>
  295. <resultMap id="JcebCountResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
  296. <result column="c" property="count"/>
  297. <result column="operation_date" property="operationDate"/>
  298. </resultMap>
  299. <select id="getCountByType" resultMap="JcebCountResultMap">
  300. SELECT count(*) c, max(t.operation_date) as operation_date
  301. FROM bus_jceb_lbjghjl t
  302. LEFT JOIN v_station v on t.station_id = v.station_id
  303. <where>
  304. t.del_flag='0'
  305. <if test="stationId!=null and stationId!=''">
  306. and t.station_id=#{stationId}
  307. </if>
  308. <if test="pillarCode!=null and pillarCode!=''">
  309. and t.pillar_start=#{pillarCode}
  310. </if>
  311. <if test="operator!=null and operator!=''">
  312. and t.operator=#{operator}
  313. </if>
  314. </where>
  315. </select>
  316. </mapper>